[MDEV-23371] main.range_innodb failed in buildbot, server crashed in _db_doprnt_ Created: 2020-08-02  Updated: 2023-11-29  Resolved: 2022-11-08

Status: Closed
Project: MariaDB Server
Component/s: Debug, Storage Engine - InnoDB, Tests
Affects Version/s: 10.2, 10.3, 10.4, 10.5
Fix Version/s: 10.3.38, 10.4.28, 10.5.19, 10.6.12, 10.7.8, 10.8.7, 10.9.5, 10.10.3

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: purge

Issue Links:
Duplicate
is duplicated by MDEV-13261 rpl.rpl_gtid_errorhandling failed in ... Closed
Relates
relates to MDEV-29613 Improve WITH_DBUG_TRACE=OFF Closed

 Description   

http://buildbot.askmonty.org/buildbot/builders/kvm-fulltest2/builds/23468/steps/mtr_nm/logs/stdio

10.2 fbfb5b5f68a4

main.range_innodb 'innodb'               w1 [ fail ]
        Test ended at 2020-07-01 04:57:16
 
CURRENT_TEST: main.range_innodb
mysqltest: At line 115: query 'SET @@GLOBAL.debug_dbug = @saved_dbug' failed: 2013: Lost connection to MySQL server during query

2020-07-01  4:57:14 2953296704 [ERROR] Got error 128 when reading table './test/t1'
200701  4:57:14 [ERROR] mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
 
To report this bug, see https://mariadb.com/kb/en/reporting-bugs
 
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed, 
something is definitely wrong and this may fail.
 
Server version: 10.2.33-MariaDB-debug-log
key_buffer_size=1048576
read_buffer_size=131072
max_used_connections=3
max_threads=153
thread_count=11
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 61891 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
 
Thread pointer: 0x82bbf820
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0xa80f223c thread_stack 0x49000
/mnt/buildbot/build/mariadb-10.2.33/sql/mysqld(my_print_stacktrace+0x33)[0x80daf6b1]
mysys/stacktrace.c:267(my_print_stacktrace)[0x806a5070]
addr2line: '': No such file
[0xb76fac14]
dbug/dbug.c:1310(_db_doprnt_)[0x80dcf4d6]
que/que0que.cc:982(que_thr_step(que_thr_t*))[0x80a80e6c]
que/que0que.cc:1104(que_run_threads_low(que_thr_t*))[0x80a812ea]
que/que0que.cc:1144(que_run_threads(que_thr_t*))[0x80a814a7]
srv/srv0srv.cc:2571(srv_task_execute(srv_slot_t*))[0x80b32df1]
srv/srv0srv.cc:2618(srv_worker_thread)[0x80b32f57]
/lib/i386-linux-gnu/libpthread.so.0(+0x62b5)[0xb73532b5]
/lib/i386-linux-gnu/libc.so.6(clone+0x6e)[0xb709416e]
 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x0): 
Connection ID (thread ID): 2
Status: NOT_KILLED
 
Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on
 
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
Writing a core file...
Working directory at /dev/shm/var_auto_x3RJ/1/mysqld.1/data
Resource Limits:
Limit                     Soft Limit           Hard Limit           Units     
Max cpu time              unlimited            unlimited            seconds   
Max file size             unlimited            unlimited            bytes     
Max data size             unlimited            unlimited            bytes     
Max stack size            8388608              unlimited            bytes     
Max core file size        unlimited            unlimited            bytes     
Max resident set          unlimited            unlimited            bytes     
Max processes             48287                48287                processes 
Max open files            1024                 1024                 files     
Max locked memory         65536                65536                bytes     
Max address space         unlimited            unlimited            bytes     
Max file locks            unlimited            unlimited            locks     
Max pending signals       48287                48287                signals   
Max msgqueue size         819200               819200               bytes     
Max nice priority         0                    0                    
Max realtime priority     0                    0                    
Max realtime timeout      unlimited            unlimited            us        
Core pattern: |/usr/share/apport/apport %p %s %c %P

#4  <signal handler called>
#5  0x80dcf4d6 in _db_doprnt_ (format=0x8102238a "Execute %u (%s) at %p") at /home/buildbot/buildbot/build/mariadb-10.2.33/dbug/dbug.c:1310
#6  0x80a80e6c in que_thr_step (thr=0x82bae120) at /home/buildbot/buildbot/build/mariadb-10.2.33/storage/innobase/que/que0que.cc:982
#7  0x80a812ea in que_run_threads_low (thr=0x82bae120) at /home/buildbot/buildbot/build/mariadb-10.2.33/storage/innobase/que/que0que.cc:1104
#8  0x80a814a7 in que_run_threads (thr=0x82bae120) at /home/buildbot/buildbot/build/mariadb-10.2.33/storage/innobase/que/que0que.cc:1144
#9  0x80b32df1 in srv_task_execute (slot=0x81551434 <srv_sys+244>) at /home/buildbot/buildbot/build/mariadb-10.2.33/storage/innobase/srv/srv0srv.cc:2571
#10 0x80b32f57 in srv_worker_thread (arg=0x0) at /home/buildbot/buildbot/build/mariadb-10.2.33/storage/innobase/srv/srv0srv.cc:2618
#11 0xb73532b5 in start_thread () from /lib/i386-linux-gnu/libpthread.so.0
#12 0xb709416e in clone () from /lib/i386-linux-gnu/libc.so.6



 Comments   
Comment by Marko Mäkelä [ 2020-08-03 ]

The following is the currently executing statement in _db_doprnt_():

    (void) fprintf(cs->stack->out_file->file, "%s: ", cs->func);

Could it be that these parts of cs or the data that it is pointed to would become invalid when DBUG is disabled? I see no locking in the predicate check:

#define DBUG_PRINT(keyword,arglist) \
        do if (_db_pargs_(__LINE__,keyword)) _db_doprnt_ arglist; while(0)

The invocation in que_thr_step() looks like this:

	DBUG_PRINT("ib_que", ("Execute %u (%s) at %p",
			      unsigned(type), que_node_type_string(node),
			      (const void*) node));

I do not think that this particular DBUG_PRINT brings much value. And perhaps we should simplify the purge of InnoDB transactions so that it will avoid using que_thr_t objects at all.

Comment by Marko Mäkelä [ 2022-11-08 ]

Starting with MDEV-29613 (MariaDB Server 10.4.27), I believe that this crash could be avoided by configuring the debug-instrumented server as follows:

cmake -DWITH_DBUG_TRACE=OFF

Comment by Marko Mäkelä [ 2022-11-08 ]

I worked around this apparent race condition in DBUG_PRINT() by removing some DBUG calls from the InnoDB internal SQL interpreter. The interpreter is also being used for purging the history of committed transactions.

Generated at Thu Feb 08 09:21:54 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.