CREATE TABLE t1 (a INT) ENGINE=MyISAM;
|
INSERT INTO t1 VALUES (3),(8);
|
|
CREATE TABLE t2 (b INT) ENGINE=MyISAM;
|
INSERT INTO t2 VALUES (2),(1);
|
|
SELECT a FROM t1
|
WHERE 9 IN ( SELECT MIN( a ) FROM t1 )
|
HAVING a <> ( SELECT COUNT(*) FROM t2 )
|
ORDER BY a;
|
==30848== Invalid read of size 1
|
==30848== at 0x90E68F: subselect_engine::calc_const_tables(List<TABLE_LIST>&) (item_subselect.cc:4166)
|
==30848== by 0x90E708: subselect_single_select_engine::upper_select_const_tables() (item_subselect.cc:4175)
|
==30848== by 0x904F8B: Item_subselect::update_used_tables() (item_subselect.cc:888)
|
==30848== by 0x8C917E: Item_func::update_used_tables() (item_func.cc:445)
|
==30848== by 0x6B6F0A: JOIN::exec_inner() (sql_select.cc:2927)
|
==30848== by 0x6B4CDB: JOIN::exec() (sql_select.cc:2369)
|
==30848== by 0x6B8046: mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:3307)
|
==30848== by 0x6AE640: handle_select(THD*, LEX*, select_result*, unsigned long) (sql_select.cc:372)
|
==30848== by 0x683345: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:5269)
|
==30848== by 0x67B646: mysql_execute_command(THD*) (sql_parse.cc:2552)
|
==30848== by 0x685AD0: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:6415)
|
==30848== by 0x6788E7: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1307)
|
==30848== by 0x677C8C: do_command(THD*) (sql_parse.cc:1004)
|
==30848== by 0x7941C9: do_handle_one_connection(THD*) (sql_connect.cc:1379)
|
==30848== by 0x793F1C: handle_one_connection (sql_connect.cc:1293)
|
==30848== by 0xCC9D29: pfs_spawn_thread (pfs.cc:1860)
|
==30848== Address 0xdbe21dd is 2,269 bytes inside a block of size 4,772 free'd
|
==30848== at 0x4C27BF4: free (vg_replace_malloc.c:469)
|
==30848== by 0xE52CEE: free_memory (safemalloc.c:276)
|
==30848== by 0xE529B2: sf_free (safemalloc.c:194)
|
==30848== by 0xE41D2D: my_free (my_malloc.c:216)
|
==30848== by 0xE362D9: free_root (my_alloc.c:385)
|
==30848== by 0x6D96E1: free_tmp_table(THD*, TABLE*) (sql_select.cc:17081)
|
==30848== by 0x91013E: subselect_hash_sj_engine::cleanup() (item_subselect.cc:5002)
|
==30848== by 0x9034AB: Item_subselect::cleanup() (item_subselect.cc:152)
|
==30848== by 0x90364A: Item_in_subselect::cleanup() (item_subselect.cc:189)
|
==30848== by 0x6CB94E: st_join_table::cleanup() (sql_select.cc:11224)
|
==30848== by 0x6CC748: JOIN::cleanup(bool) (sql_select.cc:11620)
|
==30848== by 0x6CC35B: JOIN::join_free() (sql_select.cc:11507)
|
==30848== by 0x6B68B7: JOIN::exec_inner() (sql_select.cc:2844)
|
==30848== by 0x6B4CDB: JOIN::exec() (sql_select.cc:2369)
|
==30848== by 0x6B8046: mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:3307)
|
==30848== by 0x6AE640: handle_select(THD*, LEX*, select_result*, unsigned long) (sql_select.cc:372)
|
==30848== Invalid read of size 8
|
==30848== at 0x90E69E: subselect_engine::calc_const_tables(List<TABLE_LIST>&) (item_subselect.cc:4167)
|
==30848== by 0x90E708: subselect_single_select_engine::upper_select_const_tables() (item_subselect.cc:4175)
|
==30848== by 0x904F8B: Item_subselect::update_used_tables() (item_subselect.cc:888)
|
==30848== by 0x8C917E: Item_func::update_used_tables() (item_func.cc:445)
|
==30848== by 0x6B6F0A: JOIN::exec_inner() (sql_select.cc:2927)
|
==30848== by 0x6B4CDB: JOIN::exec() (sql_select.cc:2369)
|
==30848== by 0x6B8046: mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:3307)
|
==30848== by 0x6AE640: handle_select(THD*, LEX*, select_result*, unsigned long) (sql_select.cc:372)
|
==30848== by 0x683345: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:5269)
|
==30848== by 0x67B646: mysql_execute_command(THD*) (sql_parse.cc:2552)
|
==30848== by 0x685AD0: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:6415)
|
==30848== by 0x6788E7: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1307)
|
==30848== by 0x677C8C: do_command(THD*) (sql_parse.cc:1004)
|
==30848== by 0x7941C9: do_handle_one_connection(THD*) (sql_connect.cc:1379)
|
==30848== by 0x793F1C: handle_one_connection (sql_connect.cc:1293)
|
==30848== by 0xCC9D29: pfs_spawn_thread (pfs.cc:1860)
|
==30848== Address 0xdbe21a0 is 2,208 bytes inside a block of size 4,772 free'd
|
==30848== at 0x4C27BF4: free (vg_replace_malloc.c:469)
|
==30848== by 0xE52CEE: free_memory (safemalloc.c:276)
|
==30848== by 0xE529B2: sf_free (safemalloc.c:194)
|
==30848== by 0xE41D2D: my_free (my_malloc.c:216)
|
==30848== by 0xE362D9: free_root (my_alloc.c:385)
|
==30848== by 0x6D96E1: free_tmp_table(THD*, TABLE*) (sql_select.cc:17081)
|
==30848== by 0x91013E: subselect_hash_sj_engine::cleanup() (item_subselect.cc:5002)
|
==30848== by 0x9034AB: Item_subselect::cleanup() (item_subselect.cc:152)
|
==30848== by 0x90364A: Item_in_subselect::cleanup() (item_subselect.cc:189)
|
==30848== by 0x6CB94E: st_join_table::cleanup() (sql_select.cc:11224)
|
==30848== by 0x6CC748: JOIN::cleanup(bool) (sql_select.cc:11620)
|
==30848== by 0x6CC35B: JOIN::join_free() (sql_select.cc:11507)
|
==30848== by 0x6B68B7: JOIN::exec_inner() (sql_select.cc:2844)
|
==30848== by 0x6B4CDB: JOIN::exec() (sql_select.cc:2369)
|
==30848== by 0x6B8046: mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:3307)
|
==30848== by 0x6AE640: handle_select(THD*, LEX*, select_result*, unsigned long) (sql_select.cc:372)
|
Stack trace from:
revision-id: elenst@montyprogram.com-20140911232154-8kfkykep1qtsn8fi
|
revno: 4393
|
branch-nick: 10.0
|
EXPLAIN:
id select_type table type possible_keys key key_len ref rows filtered Extra
|
1 PRIMARY <subquery2> const distinct_key distinct_key 4 const 1 100.00 Using temporary; Using filesort
|
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join)
|
3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00
|
Warnings:
|
Note 1003 select `test`.`t1`.`a` AS `a` from <materialize> (select min(`test`.`t1`.`a`) from `test`.`t1`) join `test`.`t1` where (`<subquery2>`.`MIN( a )` = 9) having (`test`.`t1`.`a` <> (select count(0) from `test`.`t2`)) order by `test`.`t1`.`a`
|
Minimal optimizer_switch: materialization=on,semijoin=on
- relates to
-
MDEV-17616
ASAN heap-use-after-free in subselect_engine::calc_const_tables on 2nd execution of PS
-
-
Closed
{"report":{"fcp":643.3000001907349,"ttfb":154.30000019073486,"pageVisibility":"visible","entityId":44432,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"3f3719b8-9ab0-40f2-90e4-5a5b18280901","navigationType":0,"readyForUser":782,"redirectCount":0,"resourceLoadedEnd":829.1000003814697,"resourceLoadedStart":159.80000019073486,"resourceTiming":[{"duration":7.300000190734863,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":159.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":159.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":167.10000038146973,"responseStart":0,"secureConnectionStart":0},{"duration":7.09999942779541,"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":160.10000038146973,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":160.10000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":167.19999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":71.90000057220459,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":160.19999980926514,"connectEnd":160.19999980926514,"connectStart":160.19999980926514,"domainLookupEnd":160.19999980926514,"domainLookupStart":160.19999980926514,"fetchStart":160.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":160.19999980926514,"responseEnd":232.10000038146973,"responseStart":232,"secureConnectionStart":160.19999980926514},{"duration":149.5999994277954,"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":160.30000019073486,"connectEnd":160.30000019073486,"connectStart":160.30000019073486,"domainLookupEnd":160.30000019073486,"domainLookupStart":160.30000019073486,"fetchStart":160.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":160.30000019073486,"responseEnd":309.8999996185303,"responseStart":309.8999996185303,"secureConnectionStart":160.30000019073486},{"duration":153.19999980926514,"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":160.5,"connectEnd":160.5,"connectStart":160.5,"domainLookupEnd":160.5,"domainLookupStart":160.5,"fetchStart":160.5,"redirectEnd":0,"redirectStart":0,"requestStart":160.5,"responseEnd":313.69999980926514,"responseStart":313.69999980926514,"secureConnectionStart":160.5},{"duration":153.5999994277954,"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":160.60000038146973,"connectEnd":160.60000038146973,"connectStart":160.60000038146973,"domainLookupEnd":160.60000038146973,"domainLookupStart":160.60000038146973,"fetchStart":160.60000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":160.60000038146973,"responseEnd":314.19999980926514,"responseStart":314.19999980926514,"secureConnectionStart":160.60000038146973},{"duration":154.19999980926514,"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":160.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":160.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":314.8999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":153.80000019073486,"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":160.69999980926514,"connectEnd":160.69999980926514,"connectStart":160.69999980926514,"domainLookupEnd":160.69999980926514,"domainLookupStart":160.69999980926514,"fetchStart":160.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":160.69999980926514,"responseEnd":314.5,"responseStart":314.5,"secureConnectionStart":160.69999980926514},{"duration":154.0999994277954,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":160.80000019073486,"connectEnd":160.80000019073486,"connectStart":160.80000019073486,"domainLookupEnd":160.80000019073486,"domainLookupStart":160.80000019073486,"fetchStart":160.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":160.80000019073486,"responseEnd":314.8999996185303,"responseStart":314.8999996185303,"secureConnectionStart":160.80000019073486},{"duration":154.39999961853027,"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":161,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":161,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":315.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":154.5,"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":161.10000038146973,"connectEnd":161.10000038146973,"connectStart":161.10000038146973,"domainLookupEnd":161.10000038146973,"domainLookupStart":161.10000038146973,"fetchStart":161.10000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":161.10000038146973,"responseEnd":315.6000003814697,"responseStart":315.6000003814697,"secureConnectionStart":161.10000038146973},{"duration":440,"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":166.80000019073486,"connectEnd":166.80000019073486,"connectStart":166.80000019073486,"domainLookupEnd":166.80000019073486,"domainLookupStart":166.80000019073486,"fetchStart":166.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":166.80000019073486,"responseEnd":606.8000001907349,"responseStart":606.8000001907349,"secureConnectionStart":166.80000019073486},{"duration":437.19999980926514,"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.69999980926514,"connectEnd":181.69999980926514,"connectStart":181.69999980926514,"domainLookupEnd":181.69999980926514,"domainLookupStart":181.69999980926514,"fetchStart":181.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":181.69999980926514,"responseEnd":618.8999996185303,"responseStart":618.8999996185303,"secureConnectionStart":181.69999980926514},{"duration":168.20000076293945,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":447.8999996185303,"connectEnd":447.8999996185303,"connectStart":447.8999996185303,"domainLookupEnd":447.8999996185303,"domainLookupStart":447.8999996185303,"fetchStart":447.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":447.8999996185303,"responseEnd":616.1000003814697,"responseStart":616.1000003814697,"secureConnectionStart":447.8999996185303},{"duration":3.6999998092651367,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":621.8000001907349,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":621.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":625.5,"responseStart":0,"secureConnectionStart":0},{"duration":127.30000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bu7/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":824.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":127,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":697.8000001907349,"connectEnd":697.8000001907349,"connectStart":697.8000001907349,"domainLookupEnd":697.8000001907349,"domainLookupStart":697.8000001907349,"fetchStart":697.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":697.8000001907349,"responseEnd":824.8000001907349,"responseStart":824.8000001907349,"secureConnectionStart":697.8000001907349},{"duration":131,"initiatorType":"script","name":"https://jira.mariadb.org/s/f51ef5507eea4c158f257c66c93b2a3f-CDN/lu2bu7/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":698.1000003814697,"connectEnd":698.1000003814697,"connectStart":698.1000003814697,"domainLookupEnd":698.1000003814697,"domainLookupStart":698.1000003814697,"fetchStart":698.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":698.1000003814697,"responseEnd":829.1000003814697,"responseStart":829.1000003814697,"secureConnectionStart":698.1000003814697}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":6,"responseStart":155,"responseEnd":182,"domLoading":158,"domInteractive":887,"domContentLoadedEventStart":887,"domContentLoadedEventEnd":931,"domComplete":1148,"loadEventStart":1148,"loadEventEnd":1148,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":830.6999998092651},{"name":"bigPipe.sidebar-id.end","time":831.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":831.6000003814697},{"name":"bigPipe.activity-panel-pipe-id.end","time":835.8999996185303},{"name":"activityTabFullyLoaded","time":952.1999998092651}],"measures":[],"correlationId":"a83823fd3c5915","effectiveType":"4g","downlink":9.7,"rtt":0,"serverDuration":84,"dbReadsTimeInMs":14,"dbConnsTimeInMs":20,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Still reproducible on 10.0, but not on 10.1/10.2.
10.0 4b8cd4536a2c ASAN
==25219==ERROR: AddressSanitizer: heap-use-after-free on address 0x6210000671dd at pc 0xd3eb47 bp 0x7f2d15797c60 sp 0x7f2d15797c58
READ of size 1 at 0x6210000671dd thread T5
#0 0xd3eb46 in subselect_engine::calc_const_tables(List<TABLE_LIST>&) /data/src/10.0/sql/item_subselect.cc:4242
#1 0xd3ec22 in subselect_single_select_engine::upper_select_const_tables() /data/src/10.0/sql/item_subselect.cc:4251
#2 0xd2009a in Item_subselect::update_used_tables() /data/src/10.0/sql/item_subselect.cc:902
#3 0xc71a4d in Item_func::update_used_tables() /data/src/10.0/sql/item_func.cc:446
#4 0x7dad09 in JOIN::exec_inner() /data/src/10.0/sql/sql_select.cc:2937
#5 0x7dd343 in JOIN::exec() /data/src/10.0/sql/sql_select.cc:2379
#6 0x7d24a6 in mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /data/src/10.0/sql/sql_select.cc:3318
#7 0x7d2ad6 in handle_select(THD*, LEX*, select_result*, unsigned long) /data/src/10.0/sql/sql_select.cc:373
#8 0x6b566c in execute_sqlcom_select /data/src/10.0/sql/sql_parse.cc:5293
#9 0x6ccea8 in mysql_execute_command(THD*) /data/src/10.0/sql/sql_parse.cc:2553
#10 0x6e19f7 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /data/src/10.0/sql/sql_parse.cc:6569
#11 0x6e5616 in dispatch_command(enum_server_command, THD*, char*, unsigned int) /data/src/10.0/sql/sql_parse.cc:1296
#12 0x6e9f0f in do_command(THD*) /data/src/10.0/sql/sql_parse.cc:999
#13 0x975c3b in do_handle_one_connection(THD*) /data/src/10.0/sql/sql_connect.cc:1377
#14 0x975ea2 in handle_one_connection /data/src/10.0/sql/sql_connect.cc:1292
#15 0x11a95d4 in pfs_spawn_thread /data/src/10.0/storage/perfschema/pfs.cc:1861
#16 0x7f2d1fdb2493 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x7493)
#17 0x7f2d1e16b93e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0xe893e)
0x6210000671dd is located 2269 bytes inside of 4772-byte region [0x621000066900,0x621000067ba4)
freed by thread T5 here:
#0 0x7f2d2001c527 in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x54527)
#1 0x18e68b3 in free_memory /data/src/10.0/mysys/safemalloc.c:276
previously allocated by thread T5 here:
#0 0x7f2d2001c73f in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x5473f)
#1 0x18e6986 in sf_malloc /data/src/10.0/mysys/safemalloc.c:115
#2 0x19c964a (/data/bld/10.0-asan/bin/mysqld+0x19c964a)
Thread T5 created by T0 here:
#0 0x7f2d1ffebbba in pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x23bba)
#1 0x11b4e2b in spawn_thread_v1 /data/src/10.0/storage/perfschema/pfs.cc:1911
SUMMARY: AddressSanitizer: heap-use-after-free /data/src/10.0/sql/item_subselect.cc:4242 subselect_engine::calc_const_tables(List<TABLE_LIST>&)
Shadow bytes around the buggy address:
0x0c4280004de0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c4280004df0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c4280004e00: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c4280004e10: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c4280004e20: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
=>0x0c4280004e30: fd fd fd fd fd fd fd fd fd fd fd[fd]fd fd fd fd
0x0c4280004e40: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c4280004e50: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c4280004e60: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c4280004e70: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c4280004e80: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Contiguous container OOB:fc
ASan internal: fe
==25219==ABORTING