Crash / segfault in drizzled::optimizer::add_key_part (keyuse_array=<value optimized out>, key_field=0x2d0dc28) at drizzled/optimizer/key_field.cc:63

Bug #600664 reported by Patrick Crews
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Drizzle
Fix Released
Medium
PrafullaT
Dexter
Fix Released
Medium
PrafullaT

Bug Description

Crashing bug / segfault:
in drizzled::optimizer::add_key_part (keyuse_array=<value optimized out>, key_field=0x2d0dc28) at drizzled/optimizer/key_field.cc:63

Test case on the way

Backtrace:
#0 0x0000000000000000 in ?? ()
#1 0x00000000005aeb7c in drizzled::optimizer::add_key_part (keyuse_array=<value optimized out>, key_field=0x2d0dc28) at drizzled/optimizer/key_field.cc:63
#2 0x0000000000617781 in drizzled::update_ref_and_keys (session=<value optimized out>, keyuse=0x2d0ae18, join_tab=0x2d48738, tables=<value optimized out>,
    cond=<value optimized out>, normal_tables=18446744073709551615, select_lex=0x2c54940, sargables=...) at drizzled/sql_select.cc:596
#3 0x0000000000594eed in make_join_statistics (join=0x2d09858, tables=0x0, conds=<value optimized out>, keyuse_array=<value optimized out>) at drizzled/join.cc:5610
#4 0x00000000005964f1 in drizzled::Join::optimize (this=0x2d09858) at drizzled/join.cc:565
#5 0x0000000000577ca2 in drizzled::subselect_single_select_engine::exec (this=0x2c55490) at drizzled/item/subselect.cc:2148
#6 0x000000000057a128 in drizzled::Item_subselect::exec (this=0x2c55350) at drizzled/item/subselect.cc:299
#7 drizzled::Item_in_subselect::exec (this=0x2c55350) at drizzled/item/subselect.cc:348
#8 0x0000000000577547 in drizzled::Item_in_subselect::val_bool (this=0x2c55350) at drizzled/item/subselect.cc:907
#9 0x000000000055550c in drizzled::Item_in_optimizer::val_int (this=0x2c87480) at drizzled/item/cmpfunc.cc:1597
#10 0x000000000054d6bc in drizzled::Item::val_bool (this=0x2c87480) at drizzled/item.cc:94
#11 0x0000000000554a79 in drizzled::Item_cond_and::val_int (this=0x2d0c7b8) at drizzled/item/cmpfunc.cc:4203
#12 0x000000000054d6bc in drizzled::Item::val_bool (this=0x2d0c7b8) at drizzled/item.cc:94
#13 0x00000000005549e9 in drizzled::Item_cond_or::val_int (this=0x2d0c6d0) at drizzled/item/cmpfunc.cc:4221
#14 0x00000000005b6df8 in drizzled::optimizer::SqlSelect::skip_record (this=<value optimized out>) at drizzled/optimizer/range.cc:423
#15 0x000000000058d349 in drizzled::flush_cached_records (join=0x2d07878, join_tab=0x2d0b220, skip_last=<value optimized out>) at drizzled/join.cc:2698
#16 0x00000000006133f7 in drizzled::sub_select_cache (join=0x2d07878, join_tab=0x2d0b220, end_of_records=<value optimized out>) at drizzled/sql_select.cc:3384
#17 0x0000000000617e70 in drizzled::do_select (join=0x2d07878, fields=0x0, table=0x2d30bb8) at drizzled/sql_select.cc:3335
#18 0x0000000000592a97 in drizzled::Join::exec (this=0x2d07878) at drizzled/join.cc:1349
#19 0x00000000006145f2 in drizzled::mysql_select (session=0x7fe4183a36c0, rref_pointer_array=<value optimized out>, tables=0x2c53e20, wild_num=0, fields=<value optimized out>,
    conds=<value optimized out>, og_num=2, order=0x2c86518, group=0x0, having=0x0, select_options=2147500033, result=0x2c870a0, unit=0x7fe4183a4130, select_lex=0x7fe4183a4330)
    at drizzled/sql_select.cc:427
