Type:
Bug
Priority:
Major
Resolution:
Duplicate
Affects Version/s:
10.5 , 10.6 , 10.11 , 11.1(EOL) , 11.2(EOL) , 11.4 , 11.5(EOL) , 11.6(EOL)
INSTALL PLUGIN Spider SONAME 'ha_spider.so' ;
CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET '../socket.sock' , DATABASE '' , USER '' , PASSWORD '' );
CREATE TABLE t1 (c INT , KEY (c)) ENGINE=Spider PARTITION BY KEY (c) PARTITIONS 1;
CREATE TABLE t2 (c INT ,d INT ) ENGINE=Spider COMMENT= 'WRAPPER "mysql",SRV "srv",TABLE "t1"' ;
LOCK TABLES t2 READ ,t1 WRITE;
Leads to:
11.2.5 a21e49cbcc5f4adb1a1b4970ceead6a85e968063 (Debug)
mariadbd: /test/11.2_dbg/sql/sql_class.cc:455: void* thd_get_ha_data(const THD*, const handlerton*): Assertion `thd == _current_thd() || ((&(&thd->LOCK_thd_data)->m_mutex)->count > 0 && pthread_equal(pthread_self(), (&(&thd->LOCK_thd_data)->m_mutex)->thread))' failed.
11.2.5 a21e49cbcc5f4adb1a1b4970ceead6a85e968063 (Debug)
Core was generated by `/test/MD190624-mariadb-11.2.5-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
Program terminated with signal SIGABRT, Aborted.
#0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
Download failed: Invalid argument. Continuing without source file ./nptl/./nptl/pthread_kill.c.
[Current thread is 1 (LWP 3996738)]
(gdb) bt
#0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
#1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
#2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
#3 0x000015229da42866 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
#4 0x000015229da268b7 in __GI_abort () at ./stdlib/abort.c:79
#5 0x000015229da267db in __assert_fail_base (fmt=0x15229dbc5168 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5643e79cddb0 "thd == _current_thd() || ((&(&thd->LOCK_thd_data)->m_mutex)->count > 0 && pthread_equal(pthread_self(), (&(&thd->LOCK_thd_data)->m_mutex)->thread))", file=file@entry=0x5643e79cdc88 "/test/11.2_dbg/sql/sql_class.cc", line=line@entry=455, function=function@entry=0x5643e79cdd78 "void* thd_get_ha_data(const THD*, const handlerton*)") at ./assert/assert.c:92
#6 0x000015229da39186 in __assert_fail (assertion=0x5643e79cddb0 "thd == _current_thd() || ((&(&thd->LOCK_thd_data)->m_mutex)->count > 0 && pthread_equal(pthread_self(), (&(&thd->LOCK_thd_data)->m_mutex)->thread))", file=0x5643e79cdc88 "/test/11.2_dbg/sql/sql_class.cc", line=455, function=0x5643e79cdd78 "void* thd_get_ha_data(const THD*, const handlerton*)") at ./assert/assert.c:101
#7 0x00005643e6c4251e in thd_get_ha_data (thd=0x152248000d58, hton=0x15224c03d318) at /test/11.2_dbg/sql/sql_class.cc:455
#8 0x00001522880d640b in spider_get_trx (thd=thd@entry=0x152248000d58, regist_allocated_thds=regist_allocated_thds@entry=true, error_num=error_num@entry=0x15229c06ba14)at /test/11.2_dbg/storage/spider/spd_trx.cc:1141
#9 0x00001522880d77d5 in spider_check_trx_and_get_conn (thd=0x152248000d58, spider=spider@entry=0x15224803ace0)at /test/11.2_dbg/storage/spider/spd_trx.cc:3396
#10 0x0000152288141fe9 in ha_spider::append_lock_tables_list (this=0x15224803ace0) at /test/11.2_dbg/storage/spider/ha_spider.cc:11824
#11 0x0000152288142643 in ha_spider::store_lock (this=0x15224803ace0, thd=<optimized out>, to=0x15224c2918e0, lock_type=TL_WRITE)at /test/11.2_dbg/storage/spider/ha_spider.cc:760
#12 0x00005643e725b7bb in ha_partition::store_lock (this=0x15224803a400, thd=0x15224c000d58, to=0x15224c2918e0, lock_type=TL_WRITE)at /test/11.2_dbg/sql/ha_partition.cc:4412
#13 0x00005643e712eb4f in get_lock_data (thd=thd@entry=0x15224c000d58, table_ptr=table_ptr@entry=0x15224c014728, count=count@entry=2, flags=flags@entry=1) at /test/11.2_dbg/sql/lock.cc:825
#14 0x00005643e712ef7a in mysql_lock_tables (thd=thd@entry=0x15224c000d58, tables=tables@entry=0x15224c014728, count=count@entry=2, flags=flags@entry=0) at /test/11.2_dbg/sql/lock.cc:301
#15 0x00005643e6c3023f in lock_tables (thd=thd@entry=0x15224c000d58, tables=0x15224c013708, count=<optimized out>, flags=flags@entry=0)at /test/11.2_dbg/sql/sql_base.cc:5916
#16 0x00005643e6ca77f5 in lock_tables_open_and_lock_tables (thd=thd@entry=0x15224c000d58, tables=<optimized out>)at /test/11.2_dbg/sql/sql_parse.cc:2999
#17 0x00005643e6cb2f01 in mysql_execute_command (thd=thd@entry=0x15224c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/11.2_dbg/sql/sql_parse.cc:4959
#18 0x00005643e6cb7010 in mysql_parse (thd=thd@entry=0x15224c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x15229c06c2e0)at /test/11.2_dbg/sql/sql_parse.cc:7920
#19 0x00005643e6cb93d3 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x15224c000d58, packet=packet@entry=0x15224c00b2f9 "LOCK TABLES t2 READ,t1 WRITE", packet_length=packet_length@entry=28, blocking=blocking@entry=true)at /test/11.2_dbg/sql/sql_class.h:247
#20 0x00005643e6cbb76c in do_command (thd=0x15224c000d58, blocking=blocking@entry=true) at /test/11.2_dbg/sql/sql_parse.cc:1407
#21 0x00005643e6e22c49 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5643ea69d398, put_in_cache=put_in_cache@entry=true)at /test/11.2_dbg/sql/sql_connect.cc:1439
#22 0x00005643e6e22f3e in handle_one_connection (arg=arg@entry=0x5643ea69d398)at /test/11.2_dbg/sql/sql_connect.cc:1341
#23 0x00005643e727552c in pfs_spawn_thread (arg=0x5643ea5fc5e8)at /test/11.2_dbg/storage/perfschema/pfs.cc:2201
#24 0x000015229da97ada in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
#25 0x000015229db2847c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
In optimized builds, the testcase hangs the client thread.
In 10.5 debug, the testcase also hangs. In 10.6+ debug the testcase asserts with the stack above.
Here is another testcase which hangs on all versions in all build types:
INSTALL PLUGIN Spider SONAME 'ha_spider.so' ;
CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET '../socket.sock' , DATABASE '' , USER '' , PASSWORD '' );
CREATE TABLE t1 (c INT , KEY (c)) ENGINE=Spider;
CREATE TABLE t2 (c INT ,d INT ) ENGINE=Spider COMMENT= 'WRAPPER "mysql",SRV "srv",TABLE "t1"' ;
LOCK TABLES t2 READ ,t1 WRITE;
{"report":{"fcp":855,"ttfb":172.39999985694885,"pageVisibility":"visible","entityId":130070,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"87075fd1-3a75-4cad-b2a6-ca9ff6737bf5","navigationType":0,"readyForUser":925.2999999523163,"redirectCount":0,"resourceLoadedEnd":972.5999999046326,"resourceLoadedStart":179,"resourceTiming":[{"duration":201.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":179,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":179,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":380.5,"responseStart":0,"secureConnectionStart":0},{"duration":201.20000004768372,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":179.29999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":179.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":380.5,"responseStart":0,"secureConnectionStart":0},{"duration":219.60000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":179.39999985694885,"connectEnd":179.39999985694885,"connectStart":179.39999985694885,"domainLookupEnd":179.39999985694885,"domainLookupStart":179.39999985694885,"fetchStart":179.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":179.39999985694885,"responseEnd":399,"responseStart":399,"secureConnectionStart":179.39999985694885},{"duration":277.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":179.59999990463257,"connectEnd":179.59999990463257,"connectStart":179.59999990463257,"domainLookupEnd":179.59999990463257,"domainLookupStart":179.59999990463257,"fetchStart":179.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":179.59999990463257,"responseEnd":457.39999985694885,"responseStart":457.39999985694885,"secureConnectionStart":179.59999990463257},{"duration":281,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":179.70000004768372,"connectEnd":179.70000004768372,"connectStart":179.70000004768372,"domainLookupEnd":179.70000004768372,"domainLookupStart":179.70000004768372,"fetchStart":179.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":179.70000004768372,"responseEnd":460.7000000476837,"responseStart":460.59999990463257,"secureConnectionStart":179.70000004768372},{"duration":281.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":179.70000004768372,"connectEnd":179.70000004768372,"connectStart":179.70000004768372,"domainLookupEnd":179.70000004768372,"domainLookupStart":179.70000004768372,"fetchStart":179.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":179.70000004768372,"responseEnd":461.2000000476837,"responseStart":461.2000000476837,"secureConnectionStart":179.70000004768372},{"duration":282,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":179.89999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":179.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":461.89999985694885,"responseStart":0,"secureConnectionStart":0},{"duration":281.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":179.89999985694885,"connectEnd":179.89999985694885,"connectStart":179.89999985694885,"domainLookupEnd":179.89999985694885,"domainLookupStart":179.89999985694885,"fetchStart":179.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":179.89999985694885,"responseEnd":461.39999985694885,"responseStart":461.39999985694885,"secureConnectionStart":179.89999985694885},{"duration":281.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":180.09999990463257,"connectEnd":180.09999990463257,"connectStart":180.09999990463257,"domainLookupEnd":180.09999990463257,"domainLookupStart":180.09999990463257,"fetchStart":180.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":180.09999990463257,"responseEnd":461.89999985694885,"responseStart":461.89999985694885,"secureConnectionStart":180.09999990463257},{"duration":282.19999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/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":180.20000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":180.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":462.39999985694885,"responseStart":0,"secureConnectionStart":0},{"duration":282.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/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":180.29999995231628,"connectEnd":180.29999995231628,"connectStart":180.29999995231628,"domainLookupEnd":180.29999995231628,"domainLookupStart":180.29999995231628,"fetchStart":180.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":180.29999995231628,"responseEnd":462.39999985694885,"responseStart":462.39999985694885,"secureConnectionStart":180.29999995231628},{"duration":564.1000001430511,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":181.09999990463257,"connectEnd":181.09999990463257,"connectStart":181.09999990463257,"domainLookupEnd":181.09999990463257,"domainLookupStart":181.09999990463257,"fetchStart":181.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":181.09999990463257,"responseEnd":745.2000000476837,"responseStart":745.2000000476837,"secureConnectionStart":181.09999990463257},{"duration":791.3999998569489,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":181.20000004768372,"connectEnd":181.20000004768372,"connectStart":181.20000004768372,"domainLookupEnd":181.20000004768372,"domainLookupStart":181.20000004768372,"fetchStart":181.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":181.20000004768372,"responseEnd":972.5999999046326,"responseStart":972.5999999046326,"secureConnectionStart":181.20000004768372},{"duration":359.2000000476837,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":612.0999999046326,"connectEnd":612.0999999046326,"connectStart":612.0999999046326,"domainLookupEnd":612.0999999046326,"domainLookupStart":612.0999999046326,"fetchStart":612.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":612.0999999046326,"responseEnd":971.2999999523163,"responseStart":971.2999999523163,"secureConnectionStart":612.0999999046326}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":22,"responseStart":172,"responseEnd":176,"domLoading":176,"domInteractive":997,"domContentLoadedEventStart":997,"domContentLoadedEventEnd":1037,"domComplete":1991,"loadEventStart":1991,"loadEventEnd":1993,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":978.2999999523163},{"name":"bigPipe.sidebar-id.end","time":979.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":979.2000000476837},{"name":"bigPipe.activity-panel-pipe-id.end","time":981.5999999046326},{"name":"activityTabFullyLoaded","time":1047.0999999046326}],"measures":[],"correlationId":"602bf6fbc56696","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":87,"dbReadsTimeInMs":17,"dbConnsTimeInMs":25,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}