Crash / segfault in add_found_match_trig_cond (tab=0x0, cond=0x1c778c8, root_tab=0x1c82c80) at drizzled/sql_select.cc:1209

Bug #628397 reported by Patrick Crews
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Drizzle
Fix Released
High
Andrew Hutchings
7.0
Fix Released
High
Andrew Hutchings

Bug Description

Crashing bug / segfault. Similar to https://bugs.launchpad.net/drizzle/+bug/586578, but this is a segfault rather than a failed assertion.

Query (test case attached):
SELECT STRAIGHT_JOIN table1 . `col_int_key` AS field1
FROM o AS table1 RIGHT OUTER JOIN b AS table2 LEFT JOIN f AS table3 ON table2 . `col_varchar_1024_key` = table3 . `col_varchar_1024_key` LEFT JOIN c AS table4 ON table3 . `pk` = table4 . `pk` ON table1 . `pk` = table3 . `pk` LEFT OUTER JOIN e AS table5 LEFT JOIN b AS table6 ON table5 . `col_varchar_10_key` = table6 . `col_varchar_10` ON table2 . `col_varchar_10_key` = table5 . `col_varchar_1024_key` RIGHT OUTER JOIN g AS table7 ON table2 . `col_varchar_10_key` = table7 . `col_varchar_1024_key` WHERE ( ( ( table6 . `pk` = table3 . `col_int` OR table1 . `pk` < table2 . `pk` ) OR table3 . `col_int_key` > 7 ) OR table2 . `col_int_key` = 5 ) GROUP BY field1 ORDER BY field1 ;

Backtrace:
Program terminated with signal 11, Segmentation fault.
#0 add_found_match_trig_cond (tab=0x0, cond=0x1c778c8, root_tab=0x1c82c80) at drizzled/sql_select.cc:1209
1209 if ((tmp= add_found_match_trig_cond(tab->first_upper, cond, root_tab)))
(gdb) backtrace
#0 add_found_match_trig_cond (tab=0x0, cond=0x1c778c8, root_tab=0x1c82c80) at drizzled/sql_select.cc:1209
#1 0x00000000005a660d in make_join_select (join=0x1c78dd0, select=<value optimized out>, cond=<value optimized out>) at drizzled/join.cc:4839
#2 0x00000000005a99a8 in drizzled::Join::optimize (this=0x1c78dd0) at drizzled/join.cc:647
#3 0x000000000062a625 in drizzled::mysql_select (session=0x1c351b0, rref_pointer_array=<value optimized out>, tables=0x1c3adb8, wild_num=0, fields=..., conds=0x0,
    og_num=2, order=0x1c78ce8, group=0x1c78b50, having=0x0, select_options=2147500034, result=0x1c78db0, unit=0x1c35c28, select_lex=0x1c35e28)
    at drizzled/sql_select.cc:412
#4 0x000000000062afa0 in drizzled::handle_select (session=0x1c351b0, lex=0x1c35c08, result=0x1c78db0, setup_tables_done_option=0) at drizzled/sql_select.cc:146
#5 0x0000000000624e23 in drizzled::execute_sqlcom_select (session=0x1c351b0, all_tables=0x1c3adb8) at drizzled/sql_parse.cc:544
#6 0x0000000000624a3e in mysql_execute_command (session=0x1c351b0, inBuf=<value optimized out>, length=<value optimized out>) at drizzled/sql_parse.cc:479
#7 drizzled::mysql_parse (session=0x1c351b0, inBuf=<value optimized out>, length=<value optimized out>) at drizzled/sql_parse.cc:750
#8 0x0000000000626e12 in drizzled::dispatch_command (command=drizzled::COM_QUERY, session=0x1c351b0,
    packet=0x1c311a1 "SELECT STRAIGHT_JOIN table1 . `col_int_key` AS field1 \nFROM o AS table1 RIGHT OUTER JOIN b AS table2 LEFT JOIN f AS table3 ON table2 . `col_varchar_1024_key` = table3 . `col_varchar_1024_key` LEFT JOI"..., packet_length=<value optimized out>) at drizzled/sql_parse.cc:224
