#10 0x0000559ef47ef0f2 in thd_get_ha_data (thd=0x62b00008c218, hton=0x615000001998) at /data/bld/10.6-asan/sql/sql_class.cc:454
#11 0x0000559ef54d8fa9 in MYSQL_BIN_LOG::set_status_variables (this=0x559ef8ca59c0 <mysql_bin_log>, thd=0x62b00008c218) at /data/bld/10.6-asan/sql/log.cc:11784
#12 0x0000559ef54d8d54 in show_binlog_vars (thd=0x62b00008c218, var=0x7f87dfc737c0, status_var=0x62b00008cf50) at /data/bld/10.6-asan/sql/log.cc:11717
#13 0x0000559ef5a6e4dd in PFS_status_variable_cache::manifest (this=0x61d0002396a8, thd=0x62b00008c218, show_var_array=0x623000031118, status_vars=0x62b00008cf50, prefix=0x559ef7143ce0 "", nested_array=false, strict=true) at /data/bld/10.6-asan/storage/perfschema/pfs_variable.cc:1167
#14 0x0000559ef5a6dccf in PFS_status_variable_cache::do_materialize_session (this=0x61d0002396a8, pfs_thread=0x7f87e57e5a00) at /data/bld/10.6-asan/storage/perfschema/pfs_variable.cc:1078
#15 0x0000559ef5ae2960 in PFS_variable_cache<Status_variable>::materialize_session (this=0x61d0002396a8, pfs_thread=0x7f87e57e5a00, use_mem_root=false) at /data/bld/10.6-asan/storage/perfschema/pfs_variable.h:574
#16 0x0000559ef5ae1643 in table_status_by_thread::rnd_next (this=0x61d000239680) at /data/bld/10.6-asan/storage/perfschema/table_status_by_thread.cc:140
#17 0x0000559ef59f2933 in ha_perfschema::rnd_next (this=0x61b0000405b8, buf=0x62300002f538 "\377") at /data/bld/10.6-asan/storage/perfschema/ha_perfschema.cc:358
#18 0x0000559ef51bbd3d in handler::ha_rnd_next (this=0x61b0000405b8, buf=0x62300002f538 "\377") at /data/bld/10.6-asan/sql/handler.cc:3459
#19 0x0000559ef5613a57 in rr_sequential (info=0x62b0000d6798) at /data/bld/10.6-asan/sql/records.cc:519
#20 0x0000559ef476f854 in READ_RECORD::read_record (this=0x62b0000d6798) at /data/bld/10.6-asan/sql/records.h:81
#21 0x0000559ef4a8d75b in join_init_read_record (tab=0x62b0000d66c0) at /data/bld/10.6-asan/sql/sql_select.cc:22862
#22 0x0000559ef4a865e4 in sub_select (join=0x62b0000d5370, join_tab=0x62b0000d66c0, end_of_records=false) at /data/bld/10.6-asan/sql/sql_select.cc:21826
#23 0x0000559ef4a84550 in do_select (join=0x62b0000d5370, procedure=0x0) at /data/bld/10.6-asan/sql/sql_select.cc:21352
#24 0x0000559ef4a0e3da in JOIN::exec_inner (this=0x62b0000d5370) at /data/bld/10.6-asan/sql/sql_select.cc:4882
#25 0x0000559ef4a0b8b2 in JOIN::exec (this=0x62b0000d5370) at /data/bld/10.6-asan/sql/sql_select.cc:4660
#26 0x0000559ef4a0fd11 in mysql_select (thd=0x62b0000cb218, tables=0x62b0000d29d8, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x62b0000d5340, unit=0x62b0000cf5e0, select_lex=0x62b0000d2320) at /data/bld/10.6-asan/sql/sql_select.cc:5139
#27 0x0000559ef49df0f2 in handle_select (thd=0x62b0000cb218, lex=0x62b0000cf518, result=0x62b0000d5340, setup_tables_done_option=0) at /data/bld/10.6-asan/sql/sql_select.cc:561
#28 0x0000559ef49436f7 in execute_sqlcom_select (thd=0x62b0000cb218, all_tables=0x62b0000d29d8) at /data/bld/10.6-asan/sql/sql_parse.cc:6285
#29 0x0000559ef4931e2c in mysql_execute_command (thd=0x62b0000cb218, is_called_from_prepared_stmt=false) at /data/bld/10.6-asan/sql/sql_parse.cc:3961
#30 0x0000559ef494e74d in mysql_parse (thd=0x62b0000cb218, rawbuf=0x62b0000d2238 "SELECT VARIABLE_VALUE FROM performance_schema.status_by_thread", length=62, parser_state=0x7f87dfc769f0) at /data/bld/10.6-asan/sql/sql_parse.cc:8051
#31 0x0000559ef4924372 in dispatch_command (command=COM_QUERY, thd=0x62b0000cb218, packet=0x62900026c219 "", packet_length=62, blocking=true) at /data/bld/10.6-asan/sql/sql_parse.cc:1896
#32 0x0000559ef49210a6 in do_command (thd=0x62b0000cb218, blocking=true) at /data/bld/10.6-asan/sql/sql_parse.cc:1409
#33 0x0000559ef4d9456a in do_handle_one_connection (connect=0x608000002fb8, put_in_cache=true) at /data/bld/10.6-asan/sql/sql_connect.cc:1416
#34 0x0000559ef4d93f2b in handle_one_connection (arg=0x608000002fb8) at /data/bld/10.6-asan/sql/sql_connect.cc:1318
#35 0x0000559ef59f8f16 in pfs_spawn_thread (arg=0x617000006618) at /data/bld/10.6-asan/storage/perfschema/pfs.cc:2201
#36 0x00007f87e78a8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#37 0x00007f87e792861c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
The failure started happening after this commit in 10.6:
commit 736a54f49c72d89fb82ef4165e96cddb506cf555
Author: Sergei Golubchik
Date: Wed Dec 13 00:37:57 2023 +0100
perfschema: use LOCK_thd_kill to "keep THD during materialization"
Attachments
Issue Links
blocks
MDEV-33150double-locking of LOCK_thd_kill in performance_schema.session_status
Closed
relates to
MDEV-34588Assertion `thd == _current_thd() || ((&(&thd->LOCK_thd_data)->m_mutex)->count > 0 && pthread_equal(pthread_self(), (&(&thd->LOCK_thd_data)->m_mutex)->thread))' failed in thd_get_ha_data and thread hangs
Looks like this just needs to add lock/unlock of the mutex LOCK_thd_data across the call to thd_get_ha_data() in TC_LOG_BINLOG::set_status_variables().
This was not necessary before Serg's patch, but now it's LOCK_thd_kill that's being held by the caller instead, so LOCK_thd_data must be taken explicitly.
(Though - how did this get through buildbot ? Are we missing coverage in the test suite for this, perhaps?)
Kristian Nielsen
added a comment - Looks like this just needs to add lock/unlock of the mutex LOCK_thd_data across the call to thd_get_ha_data() in TC_LOG_BINLOG::set_status_variables().
This was not necessary before Serg's patch, but now it's LOCK_thd_kill that's being held by the caller instead, so LOCK_thd_data must be taken explicitly.
(Though - how did this get through buildbot ? Are we missing coverage in the test suite for this, perhaps?)
Yuchen Pei
added a comment - Thanks for the patches - reviewed on the mailing list:
https://lists.mariadb.org/hyperkitty/list/developers@lists.mariadb.org/thread/OHCITR7R76N7XOCYMKVFFG6W4D6CWKOU/
https://lists.mariadb.org/hyperkitty/list/developers@lists.mariadb.org/thread/ZMWRAPCP2D5JHMZN34MRHH46P3ZTNCG7/
People
Sergei Golubchik
Elena Stepanova
Votes:
0Vote for this issue
Watchers:
6Start watching this issue
Dates
Created:
Updated:
Resolved:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":6254.800000011921,"ttfb":5561.600000023842,"pageVisibility":"visible","entityId":126939,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0,"journeyId":"ddd76496-2b07-4958-b491-3bfbd118839c","navigationType":0,"readyForUser":6322.9000000059605,"redirectCount":0,"resourceLoadedEnd":6561.5,"resourceLoadedStart":5569.9000000059605,"resourceTiming":[{"duration":215.40000000596046,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":5569.9000000059605,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":5569.9000000059605,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":5785.300000011921,"responseStart":0,"secureConnectionStart":0},{"duration":216.09999999403954,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":5570.200000017881,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":5570.200000017881,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":5786.300000011921,"responseStart":0,"secureConnectionStart":0},{"duration":263.30000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":5570.4000000059605,"connectEnd":5570.4000000059605,"connectStart":5570.4000000059605,"domainLookupEnd":5570.4000000059605,"domainLookupStart":5570.4000000059605,"fetchStart":5570.4000000059605,"redirectEnd":0,"redirectStart":0,"requestStart":5570.4000000059605,"responseEnd":5833.700000017881,"responseStart":5833.700000017881,"secureConnectionStart":5570.4000000059605},{"duration":269.80000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":5570.5,"connectEnd":5570.5,"connectStart":5570.5,"domainLookupEnd":5570.5,"domainLookupStart":5570.5,"fetchStart":5570.5,"redirectEnd":0,"redirectStart":0,"requestStart":5789.600000023842,"responseEnd":5840.300000011921,"responseStart":5804.9000000059605,"secureConnectionStart":5570.5},{"duration":219.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":5570.800000011921,"connectEnd":5570.800000011921,"connectStart":5570.800000011921,"domainLookupEnd":5570.800000011921,"domainLookupStart":5570.800000011921,"fetchStart":5570.800000011921,"redirectEnd":0,"redirectStart":0,"requestStart":5570.800000011921,"responseEnd":5790.300000011921,"responseStart":5790.300000011921,"secureConnectionStart":5570.800000011921},{"duration":220.7000000178814,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":5571,"connectEnd":5571,"connectStart":5571,"domainLookupEnd":5571,"domainLookupStart":5571,"fetchStart":5571,"redirectEnd":0,"redirectStart":0,"requestStart":5571,"responseEnd":5791.700000017881,"responseStart":5791.700000017881,"secureConnectionStart":5571},{"duration":221.69999998807907,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":5571.200000017881,"connectEnd":5571.200000017881,"connectStart":5571.200000017881,"domainLookupEnd":5571.200000017881,"domainLookupStart":5571.200000017881,"fetchStart":5571.200000017881,"redirectEnd":0,"redirectStart":0,"requestStart":5571.200000017881,"responseEnd":5792.9000000059605,"responseStart":5792.9000000059605,"secureConnectionStart":5571.200000017881},{"duration":221.7000000178814,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":5571.4000000059605,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":5571.4000000059605,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":5793.100000023842,"responseStart":0,"secureConnectionStart":0},{"duration":264.19999998807907,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":5571.600000023842,"connectEnd":5571.600000023842,"connectStart":5571.600000023842,"domainLookupEnd":5571.600000023842,"domainLookupStart":5571.600000023842,"fetchStart":5571.600000023842,"redirectEnd":0,"redirectStart":0,"requestStart":5571.600000023842,"responseEnd":5835.800000011921,"responseStart":5835.800000011921,"secureConnectionStart":5571.600000023842},{"duration":233,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":5571.800000011921,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":5571.800000011921,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":5804.800000011921,"responseStart":0,"secureConnectionStart":0},{"duration":265.09999999403954,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":5571.9000000059605,"connectEnd":5571.9000000059605,"connectStart":5571.9000000059605,"domainLookupEnd":5571.9000000059605,"domainLookupStart":5571.9000000059605,"fetchStart":5571.9000000059605,"redirectEnd":0,"redirectStart":0,"requestStart":5571.9000000059605,"responseEnd":5837,"responseStart":5837,"secureConnectionStart":5571.9000000059605},{"duration":487.09999999403954,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":5582.600000023842,"connectEnd":5582.600000023842,"connectStart":5582.600000023842,"domainLookupEnd":5582.600000023842,"domainLookupStart":5582.600000023842,"fetchStart":5582.600000023842,"redirectEnd":0,"redirectStart":0,"requestStart":5582.600000023842,"responseEnd":6069.700000017881,"responseStart":6069.700000017881,"secureConnectionStart":5582.600000023842},{"duration":978.6999999880791,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":5582.800000011921,"connectEnd":5582.800000011921,"connectStart":5582.800000011921,"domainLookupEnd":5582.800000011921,"domainLookupStart":5582.800000011921,"fetchStart":5582.800000011921,"redirectEnd":0,"redirectStart":0,"requestStart":5582.800000011921,"responseEnd":6561.5,"responseStart":6561.5,"secureConnectionStart":5582.800000011921},{"duration":455.30000001192093,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":6049.800000011921,"connectEnd":6049.800000011921,"connectStart":6049.800000011921,"domainLookupEnd":6049.800000011921,"domainLookupStart":6049.800000011921,"fetchStart":6049.800000011921,"redirectEnd":0,"redirectStart":0,"requestStart":6049.800000011921,"responseEnd":6505.100000023842,"responseStart":6505.100000023842,"secureConnectionStart":6049.800000011921}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":5400,"responseStart":5562,"responseEnd":5583,"domLoading":5566,"domInteractive":6582,"domContentLoadedEventStart":6582,"domContentLoadedEventEnd":6621,"domComplete":7084,"loadEventStart":7084,"loadEventEnd":7085,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":6564.200000017881},{"name":"bigPipe.sidebar-id.end","time":6565},{"name":"bigPipe.activity-panel-pipe-id.start","time":6565.200000017881},{"name":"bigPipe.activity-panel-pipe-id.end","time":6566.4000000059605},{"name":"activityTabFullyLoaded","time":6635.4000000059605}],"measures":[],"correlationId":"5ab18923faf9a8","effectiveType":"4g","downlink":9.5,"rtt":0,"serverDuration":96,"dbReadsTimeInMs":11,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Looks like this just needs to add lock/unlock of the mutex LOCK_thd_data across the call to thd_get_ha_data() in TC_LOG_BINLOG::set_status_variables().
This was not necessary before Serg's patch, but now it's LOCK_thd_kill that's being held by the caller instead, so LOCK_thd_data must be taken explicitly.
(Though - how did this get through buildbot ? Are we missing coverage in the test suite for this, perhaps?)