Crash/segfault - in drizzled::DTCollation::set (this=0x60, dt=...) at drizzled/dtcollation.cc:51 51 collation= dt.collation

Bug #615419 reported by Patrick Crews
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Drizzle
Fix Released
Medium
PrafullaT
Dexter
Fix Released
Medium
PrafullaT

Bug Description

Crashing bug - segfault:
in drizzled::DTCollation::set (this=0x60, dt=...) at drizzled/dtcollation.cc:51
51 collation= dt.collation

Triggered by this query:
SELECT table2 . `col_enum_not_null_key` AS field1 FROM ( BB AS table1 STRAIGHT_JOIN ( ( BB AS table2 INNER JOIN CC AS table3 ON (table3 . `col_int_not_null` = table2 . `col_bigint_key` AND ( 6, 6 ) IN ( SELECT SUBQUERY1_t1 . `col_bigint_key` AS SUBQUERY1_field1 , SUM( SUBQUERY1_t1 . `col_int_key` ) AS SUBQUERY1_field2 FROM ( AA AS SUBQUERY1_t1 RIGHT OUTER JOIN AA AS SUBQUERY1_t2 ON (SUBQUERY1_t2 . `col_int_not_null_key` = SUBQUERY1_t1 . `col_int_not_null_key` ) ) WHERE SUBQUERY1_t2 . `col_char_1024_not_null_key` != SUBQUERY1_t1 . `col_char_10_key` ) ) ) ) ON (table3 . `col_int_not_null_key` = table2 . `pk` ) ) WHERE ( ( 'a', 't' ) IN ( SELECT SUBQUERY2_t1 . `col_char_1024_not_null_key` AS SUBQUERY2_field1 , SUBQUERY2_t1 . `col_text_not_null_key` AS SUBQUERY2_field2 FROM BB AS SUBQUERY2_t1 WHERE SUBQUERY2_t1 . `col_char_1024_not_null_key` >= 'y' ) ) AND ( table1 . `col_int_key` > 20 AND table1 . `col_int_key` < ( 20 + 229 ) OR table1 . `pk` > 20 AND table1 . `pk` < ( 20 + 158 ) ) OR ( table2 . `col_char_1024_not_null_key` < table2 . `col_char_1024_not_null_key` AND table1 . `col_int_not_null` IS NULL ) HAVING field1 <> 56 ORDER BY table1 . `col_char_10_not_null_key` , table3 .`pk` DESC

Working on a test case for the test suite.

Tags: crash

Related branches

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

Backtrace.
Produced via ./configure --with-debug

Program terminated with signal 11, Segmentation fault.
#0 0x0000000000511cd3 in drizzled::DTCollation::set (this=0x60, dt=...) at drizzled/dtcollation.cc:51
51 collation= dt.collation;
(gdb) backtrace
#0 0x0000000000511cd3 in drizzled::DTCollation::set (this=0x60, dt=...) at drizzled/dtcollation.cc:51
#1 0x000000000062c7ac in change_cond_ref_to_const (session=<value optimized out>, save_list=..., and_father=<value optimized out>, cond=0x224bfd0, field=<value optimized out>, value=0x239fb20)
    at drizzled/sql_select.cc:2658
#2 0x000000000062c6bf in change_cond_ref_to_const (session=0x22761f0, save_list=..., and_father=<value optimized out>, cond=0x23a02b0, field=0x239fbf8, value=0x239fb20)
    at drizzled/sql_select.cc:2616