#20 0x0000000000614ef0 in drizzled::handle_select (session=0x7fe4183a36c0, lex=0x7fe4183a4110, result=0x2c870a0, setup_tables_done_option=0) at drizzled/sql_select.cc:146
#21 0x000000000060ea65 in drizzled::execute_sqlcom_select (session=0x7fe4183a36c0, all_tables=0x2c53e20) at drizzled/sql_parse.cc:543
#22 0x000000000060e6ce in mysql_execute_command (session=0x7fe4183a36c0, inBuf=<value optimized out>, length=<value optimized out>) at drizzled/sql_parse.cc:478
#23 drizzled::mysql_parse (session=0x7fe4183a36c0, inBuf=<value optimized out>, length=<value optimized out>) at drizzled/sql_parse.cc:736
#24 0x00000000006108c2 in drizzled::dispatch_command (command=drizzled::COM_QUERY, session=0x7fe4183a36c0,
    packet=0x7fe41839d391 "SELECT DISTINCT AVG(DISTINCT OUTR . `col_int_not_null` ) AS X FROM BB AS OUTR2 LEFT JOIN BB AS OUTR ON ( OUTR2 . `col_text` <= OUTR . `col_text_key` ) WHERE ( OUTR . `col_text_not_null` , OUTR . `col_"..., packet_length=<value optimized out>) at drizzled/sql_parse.cc:223
#25 0x00000000005e18df in drizzled::Session::executeStatement (this=0x7fe4183a36c0) at drizzled/session.cc:646
---Type <return> to continue, or q <return> to quit---
#26 0x00000000005e3e12 in drizzled::Session::run (this=0x7fe4183a36c0) at drizzled/session.cc:505
#27 0x00007fe431586083 in MultiThreadScheduler::runSession (arg=<value optimized out>) at ./plugin/multi_thread/multi_thread.h:67
#28 session_thread (arg=<value optimized out>) at plugin/multi_thread/multi_thread.cc:43
#29 0x00007fe4353549ca in start_thread (arg=<value optimized out>) at pthread_create.c:300
#30 0x00007fe4350b26cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#31 0x0000000000000000 in ?? ()

Related branches

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

Test case:
./test-run --record <test_name> will result in the crash

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

DROP TABLE IF EXISTS `bb`;
CREATE TABLE `bb` (
  `col_text_not_null` text NOT NULL,
  `pk` int NOT NULL AUTO_INCREMENT,
  `col_int_not_null` int NOT NULL,
  `col_bigint` bigint DEFAULT NULL,
  `col_char_not_null_key` varchar(1) NOT NULL,
  `col_text` text,
  `col_text_key` text,
  PRIMARY KEY (`pk`),
  KEY `col_char_not_null_key` (`col_char_not_null_key`),
  KEY `col_text_key` (`col_text_key`(255))
) ENGINE=InnoDB;

ALTER TABLE `bb` DISABLE KEYS;
INSERT INTO `bb` VALUES ('',1,-247005184,4657847914607935488,'q',NULL,NULL),('',2,9,6580884955495137280,'d',NULL,NULL),('',3,9,6,'o',NULL,NULL),('',4,8,NULL,'j',NULL,NULL),('',5,575668224,-7027022793581527040,'c',NULL,NULL),('',6,9,8,'o',NULL,NULL),('',7,1,NULL,'a',NULL,NULL),('',8,7,616430198996336640,'o',NULL,NULL),('',9,1,NULL,'u',NULL,NULL),('',10,130416640,6244803833302614016,'y',NULL,NULL);
ALTER TABLE `bb` ENABLE KEYS;

CREATE TABLE `cc` (
  `pk` int NOT NULL AUTO_INCREMENT,
  `col_char_not_null_key` varchar(1) NOT NULL,
  `col_int_key` int DEFAULT NULL,
  `col_text_key` text,
  PRIMARY KEY (`pk`),
  KEY `col_char_not_null_key` (`col_char_not_null_key`),
  KEY `col_int_key` (`col_int_key`),
  KEY `col_text_key` (`col_text_key`(255))
) ENGINE=InnoDB;

