[MDEV-31119] Crash with heap dump Created: 2023-04-24  Updated: 2023-06-25  Resolved: 2023-06-25

Status: Closed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.4, 10.4.28
Fix Version/s: 10.4.29

Type: Bug Priority: Major
Reporter: george he Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Environment:

Windows Server 2008R2


Attachments: File mysqld.dmp    

 Description   

Mariadb crashes about once per several days.
Following is the error log.
I can upload full heap dump if needed.

230421 17:04:31 [ERROR] mysqld got exception 0xc0000005 ;
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.4.28-MariaDB source revision: c8f2e9a5c0ac5905f28b050b7df5a9ffd914b7e7
key_buffer_size=134217728
read_buffer_size=131072
max_used_connections=12
max_threads=65537
thread_count=16
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 136398 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
 
Thread pointer: 0x33c874a8
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...
ntdll.dll!RtlFreeHeap()
ucrtbase.DLL!_free_base()
mysqld.exe!btr_search_build_page_hash_index()[btr0sea.cc:1521]
mysqld.exe!btr_search_info_update_slow()[btr0sea.cc:1573]
mysqld.exe!btr_cur_search_to_nth_level()[btr0cur.cc:2491]
mysqld.exe!btr_pcur_open_low()[btr0pcur.inl:441]
mysqld.exe!row_search_on_row_ref()[row0row.cc:1217]
mysqld.exe!row_purge_reposition_pcur()[row0purge.cc:81]
mysqld.exe!row_purge_reset_trx_id()[row0purge.cc:802]
mysqld.exe!row_purge_record_func()[row0purge.cc:1349]
mysqld.exe!row_purge()[row0purge.cc:1401]
mysqld.exe!row_purge_step()[row0purge.cc:1478]
mysqld.exe!que_thr_step()[que0que.cc:966]
mysqld.exe!que_run_threads_low()[que0que.cc:1031]
mysqld.exe!que_run_threads()[que0que.cc:1070]
mysqld.exe!srv_task_execute()[srv0srv.cc:2433]
mysqld.exe!srv_worker_thread()[srv0srv.cc:2487]
kernel32.dll!BaseThreadInitThunk()
ntdll.dll!RtlUserThreadStart()
 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x0): 
Connection ID (thread ID): 4
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=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on
 
The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
information that should help you find out what is causing the crash.
Writing a core file at D:\Program Files\MariaDB 10.4\data\
Minidump written to D:\Program Files\MariaDB 10.4\data\mysqld.dmp



 Comments   
Comment by Alice Sherepa [ 2023-04-24 ]

Could you please run mysqlcheck -o ... to check that there are no corruptions?

Comment by george he [ 2023-04-24 ]

-o is to optimize table
But which table should I optimize?

Comment by Alice Sherepa [ 2023-04-24 ]

I would have done mysqlcheck --all-databases

Comment by george he [ 2023-04-25 ]

I checked all databases with mysqlcheck, the result is all ok.
What can the error log suggest?

Comment by Marko Mäkelä [ 2023-04-25 ]

The crash is somehow related to the InnoDB adaptive hash index (btr0sea.cc), which has been disabled by default in MDEV-20487 in later major versions. Our internal tests do cover the adaptive hash index, but mainly for 10.6 and later. I do not remember if there currently are any open bugs with it, affecting 10.6 or later.

Comment by george he [ 2023-04-25 ]

Thanks! I'll disable adaptive hash index and see whether it helps.

Comment by george he [ 2023-04-27 ]

After I disable adaptive hash index, new crash happened.
The error log:

230426 18:07:42 [ERROR] mysqld got exception 0xc0000005 ;
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.4.28-MariaDB source revision: c8f2e9a5c0ac5905f28b050b7df5a9ffd914b7e7
key_buffer_size=134217728
read_buffer_size=131072
max_used_connections=13
max_threads=65537
thread_count=18
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 136398 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
 
Thread pointer: 0x434b8be8
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...
ntdll.dll!RtlFreeHeap()
ucrtbase.DLL!_free_base()
mysqld.exe!_ma_end_block_record()[ma_blockrec.c:561]
mysqld.exe!maria_close()[ma_close.c:93]
mysqld.exe!ha_maria::drop_table()[ha_maria.cc:2721]
mysqld.exe!free_tmp_table()[sql_select.cc:20113]
mysqld.exe!close_thread_tables()[sql_base.cc:949]
mysqld.exe!fill_schema_table_by_open()[sql_show.cc:4767]
mysqld.exe!get_all_tables()[sql_show.cc:5372]
mysqld.exe!get_schema_tables_result()[sql_show.cc:9085]
mysqld.exe!JOIN::exec_inner()[sql_select.cc:4541]
mysqld.exe!JOIN::exec()[sql_select.cc:4368]
mysqld.exe!mysql_select()[sql_select.cc:4808]
mysqld.exe!handle_select()[sql_select.cc:437]
mysqld.exe!execute_sqlcom_select()[sql_parse.cc:6454]
mysqld.exe!mysql_execute_command()[sql_parse.cc:3966]
mysqld.exe!mysql_parse()[sql_parse.cc:7990]
mysqld.exe!dispatch_command()[sql_parse.cc:1860]
mysqld.exe!do_command()[sql_parse.cc:1378]
mysqld.exe!threadpool_process_request()[threadpool_common.cc:373]
mysqld.exe!tp_callback()[threadpool_common.cc:192]
ntdll.dll!RtlDllShutdownInProgress()
ntdll.dll!DbgUiRemoteBreakin()
kernel32.dll!BaseThreadInitThunk()
ntdll.dll!RtlUserThreadStart()
 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x4379b4e0): select count(*)
 
