Bug #37936 | ASSERT_COLUMN_MARKED_FOR_WRITE in Field_datetime::store , Field_varstring::store | ||
---|---|---|---|
Submitted: | 7 Jul 2008 16:07 | Modified: | 29 Jan 2009 19:57 |
Reporter: | Philip Stoev | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S1 (Critical) |
Version: | 5.1.28-bzr, 6.0, 6.0.7-bzr | OS: | Any |
Assigned to: | Georgi Kodinov | CPU Architecture: | Any |
Tags: | regression |
[7 Jul 2008 16:07]
Philip Stoev
[14 Jul 2008 17:35]
Philip Stoev
Grammar file for bug 37936
Attachment: bug37936.yy (application/octet-stream, text), 4.85 KiB.
[14 Jul 2008 17:40]
Philip Stoev
To reproduce this bug, please clone the mysql-test-extra-6.0 tree and execute: $ cd mysql-test-extra-6.0/mysql-test/gentest $ ./runall.pl --basedir=/path/to/mysql-6.0 --grammar=/location/of/bug37936.yy --threads=1 This should crash shortly with the same assertion in Field_varstring::store.
[14 Jul 2008 17:44]
Philip Stoev
Unsimplified non-concurrent test case for bug 37936
Attachment: bug37936.test (application/octet-stream, text), 19.31 KiB.
[19 Jul 2008 13:34]
Valeriy Kravchuk
I was able to repeat a crash with the test case provided on recent 6.0.7-alpha-debug. openxs@suse:/home2/openxs/dbs/6.0> bin/mysql -uroot test < /home/openxs/bug37936.test X 0 X 0000-00-00 X 0000-00-00 X 2004-10-27 X 1 16 X 1 8 12 19 ERROR 2013 (HY000) at line 158: Lost connection to MySQL server during query openxs@suse:/home2/openxs/dbs/6.0> 080703 16:57:45 mysqld_safe Number of processes running now: 0 080703 16:57:45 mysqld_safe mysqld restarted No meaningfull stack trace in the error log: thd: 0x9b13e58 Attempting backtrace. You can use the following information to find out where mysqld died. If you see no messages after this, something went terribly wrong... stack_bottom = 0x47ebf430 thread_stack 0x30000 Trying to get some variables. Some pointers may be invalid and cause the dump to abort... thd->query at 0x9b6b318 = SELECT MIN( OUTR . `pk` ) AS X FROM C AS OUTR WHERE OUTR . `pk` IN ( SELECT INNR . `int_key` AS Y FROM B AS INNR WHERE INNR . `int_key` <> INNR . `int_key` AND OUTR . `date_nokey` < '2003-12-25' ) OR NOT ( OUTR . `date_key` < '2009-10-8' OR NOT OUTR . `varchar_nokey` <= 'd' ) GROUP BY OUTR . `pk` ORDER BY OUTR . `int_nokey` , OUTR . `pk` LIMIT 2 thd->thread_id=2 thd->killed=NOT_KILLED The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains information that should help you find out what is causing the crash. 080703 16:57:45 mysqld_safe Number of processes running now: 0 080703 16:57:45 mysqld_safe mysqld restarted 080703 16:57:45 InnoDB: Started; log sequence number 0 46409 080703 16:57:46 [Note] Event Scheduler: Loaded 0 events 080703 16:57:46 [Note] /home2/openxs/dbs/6.0/libexec/mysqld: ready for connections. Version: '6.0.7-alpha-debug' socket: '/tmp/mysql.sock' port: 3306 Source distribution
[19 Jul 2008 13:39]
Valeriy Kravchuk
Recent 5.1.28 debug binaries are also affected.
[19 Jul 2008 13:41]
Valeriy Kravchuk
Recent 5.0 debug binaries are NOT affected, so this is a regression: openxs@suse:/home2/openxs/dbs/5.0> bin/mysql -uroot test < /home/openxs/bug37936.test X 0 X 0000-00-00 X 0000-00-00 X 2004-10-27 X 1 16 X 1 8 12 19 X NULL X 0 X 0000-00-00 X NULL X NULL X 5 X NULL X 0 0 4 X 0 X 1 4 8 9 12 17 19
[5 Nov 2008 14:55]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/57900 2690 Georgi Kodinov 2008-11-05 Bug #37936: ASSERT_COLUMN_MARKED_FOR_WRITE in Field_datetime::store , Field_varstring::store The code that temporary saved the bitmaps of the read set and the write set so that it can set it to all columns for debug purposes was not expecting that the table->read_set and table->write_set can be the same. And was always saving both in sequence. As a result the original value was never restored. Fixed by saving & restoring the original value only once if the two sets are the same.
[6 Nov 2008 13:57]
Ingo Strüwing
See comments by email.
[7 Nov 2008 10:11]
Georgi Kodinov
I'm not able to get the stack trace described here. All I'm getting is the stack trace from Bug #37937. Can you please try to get the same callstack with the latest 5.1 debug (I assume it's a debug version only) ?
[7 Nov 2008 10:47]
Georgi Kodinov
Bug #37937 marked as a duplicate of this bug
[7 Nov 2008 10:48]
Georgi Kodinov
Tried the original test case (using RQG) against a patched server : ======================================================= TEST RESULT TIME (ms) ------------------------------------------------------- Servers started, exiting Autoreleasing /tmp/mysql-test-ports:200 # 12:47:15 Starting # 12:47:15 gentest.pl \ # 12:47:15 --gendata= \ # 12:47:15 --threads=1 \ # 12:47:15 --queries=1000 \ # 12:47:15 --duration=3600 \ # 12:47:15 --dsn1=dbi:mysql:host=127.0.0.1:port=19306:user=root:database=test \ # 12:47:15 --grammar=bug37936.yy # 12:47:15 Starting # 12:47:15 # gendata-old.pl \ # 12:47:15 # --dsn=dbi:mysql:host=127.0.0.1:port=19306:user=root:database=test # 12:47:15 Creating table A, size 0 rows, engine . # 12:47:15 Creating table B, size 2 rows, engine . # 12:47:15 Creating table C, size 20 rows, engine . # 12:47:15 Creating table D, size 100 rows, engine . # 12:47:15 Creating table E, size 1000 rows, engine . # 12:47:16 Creating table AA, size 0 rows, engine . # 12:47:16 Creating table BB, size 2 rows, engine . # 12:47:16 Creating table CC, size 20 rows, engine . # 12:47:16 Creating table DD, size 100 rows, engine . # 12:47:16 Creating table AAA, size 0 rows, engine . # 12:47:16 Creating table BBB, size 1 rows, engine . # 12:47:16 Creating table CCC, size 20 rows, engine . # 12:47:16 Reporters: ErrorLog, Backtrace # 12:47:16 Validators: FalconErrors, ErrorMessageCorruption # 12:47:16 Starting 1 processes, 1000 queries each, duration 3600 seconds. # 12:47:18 Started periodic reporting process... # 12:47:20 Child process completed successfully. # 12:47:25 Killing periodic reporting process with pid 10690... # 12:47:30 Test completed successfully.
[7 Nov 2008 11:07]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/58165 2690 Georgi Kodinov 2008-11-07 Bug #37936: ASSERT_COLUMN_MARKED_FOR_WRITE in Field_datetime::store , Field_varstring::store The code that temporary saved the bitmaps of the read set and the write set so that it can set it to all columns for debug purposes was not expecting that the table->read_set and table->write_set can be the same. And was always saving both in sequence. As a result the original value was never restored. Fixed by saving & restoring the original value only once if the two sets are the same (in a special set of functions).
[8 Dec 2008 19:32]
Michael Widenius
Another way to define the new functions that does the same thing but may be a bit easier to understand is: static inline void dbug_tmp_use_all_columns(TABLE *table, my_bitmap_map **save, MY_BITMAP *read_set, MY_BITMAP *write_set) { #ifndef DBUG_OFF save[0]= read_set->bitmap; save[1]= write_set->bitmap; (void) tmp_use_all_columns(table, read_set); (void) tmp_use_all_columns(table, write_set); #endif } static inline void dbug_tmp_restore_column_maps(MY_BITMAP *read_set, MY_BITMAP *write_set, my_bitmap_map **old) { #ifndef DBUG_OFF tmp_restore_column_map(read_set, old[0]); tmp_restore_column_map(write_set, old[1]); #endif Feel free to use the above logic or just push the given code
[9 Dec 2008 17:46]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/61116 2690 Georgi Kodinov 2008-12-09 Bug #37936: ASSERT_COLUMN_MARKED_FOR_WRITE in Field_datetime::store , Field_varstring::store The code that temporary saved the bitmaps of the read set and the write set so that it can set it to all columns for debug purposes was not expecting that the table->read_set and table->write_set can be the same. And was always saving both in sequence. As a result the original value was never restored. Fixed by saving & restoring the original value only once if the two sets are the same (in a special set of functions).
[15 Jan 2009 6:35]
Bugs System
Pushed into 5.1.31 (revid:joro@sun.com-20090115053147-tx1oapthnzgvs1ro) (version source revid:azundris@mysql.com-20081230114838-cn52tu180wcrvh0h) (merge vers: 5.1.31) (pib:6)
[19 Jan 2009 11:25]
Bugs System
Pushed into 5.1.31-ndb-6.2.17 (revid:tomas.ulin@sun.com-20090119095303-uwwvxiibtr38djii) (version source revid:tomas.ulin@sun.com-20090115073240-1wanl85vlvw2she1) (merge vers: 5.1.31-ndb-6.2.17) (pib:6)
[19 Jan 2009 13:03]
Bugs System
Pushed into 5.1.31-ndb-6.3.21 (revid:tomas.ulin@sun.com-20090119104956-guxz190n2kh31fxl) (version source revid:tomas.ulin@sun.com-20090119104956-guxz190n2kh31fxl) (merge vers: 5.1.31-ndb-6.3.21) (pib:6)
[19 Jan 2009 16:09]
Bugs System
Pushed into 5.1.31-ndb-6.4.1 (revid:tomas.ulin@sun.com-20090119144033-4aylstx5czzz88i5) (version source revid:tomas.ulin@sun.com-20090119144033-4aylstx5czzz88i5) (merge vers: 5.1.31-ndb-6.4.1) (pib:6)
[20 Jan 2009 18:56]
Bugs System
Pushed into 6.0.10-alpha (revid:joro@sun.com-20090119171328-2hemf2ndc1dxl0et) (version source revid:azundris@mysql.com-20081230114916-c290n83z25wkt6e4) (merge vers: 6.0.9-alpha) (pib:6)
[29 Jan 2009 19:57]
Paul DuBois
Noted in 5.1.31, 6.0.10 changelogs. An error in a debugging check caused crashes in debug servers.