#3 0x000000000062ca86 in propagate_cond_constants (session=0x22761f0, save_list=..., and_father=0x23a02b0, cond=0x239fcd0) at drizzled/sql_select.cc:2764
#4 0x000000000062cb16 in propagate_cond_constants (session=0x22761f0, save_list=<value optimized out>, and_father=<value optimized out>, cond=0x23a02b0) at drizzled/sql_select.cc:2723
#5 0x000000000062cc4e in drizzled::optimize_cond (join=<value optimized out>, conds=<value optimized out>, join_list=<value optimized out>, cond_value=0x239a4b8) at drizzled/sql_select.cc:2926
#6 0x00000000005a464e in drizzled::Join::optimize (this=0x2398ed8) at drizzled/join.cc:476
#7 0x0000000000585cc2 in drizzled::subselect_single_select_engine::exec (this=0x224c290) at drizzled/item/subselect.cc:2148
#8 0x0000000000587c18 in drizzled::Item_subselect::exec (this=0x224c150) at drizzled/item/subselect.cc:299
#9 drizzled::Item_in_subselect::exec (this=0x224c150) at drizzled/item/subselect.cc:348
#10 0x0000000000585567 in drizzled::Item_in_subselect::val_bool (this=0x224c150) at drizzled/item/subselect.cc:907
#11 0x0000000000562f6c in drizzled::Item_in_optimizer::val_int (this=0x22b9490) at drizzled/item/cmpfunc.cc:1597
#12 0x000000000055e950 in drizzled::Item_cache_int::store (this=0x23a0a98, item=0x224bf38) at drizzled/item/cache_int.cc:29
#13 0x0000000000559582 in drizzled::Item::cache_const_expr_transformer (this=0x23a0a98, arg=<value optimized out>) at drizzled/item.cc:1319
#14 0x000000000052b5fa in drizzled::Item_func::compile (this=<value optimized out>, analyzer=&virtual table offset 560, arg_p=0x7fb2b51d7418, transformer=&virtual table offset 568,
    arg_t=0x7fb2b51d756f "") at drizzled/function/func.cc:335
#15 0x00000000005625f8 in drizzled::Item_cond::compile (this=<value optimized out>, analyzer=&virtual table offset 560, arg_p=0x7fb2b51d74a8, transformer=&virtual table offset 568,
    arg_t=0x7fb2b51d756f "") at drizzled/item/cmpfunc.cc:4058
#16 0x00000000005625f8 in drizzled::Item_cond::compile (this=<value optimized out>, analyzer=&virtual table offset 560, arg_p=0x7fb2b51d7560, transformer=&virtual table offset 568,
    arg_t=0x7fb2b51d756f "") at drizzled/item/cmpfunc.cc:4058
#17 0x000000000059aa46 in drizzled::Join::cache_const_exprs (this=0x2396ef8) at drizzled/join.cc:2440
#18 0x00000000005a5796 in drizzled::Join::optimize (this=0x2396ef8) at drizzled/join.cc:851
#19 0x0000000000625035 in drizzled::mysql_s...

Read more...

Changed in drizzle:
status: New → Confirmed
Monty Taylor (mordred)
tags: added: crash
Revision history for this message
Patrick Crews (patrick-crews) wrote :
Download full text (5.7 KiB)

test case.
Try to record it with:
./test-run --record <test_name>

--disable_warnings
DROP TABLE IF EXISTS `aa`;
DROP TABLE IF EXISTS `bb`;
DROP TABLE IF EXISTS `cc`;
--enable_warnings

CREATE TABLE `aa` (
  `pk` int NOT NULL AUTO_INCREMENT,
  `col_char_10_key` varchar(10) DEFAULT NULL,
  `col_char_1024_not_null_key` varchar(1024) NOT NULL,
  `col_int_not_null_key` int NOT NULL,
  `col_int_key` int DEFAULT NULL,
  `col_bigint_key` bigint DEFAULT NULL,
  PRIMARY KEY (`pk`),
  KEY `col_char_10_key` (`col_char_10_key`),
  KEY `col_char_1024_not_null_key` (`col_char_1024_not_null_key`(255)),
  KEY `col_int_not_null_key` (`col_int_not_null_key`),
  KEY `col_int_key` (`col_int_key`),
  KEY `col_bigint_key` (`col_bigint_key`)
) ENGINE=InnoDB;