#9 0x00000000005f508a in drizzled::Session::executeStatement (this=0x1c351b0) at drizzled/session.cc:666
#10 0x00000000005f8132 in drizzled::Session::run (this=0x1c351b0) at drizzled/session.cc:522
#11 0x00007f73f7193344 in MultiThreadScheduler::runSession (arg=<value optimized out>) at ./plugin/multi_thread/multi_thread.h:67
#12 session_thread (arg=<value optimized out>) at plugin/multi_thread/multi_thread.cc:52
#13 0x00007f73fad7b9ca in start_thread (arg=<value optimized out>) at pthread_create.c:300
#14 0x00007f73faad86fd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#15 0x0000000000000000 in ?? ()

Tags: crash

Related branches

Revision history for this message
Patrick Crews (patrick-crews) wrote :
Download full text (7.8 KiB)

test-suite testcase:
try to record via ./test-run --record <test_case_name>

--disable_warnings
DROP TABLE IF EXISTS `o`;
DROP TABLE IF EXISTS `b`;
DROP TABLE IF EXISTS `f`;
DROP TABLE IF EXISTS `c`;
DROP TABLE IF EXISTS `e`;
DROP TABLE IF EXISTS `g`;
--enable_warnings

CREATE TABLE `o` (
  `pk` int NOT NULL DEFAULT '0',
  `col_int_key` int DEFAULT NULL
) ENGINE=InnoDB COLLATE = utf8_general_ci;
INSERT INTO `o` VALUES (1,4);
INSERT INTO `o` VALUES (2,-867368960);
INSERT INTO `o` VALUES (3,655032320);
INSERT INTO `o` VALUES (4,1);
INSERT INTO `o` VALUES (5,NULL);
INSERT INTO `o` VALUES (6,-118751232);
INSERT INTO `o` VALUES (7,7);
INSERT INTO `o` VALUES (8,1);
INSERT INTO `o` VALUES (9,3);
INSERT INTO `o` VALUES (10,-518324224);
INSERT INTO `o` VALUES (11,7);
INSERT INTO `o` VALUES (12,1129709568);
INSERT INTO `o` VALUES (13,-2081357824);
INSERT INTO `o` VALUES (14,6);
INSERT INTO `o` VALUES (15,NULL);
INSERT INTO `o` VALUES (16,NULL);
INSERT INTO `o` VALUES (17,NULL);
INSERT INTO `o` VALUES (18,NULL);
INSERT INTO `o` VALUES (19,4);
INSERT INTO `o` VALUES (20,1049690112);
INSERT INTO `o` VALUES (21,NULL);
INSERT INTO `o` VALUES (22,5);
INSERT INTO `o` VALUES (23,431292416);
INSERT INTO `o` VALUES (24,2);
INSERT INTO `o` VALUES (25,6);

CREATE TABLE `b` (
  `pk` int NOT NULL DEFAULT '0',
  `col_int_key` int DEFAULT NULL,
  `col_varchar_1024_key` varchar(1024) DEFAULT NULL,
  `col_varchar_10_key` varchar(10) DEFAULT NULL,
  `col_varchar_10` varchar(10) DEFAULT NULL
) ENGINE=InnoDB COLLATE = utf8_general_ci;
INSERT INTO `b` VALUES (1,NULL,'she','okay','we');

