Bug #35991 Falcon assertion on TRUNCATE in Section::getSectionPage Section.cpp line 198
Submitted: 11 Apr 2008 11:29 Modified: 5 Oct 2008 14:59
Reporter: Philip Stoev Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Falcon storage engine Severity:S3 (Non-critical)
Version:6.0-falcon-team OS:Any
Assigned to: Vladislav Vaintroub CPU Architecture:Any

[11 Apr 2008 11:29] Philip Stoev
When running a DML workload, Falcon asserted as follows:

#0  0x00110402 in __kernel_vsyscall ()
#1  0x00bdc617 in pthread_kill () from /lib/libpthread.so.0
#2  0x08449ed3 in write_core (sig=4) at stacktrace.c:305
#3  0x082a392b in handle_segfault (sig=4) at mysqld.cc:2621
#4  <signal handler called>
#5  0x00110402 in __kernel_vsyscall ()
#6  0x00bdf891 in raise () from /lib/libpthread.so.0
#7  0x0851836c in Error::debugBreak () at Error.cpp:92
#8  0x085183c8 in Error::error (string=0x889cca4 "assertion failed at line %d in file %s\n") at Error.cpp:69
#9  0x08518466 in Error::assertionFailed (fileName=0x88a32bb "Section.cpp", line=198) at Error.cpp:76
#10 0x085627aa in Section::getSectionPage (dbb=0xb711b7f0, root=11, sequence=0, requestedLockType=Exclusive, transId=1902) at Section.cpp:198
#11 0x08563758 in Section::getSectionPage (this=0xb71247f0, sequence=0, lockType=Exclusive, transId=1902) at Section.cpp:1416
#12 0x08564457 in Section::insertStub (this=0xb71247f0, transId=1902) at Section.cpp:348
#13 0x0850df9a in Dbb::insertStub (this=0xb711b7f0, section=0xb71247f0, transaction=0xb725faf0) at Dbb.cpp:304
#14 0x084d23a8 in Table::insert (this=0xb744b3e0, transaction=0xb725faf0, stream=0xb74571e8) at Table.cpp:2987
#15 0x084bb245 in StorageDatabase::insert (this=0xb70e5128, connection=0xb71285e0, table=0xb744b3e0, stream=0xb74571e8) at StorageDatabase.cpp:226
#16 0x084c1036 in StorageTable::insert (this=0xb7451cc8) at StorageTable.cpp:122
#17 0x084b4de3 in StorageInterface::write_row (this=0x9880518, buff=0x98806d8 "Щ\001") at ha_falcon.cpp:1057
#18 0x083cf8e6 in handler::ha_write_row (this=0x9880518, buf=0x98806d8 "Щ\001") at handler.cc:5308
#19 0x08345adc in write_record (thd=0x9889b28, table=0x988fb80, info=0xa9d3e3c0) at sql_insert.cc:1566
#20 0x0834a9e4 in mysql_insert (thd=0x9889b28, table_list=0x989d0d0, fields=@0x988b160, values_list=@0x988b184, update_fields=@0x988b178,
    update_values=@0x988b16c, duplic=DUP_ERROR, ignore=true) at sql_insert.cc:819
#21 0x082b6e73 in mysql_execute_command (thd=0x9889b28) at sql_parse.cc:2864
#22 0x082bd358 in mysql_parse (thd=0x9889b28, inBuf=0x989d010 "INSERT IGNORE INTO t1 (f1) VALUES (1)", length=37, found_semicolon=0xa9d3f270)
    at sql_parse.cc:5623
#23 0x082bdd71 in dispatch_command (command=COM_QUERY, thd=0x9889b28, packet=0x9894fb1 "INSERT IGNORE INTO t1 (f1) VALUES (1);", packet_length=38)
    at sql_parse.cc:1031
#24 0x082befd0 in do_command (thd=0x9889b28) at sql_parse.cc:723
#25 0x082ac6e9 in handle_one_connection (arg=0x9889b28) at sql_connect.cc:1134
#26 0x00bd750b in start_thread () from /lib/libpthread.so.0
#27 0x00b18b2e in clone () from /lib/libc.so.6

How to repeat:
Simplified test case will hopefully follow shortly.
[11 Apr 2008 11:32] Philip Stoev
test case for bug 35991

Attachment: bug35991.pl (text/plain), 923 bytes.

[11 Apr 2008 11:33] Philip Stoev
Please find attached the test case. Crash will happen within 30 seconds. The test case is derived from bug #35322, with the addition of a TRUNCATE TABLE.
[11 Apr 2008 12:24] Vladislav Vaintroub
The assertion is 

ASSERT(page->pageType == PAGE_sections || page->pageType == 0);

the page type is 11 (==PAGE_free)
[22 Aug 2008 18:03] Kevin Lewis
Fix is in version 6.0.7
[28 Aug 2008 20:15] Bugs System
Pushed into 6.0.7-alpha  (revid:cbell@mysql.com-20080822132131-uveo6wiuecy6m2b8) (version source revid:cbell@mysql.com-20080822132131-uveo6wiuecy6m2b8) (pib:3)
[28 Aug 2008 23:47] Kevin Lewis
See Bug#22165 for other changes that helped to fix this including the addition of TransactionManager::waitForWriteComplete.  http://lists.mysql.com/commits/51311
This bug is different than Bug#22165 in that this is about the truncate operation and 22165 is related to ALTER TABLE.
[14 Sep 2008 2:42] Bugs System
Pushed into 6.0.7-alpha  (revid:vvaintroub@mysql.com-20080804155352-071nj3gc85f1sbhc) (version source revid:sven@mysql.com-20080818175803-c1nutd5773r6b4gd) (pib:3)
[5 Oct 2008 14:59] Jon Stephens
Documented in the 6.0.7 changelog as follows:

        Executing TRUNCATE statements with interleaving transactions
        could cause mysqld to crash.