ALTER TABLE `cc` DISABLE KEYS;
INSERT INTO `cc` VALUES (1,'k',-1711407104,NULL),(2,'k',-1837629440,NULL),(3,'g',2,NULL),(4,'f',5,NULL),(5,'t',-173408256,NULL),(6,'s',-2063663104,NULL),(7,'l',4,NULL),(8,'q',NULL,NULL),(9,'h',-858587136,NULL),(10,'r',-1040056320,NULL),(11,'l',-1812332544,NULL),(12,'o',NULL,NULL),(13,'e',NULL,NULL),(14,'k',4,NULL),(15,'p',456261632,NULL),(16,'j',NULL,NULL),(17,'b',NULL,NULL),(18,'i',4,NULL),(19,'n',NULL,NULL),(20,'n',4,NULL),(21,'m',7,NULL),(22,'i',NULL,NULL),(23,'l',4,NULL),(24,'x',4,NULL),(25,'w',NULL,NULL),(26,'s',4,NULL),(27,'s',6,NULL),(28,'i',NULL,NULL),(29,'j',NULL,NULL),(30,'z',0,NULL),(31,'d',-84738048,NULL),(32,'s',-1456209920,NULL),(33,'o',-1366818816,NULL),(34,'t',2,NULL),(35,'t',3,NULL),(36,'o',5,NULL),(37,'i',NULL,NULL),(38,'v',779943936,NULL),(39,'w',NULL,NULL),(40,'f',7,NULL),(41,'n',1658912768,NULL),(42,'u',NULL,NULL),(43,'g',NULL,NULL),(44,'a',4,NULL),(45,'o',1,NULL),(46,'h',NULL,NULL),(47,'y',892862464,NULL),(48,'m',NULL,NULL),(49,'w',NULL,NULL),(50,'a',9,NULL),(51,'c',NULL,NULL),(52,'r',1758330880,NULL),(53,'s',7,NULL),(54,'n',3,NULL),(55,'e',1,NULL),(56,'c',NULL,NULL),(57,'i',1,NULL),(58,'h',NULL,NULL),(59,'n',1441005568,NULL),(60,'b',9,NULL),(61,'a',8,NULL),(62,'o',1389690880,NULL),(63,'c',2,NULL),(64,'g',7,NULL),(65,'r',0,NULL),(66,'i',2,NULL),(67,'w',NULL,NULL),(68,'s',NULL,NULL),(69,'f',NULL,NULL),(70,'l',1,NULL),(71,'t',-1545666560,NULL),(72,'f',NULL,NULL),(73,'y',1729363968,NULL),(74,'m',-39583744,NULL),(75,'m',5,NULL),(76,'r',-33554432,NULL),(77,'a',7,NULL),(78,'q',1687748608,NULL),(79,'h',NULL,NULL),(80,'x',524877824,NULL),(81,'t',NULL,NULL),(82,'o',NULL,NULL),(83,'a',NULL,NULL),(84,'j',4,NULL),(85,'o',0,NULL),(86,'l',1818296320,NULL),(87,'l',1,NULL),(88,'q',1346699264,NULL),(89,'t',NULL,NULL),(90,'f',1,NULL),(91,'g',584253440,NULL),(92,'s',670564352...

Read more...

Changed in drizzle:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
PrafullaT (prafulla-t) wrote :

Hi Patrick,
I have pushed fix for this bug at
https://code.launchpad.net/~prafulla-tekawade/drizzle/dr-bug-600664

Can you please take a look at it?

Changed in drizzle:
assignee: nobody → Prafulla Tekawade (prafulla-tekawade)
status: Confirmed → In Progress
Revision history for this message
Patrick Crews (patrick-crews) wrote : Re: [Bug 600664] Re: Crash / segfault in drizzled::optimizer::add_key_part (keyuse_array=<value optimized out>, key_field=0x2d0dc28) at drizzled/optimizer/key_field.cc:63
Download full text (5.7 KiB)

Sure thing. I'll have the bug updated sometime this weekend.

Many thanks for your help on these bugs!

On Sat, Jul 3, 2010 at 3:59 AM, Prafulla Tekawade <
<email address hidden>> wrote:

> Hi Patrick,
> I have pushed fix for this bug at
> https://code.launchpad.net/~prafulla-tekawade/drizzle/dr-bug-600664
>
> Can you please take a look at it?
>
>
> ** Changed in: drizzle
> Assignee: (unassigned) => Prafulla Tekawade (prafulla-tekawade)
>
> ** Branch linked: lp:~prafulla-tekawade/drizzle/dr-bug-600664
>
> ** Changed in: drizzle
> Status: Confirmed => In Progress
>
> --
> Crash / segfault in drizzled::optimizer::add_key_part (keyuse_array=<value
> optimized out>, key_field=0x2d0dc28) at drizzled/optimizer/key_field.cc:63
> https://bugs.launchpad.net/bugs/600664
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in A Lightweight SQL Database for Cloud and Web: In Progress
>
> Bug description:
> Crashing bug / segfault:
> in drizzled::optimizer::add_key_part (keyuse_array=<value optimized out>,
> key_field=0x2d0dc28) at drizzled/optimizer/key_field.cc:63
>
> Test case on the way
>
> Backtrace:
> #0 0x0000000000000000 in ?? ()
> #1 0x00000000005aeb7c in drizzled::optimizer::add_key_part
> (keyuse_array=<value optimized out>, key_field=0x2d0dc28) at
> drizzled/optimizer/key_field.cc:63
> #2 0x0000000000617781 in drizzled::update_ref_and_keys (session=<value
> optimized out>, keyuse=0x2d0ae18, join_tab=0x2d48738, tables=<value
> optimized out>,
> cond=<value optimized out>, normal_tables=18446744073709551615,
> select_lex=0x2c54940, sargables=...) at drizzled/sql_select.cc:596
> #3 0x0000000000594eed in make_join_statistics (join=0x2d09858, tables=0x0,
> conds=<value optimized out>, keyuse_array=<value optimized out>) at
> drizzled/join.cc:5610
> #4 0x00000000005964f1 in drizzled::Join::optimize (this=0x2d09858) at
> drizzled/join.cc:565
> #5 0x0000000000577ca2 in drizzled::subselect_single_select_engine::exec
> (this=0x2c55490) at drizzled/item/subselect.cc:2148
> #6 0x000000000057a128 in drizzled::Item_subselect::exec (this=0x2c55350)
> at drizzled/item/subselect.cc:299
> #7 drizzled::Item_in_subselect::exec (this=0x2c55350) at
> drizzled/item/subselect.cc:348
> #8 0x0000000000577547 in drizzled::Item_in_subselect::val_bool
> (this=0x2c55350) at drizzled/item/subselect.cc:907
> #9 0x000000000055550c in drizzled::Item_in_optimizer::val_int
> (this=0x2c87480) at drizzled/item/cmpfunc.cc:1597
> #10 0x000000000054d6bc in drizzled::Item::val_bool (this=0x2c87480) at
> drizzled/item.cc:94
> #11 0x0000000000554a79 in drizzled::Item_cond_and::val_int (this=0x2d0c7b8)
> at drizzled/item/cmpfunc.cc:4203
> #12 0x000000000054d6bc in drizzled::Item::val_bool (this=0x2d0c7b8) at
> drizzled/item.cc:94
> #13 0x00000000005549e9 in drizzled::Item_cond_or::val_int (this=0x2d0c6d0)
> at drizzled/item/cmpfunc.cc:4221
> #14 0x00000000005b6df8 in drizzled::optimizer::SqlSelect::skip_record
> (this=<value optimized out>) at drizzled/optimizer/range.cc:423
> #15 0x000000000058d349 in drizzled::flush_cached_records (join=0x2d07878,
> join_tab=0x2d0b220, skip_last=<value optimized out>) at
> d...

Read more...

Revision history for this message
Patrick Crews (patrick-crews) wrote :

I have performed randgen comparison testing of patched vs. unpatched drizzle. Result sets + execution times are good. Test suite passes.

Also tested this tree merged with lp:~prafulla-tekawade/drizzle/dr-bug-592473, just to make myself feel better : ) This round of testing looked good as well.

Thanks.

PrafullaT (prafulla-t)
Changed in drizzle:
status: In Progress → Fix Committed
PrafullaT (prafulla-t)
Changed in drizzle:
status: Fix Committed → Fix Released
Changed in drizzle:
milestone: none → 2010-07-19
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.