CREATE TABLE `f` (
  `pk` int NOT NULL DEFAULT '0',
  `col_int` int DEFAULT NULL,
  `col_int_key` int DEFAULT NULL,
  `col_varchar_1024_key` varchar(1024) DEFAULT NULL
) ENGINE=InnoDB COLLATE = utf8_general_ci;
INSERT INTO `f` VALUES (1,1230307328,-180486144,'can\'t');
INSERT INTO `f` VALUES (2,NULL,NULL,'gbawadfszkpoyxyczdvoleqxermmjkovqnoqhpubzfjxwqacdiwyekwemegyaluzytnccflbvqnqnmfvvlhitckzgppyilihmleccmmxqxcilxqvfikqseftdkgtlqzbwpucapktdeqxndcqytizhxaaiyashfuwbyynvenjcsmasklnxxtbzrqxmoupppjcctptgoksleizxkrbednzzwgvlnnghjvvtlpajyalhsygtjrhjxreywihgnxlevtsvfzsztftgvgzkqhwpnbztbcpoqdmhgjffokjvoaejwgqpnhemopbmrkfnkwngdjiawsiarcbkgoudqpkecymujxlwfzdeqnrumctcfmndgknecfzkndoohlpkgksukysorfgkvvkreijhlyhznczsxfdezymeqjpdeydhvhrxolrlxmxxdmajqwizwmyvustnzbrbopxmspxnazyxzmuysgonfckdeurqnroljslhdnjmdetcftzsrkjzmhimfmsbhnsgriqkaejakxzbldvftdcaugaahtcwtnujxmwqvkfepcswvrvqhibmuutnuhmvcnctfzmswcmtsrpmyedqxpoluufzbhwbrmcdiwytofotjit');
INSERT INTO `f` VALUES (3,NULL,NULL,'think');
INSERT INTO `f` VALUES (4,0,NULL,'jqgbawadfszkpoyxyczdvoleqxermmjkovqnoqhpubzfjxwqacdiwyekwemegyaluzytnccflbvqnqnmfvvlhitckzgppyilihmleccmmxqxcilxqvfikqseftdkgtlqzbwpucapktdeqxndcqytizhxaaiyashfuwbyynvenjcsmasklnxxtbzrqxmoupppjcctptgoksleizxkrbednzzwgvlnnghjvvtlpajyalhsygtjrhjxreywihgnxlevtsvfzsztftgvgzkqhwpnbztbcpoqdmhgjffokjvoaejwgqpnhemopbmrkfnkwngdjiawsiarcbkgoudqpkecymujxlwfzdeqnrumctcfmndgknecfzkndoohlpkgksukysorfgkvvkreijhlyhznczsxfdezymeqjpdeydhvhrxolrlxmxxdm');
INSERT INTO `f` VALUES (5,2,0,'u');
INSERT INTO `f` VALUES (6,1,NULL,'your');
INSERT INTO `f` VALUES (7,NULL,9,'at');