from information_schema.tables t
 
	join information_schema.columns c on c.table_name=t.table_name
 
where t.table_name='h_product' and c.column_name='id'
Connection ID (thread ID): 67
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=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on
 
The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
information that should help you find out what is causing the crash.
Writing a core file at D:\Program Files\MariaDB 10.4\data\
Minidump written to D:\Program Files\MariaDB 10.4\data\mysqld.dmp

Comment by george he [ 2023-05-26 ]

Why is it so unstable? Errors occured very ofter, and there are different errors

error 1

230525  9:47:22 [ERROR] mysqld got exception 0xc0000005 ;
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.4.28-MariaDB source revision: c8f2e9a5c0ac5905f28b050b7df5a9ffd914b7e7
key_buffer_size=134217728
read_buffer_size=131072
max_used_connections=11
max_threads=65537
thread_count=8
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 136398 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
 
Thread pointer: 0x34160f58
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...
ntdll.dll!RtlFreeHeap()
ucrtbase.DLL!_free_base()
mysqld.exe!row_ins_clust_index_entry_low()[row0ins.cc:2858]
mysqld.exe!row_ins_clust_index_entry()[row0ins.cc:3282]
mysqld.exe!row_ins_index_entry_step()[row0ins.cc:3579]
mysqld.exe!row_ins()[row0ins.cc:3712]
mysqld.exe!row_ins_step()[row0ins.cc:3856]
mysqld.exe!row_insert_for_mysql()[row0mysql.cc:1399]
mysqld.exe!ha_innobase::write_row()[ha_innodb.cc:8171]
mysqld.exe!handler::ha_write_row()[handler.cc:6841]
mysqld.exe!write_record()[sql_insert.cc:2082]
mysqld.exe!mysql_insert()[sql_insert.cc:1083]
mysqld.exe!mysql_execute_command()[sql_parse.cc:4603]
mysqld.exe!mysql_parse()[sql_parse.cc:7990]
mysqld.exe!dispatch_command()[sql_parse.cc:1860]
mysqld.exe!do_command()[sql_parse.cc:1378]
mysqld.exe!threadpool_process_request()[threadpool_common.cc:373]
mysqld.exe!tp_callback()[threadpool_common.cc:192]
kernel32.dll!BaseFormatTimeOut()
ntdll.dll!AlpcFreeCompletionListMessage()
ntdll.dll!DbgUiRemoteBreakin()
kernel32.dll!BaseThreadInitThunk()
ntdll.dll!RtlUserThreadStart()
 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x341ceab0): insert h_wms_task (from_pb_id, site_id, staff_id, tm, is_update, data) values (458073744, 6398, 57048, from_unixtime(1684979240), 0, COLUMN_CREATE('id',37798747,'site_id',6398,'staff_id',57232,'date_created',timestamp('2023-05-25 09:34:12.000000'),'itask',-62733644,'qty',-40.0000,'stock_id',120810953,'hw_grp_id',357439))
Connection ID (thread ID): 76
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=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on
 
The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
information that should help you find out what is causing the crash.
Writing a core file at D:\Program Files\MariaDB 10.4\data\
Minidump written to D:\Program Files\MariaDB 10.4\data\mysqld.dmp

error 2

230526 11:19:32 [ERROR] mysqld got exception 0xc0000005 ;
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.4.28-MariaDB source revision: c8f2e9a5c0ac5905f28b050b7df5a9ffd914b7e7
key_buffer_size=134217728
read_buffer_size=131072
max_used_connections=8
max_threads=65537
thread_count=8
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 136398 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
 
Thread pointer: 0x34019f18
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...
ntdll.dll!RtlFreeHeap()
ucrtbase.DLL!_free_base()
mysqld.exe!Item_func_user_var::`scalar deleting destructor'()
mysqld.exe!Query_arena::free_items()[sql_class.cc:3945]
mysqld.exe!THD::cleanup_after_query()[sql_class.cc:2295]
mysqld.exe!mysql_parse()[sql_parse.cc:8011]
mysqld.exe!dispatch_command()[sql_parse.cc:1860]
mysqld.exe!do_command()[sql_parse.cc:1378]
mysqld.exe!threadpool_process_request()[threadpool_common.cc:373]
mysqld.exe!tp_callback()[threadpool_common.cc:192]
kernel32.dll!BaseFormatTimeOut()
ntdll.dll!AlpcFreeCompletionListMessage()
ntdll.dll!DbgUiRemoteBreakin()
kernel32.dll!BaseThreadInitThunk()
ntdll.dll!RtlUserThreadStart()
 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x42359140): insert h_msg (to_who_id, site_id, staff_id, tm, is_update, data) values (39534, 4362, 36103, from_unixtime(1685071171), 0, COLUMN_CREATE('id',79416736,'site_id',4362,'staff_id',39451,'date_created',timestamp('2023-05-26 10:36:56.000000'),'to_type','S','is_new',true,'type','S','body','请审核收款单SK-2305-38677','ref_id',74877474))
Connection ID (thread ID): 64
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=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on
 
The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
information that should help you find out what is causing the crash.
Writing a core file at D:\Program Files\MariaDB 10.4\data\
Minidump written to D:\Program Files\MariaDB 10.4\data\mysqld.dmp

Comment by Sergei Golubchik [ 2023-05-30 ]

where did you get MariaDB from?

could you please share table definitions for h_msg and h_wms_task?

Comment by george he [ 2023-06-02 ]

Got from MariaDB official website.
Upgraded to 10.4.29.
Seems stable now

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