INSERT INTO `aa` VALUES (1,'ZDPHP','well',-523436032,2071265280,NULL),(2,'AIJUR','on',1,1,NULL),(3,'NEMIU','ASUNK',621543424,NULL,-2842897264777625600),(4,'HMHFF','d',880148480,1734213632,NULL),(5,'XIXMV','m',1963982848,1505558528,3557843705622691840),(6,'k','to',8,8,-4628011567076605952),(7,'GJZBY','t',1445462016,NULL,-5755881798756204544),(8,'UGMMS','m',0,-1685520384,NULL),(9,'p','USQVA',-747241472,NULL,NULL),(10,'RMZLQ','FUBQO',6,-1431502848,-5719290051783819264);

CREATE TABLE `bb` (
  `col_enum_not_null_key` enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') NOT NULL,
  `col_text_not_null_key` text NOT NULL,
  `col_char_10_not_null_key` varchar(10) NOT NULL,
  `col_char_1024_not_null_key` varchar(1024) NOT NULL,
  `col_bigint_key` bigint DEFAULT NULL,
  `pk` int NOT NULL AUTO_INCREMENT,
  `col_int_key` int DEFAULT NULL,
  `col_int_not_null` int NOT NULL,
  PRIMARY KEY (`pk`),
  KEY `col_enum_not_null_key` (`col_enum_not_null_key`),
  KEY `col_text_not_null_key` (`col_text_not_null_key`(255)),
  KEY `col_char_10_not_null_key` (`col_char_10_not_null_key`),
  KEY `col_char_1024_not_null_key` (`col_char_1024_not_null_key`(255)),
  KEY `col_bigint_key` (`col_bigint_key`),
  KEY `col_int_key` (`col_int_key`)
) ENGINE=InnoDB;

INSERT INTO `bb` VALUES ('r','','DCJRX','IHTVZ',NULL,1,NULL,763953152),('a','','x','a',NULL,2,4,-132513792),('s','','ZMHDL','s',-647673921411219456,3,-628359168,3),('i','','SJGHS','d',-5702401553181179904,4,-2114322432,-1349844992),('w','','his','TTNNK',NULL,5,105971712,-2019688448),('v','','m','GKTRR',4,6,2,-38207488),('d','','i','ZZDWO',NULL,7,NULL,3),('f','','d','up',8,8,NULL,8),('y','','from','would',NULL,9,-607322112,-1129054208),('o','','h','JNAFV',NULL,10,0,-415629312);

CREATE TABLE `cc` (
  `pk` int NOT NULL AUTO_INCREMENT,
  `col_int_not_null` int NOT NULL,
  `col_int_not_null_key` int NOT NULL,
  PRIMARY KEY (`pk`),
  KEY `col_int_not_null_key` (`col_int_not_null_key`)
) ENGINE=InnoDB;

INSERT INTO `cc` VALUES (1,9,-1665335296),(2,2,0),(3,0,1736638464),(4,-1205207040,-2136604672),(5,-330170368,3),(6,7,309592064),(7,-858259456,4),(8,-1265565696,1614217216),(9,532217856,1822883840),(10,-1106640896,1),(11,7,0),(12,-2060517376,8),(13,9,248709120),(14,3,8),(15,1633353728,-1300496384),(16,621150208,1776549888),(17,6,2053242880),(18,8,-2143551488),(19,7,1),(20,1232142336,7),(21,1089404928,1946615808),(22,2,-141492224),(23,-19...

Read more...

Revision history for this message
PrafullaT (prafulla-t) wrote :

HI Patrick
I have pushed fix for this patch in following branch
https://code.launchpad.net/~prafulla-tekawade/drizzle/drz-bugfix-615419

Could you please take a look ?
This branch has changes from other bugs as well.

Thanks
Prafulla

Changed in drizzle:
assignee: nobody → Prafulla Tekawade (prafulla-tekawade)
status: Confirmed → Fix Committed
Revision history for this message
Patrick Crews (patrick-crews) wrote :

Hi Prafulla,

Sorry for the delay. I'll have a look tomorrow and update things from there.

Thanks as always for the great patches : )

Changed in drizzle:
status: Fix Committed → Confirmed
importance: Undecided → Medium
Changed in drizzle:
status: Confirmed → Fix Released
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.