CREATE TABLE `c` (
  `pk` int NOT NULL DEF...

Read more...

Revision history for this message
Travis Davies (travisdaveez) wrote :

Attempting to confirm this bug.
After running the test-case, I am seeing the failure, but I want to see the backtrace, like the
one posted. How do I get this backtrace?

Cheers!
Travis

Revision history for this message
Travis Davies (travisdaveez) wrote :
Download full text (18.8 KiB)

Bug Confirmation
revision 1746 of branch

// TEST CASE
./test-run --suite=broken test_case.test
Logging: ./test-run --suite=broken test_case.test
Drizzle Version 2010.09.1746
Using MTR_BUILD_THREAD = -69.4
Using MASTER_MYPORT = 9306
Using MASTER_MYPORT1 = 9307
Using SLAVE_MYPORT = 9308
Using SLAVE_MYPORT1 = 9309
Using SLAVE_MYPORT2 = 9310
Using MC_PORT = 9316
Killing Possible Leftover Processes
Removing Stale Files
Creating Directories
================================================================================
DEFAULT STORAGE ENGINE: innodb
TEST RESULT TIME (ms)
--------------------------------------------------------------------------------

broken.test_case [ fail ]
drizzletest: At line 95: query 'SELECT STRAIGHT_JOIN table1 . `col_int_key` AS field1
FROM o AS table1 RIGHT OUTER JOIN b AS table2 LEFT JOIN f AS table3 ON table2 . `col_varchar_1024_key` = table3 . `col_varchar_1024_key` LEFT JOIN c AS table4 ON table3 . `pk` = table4 . `pk` ON table1 . `pk` = table3 . `pk` LEFT OUTER JOIN e AS table5 LEFT JOIN b AS table6 ON table5 . `col_varchar_10_key` = table6 . `col_varchar_10` ON table2 . `col_varchar_10_key` = table5 . `col_varchar_1024_key` RIGHT OUTER JOIN g AS table7 ON table2 . `col_varchar_10_key` = table7 . `col_varchar_1024_key` WHERE ( ( ( table6 . `pk` = table3 . `col_int` OR table1 . `pk` < table2 . `pk` ) OR table3 . `col_int_key` > 7 ) OR table2 . `col_int_key` = 5 ) GROUP BY field1 ORDER BY field1 ' failed: 20: drizzle_state_read:lost connection to server (EOF)

The result from queries just before the failure was:
< snip >
INSERT INTO `e` VALUES (1,'were','poyxyczdvoleqxermmjkovqnoqhpubzfjxwqacdiwyekwemegyaluzytnccflbvqnqnmfvvlhitckzgppyilihmleccmmxqxcilxqvfikqseftdkgtlqzbwpucapktdeqxndcqytizhxaaiyashfuwbyynvenjcsmasklnxxtbzrqxmoupppjcctptgoksleizxkrbednzzwgvlnnghjvvtlpajyalhsygtjrhjxreywihgnxlevtsvfzsztftgvgzkqhwpnbztbcpoqdmhgjffokjvoaejwgqpnhemopbmrkfnkwngdjiawsiarcbkgoudqpkecymujxlwfzdeqnrumctcfmndgknecfzkndoohlpkgksukysorfgkvvkreijhlyhznczsxfdezymeqjpdeydhvhrxolrlxmxxdmajqwizwmyvustnzbrbopxmspxnazyxzmuysgonfckdeurqnroljslhdnjmdetcftzsrkjzmhimfmsbhnsgriqkaejakxzbldvftdcaugaahtcwtnujxmwqvkfep');
INSERT INTO `e` VALUES (2,'ok','kpoyxyczdvoleqxermmjkovqnoqhpubzfjxwqacdiwyekwemegyaluzytnccflbvqnqnmfvvlhitckzgppyilihmleccmmxqxcilxqvfikqseftdkgtlqzbwpucapktdeqxndcqytizhxaaiyashfuwbyynvenjcsmasklnxxtbzrqxmoupppjcctptgoksleizxkrbednzzwgvlnnghjvvtlpajyalhsygtjrhjxreywihgnxlevtsvfzsztftgvgzkqhwpnbztbcpoqdmhgjffokjvoaejwgqpnhemopbmrkfnkwngdjiawsiarcbkgoudqpkecymujxlwfzdeqnrumctcfmndgknecfzkndoohlpkgksukysorfgkvvkreijhlyhznczsxfdezymeqjpdeydhvhrxolrlxmxxdmajqwizwmyvustnzbrbopxmspxnazyxzmuysgonfckdeurqnroljslhdnjmdetcftzsrkjzmhimfmsbhnsgriqkaejakxzbldvftdcaugaahtcwtnujxmwqvkfepcswvrvqhibmuutnuhmvcnctfzmswcmtsrpmyedqxpoluufzbhwbrmcdiwytofotjitmaijfpfbpdwickgvibccphunilmnxvdsykirhgxvyehxyhixejfktoptnpveambxrovrpulkkjqccekfbfamsuiwhofodwrlsvwmxtvaoazfufeehwftkaugjsnebabzsscqhnafqodwrvohesokjrzhnkjhqowroirjsmo');
INSERT INTO `e` VALUES (3,'yes','w');
INSERT INTO `e` VALUES...

Changed in drizzle:
status: New → Confirmed
tags: added: crash
Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

Duplicate of MySQL bug #52005

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.