Bug #31739 Falcon: crash if create index
Submitted: 22 Oct 2007 0:45 Modified: 22 Oct 2007 18:38
Reporter: Peter Gulutzan Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S3 (Non-critical)
Version:6.0.4-alpha-debug OS:Linux (SUSE 10 64-bit)
Assigned to: CPU Architecture:Any

[22 Oct 2007 0:45] Peter Gulutzan
Description:
I create an indexed Falcon table.
I insert 1,000,000 random rows.
I create an index.
Crash.

How to repeat:
The 'create procedure' will create a million rows.
It uses rand() for creating values in the second column.
But the crash isn't random, I've repeated 3 times.
With a smaller row count (100,000) I saw no crash.

delimiter //
drop table t//
drop procedure p//
CREATE TABLE t (int_column INT, char_column CHAR(5)) ENGINE=FALCON//
CREATE PROCEDURE p ()
BEGIN
  DECLARE v_rownum INT DEFAULT 0;
  DECLARE v_random_character CHAR(1);
  DECLARE v_random_string VARCHAR(5);
  WHILE v_rownum < 1000000 DO
    SET v_random_string = '';
    WHILE LENGTH(v_random_string) < 5 DO
      SET v_random_character = CHAR(RAND()*128);
      IF v_random_character BETWEEN 'a' AND 'z' THEN
        SET v_random_string = CONCAT(v_random_string,v_random_character);
        END IF;
      END WHILE;
    SET @stmt1 = CONCAT('INSERT INTO t VALUES (',
                        v_rownum,
                        ',''',
                        v_random_string,
                        ''');');
    PREPARE stmt1 FROM @stmt1;
    EXECUTE stmt1;
    SET v_rownum = v_rownum + 1;
    END WHILE;
  END//
CALL p()//
delimiter ;
select count(*) from t;
create index i on t (char_column, int_column);
drop index i on t;
[22 Oct 2007 5:32] Christopher Powers
Unable to reproduce with the latest codebase, public or private, Windows or Linux.
[22 Oct 2007 11:12] Hakan Küçükyılmaz
Peter,

which version of MySQL did you use for this test?

Best regards,

Hakan
[22 Oct 2007 15:47] Hakan Küçükyılmaz
Tried with 10 million rows. I get 'record memory is exhausted' but no crash:

[17:43] root@test>select count(*) from t;
+----------+
| count(*) |
+----------+
| 10000000 |
+----------+
1 row in set (37.77 sec)

6.0.3-alpha-debug
[17:44] root@test>create index i on t (char_column, int_column);
ERROR 1296 (HY000): Got error 305 'record memory is exhausted' from Falcon
6.0.3-alpha-debug
[17:45] root@test>
[22 Oct 2007 16:20] Peter Gulutzan
This is 6.0.4-alpha-debug,
pulled from bk source (mysql-6.0),
built with BUILD/compile-pentium-debug-max,
OS = Linux SUSE 10 64-bit,
chip = Turion.

bk changes starts with
"ChangeSet@1.2632, 2007-10-18 03:11:01+02:00 ..."

Today I ran it again, and it crashed again.
[22 Oct 2007 18:38] Hakan Küçükyılmaz
Duplicate of Bug#31286, which is fixed in mysql-6.0-falcon-team tree already.

This is the backtrace we get with mysql-6.0-main

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x40882950 (LWP 594)]
0x00002ae9361a9894 in vfprintf () from /lib/libc.so.6
(gdb) bt
#0  0x00002ae9361a9894 in vfprintf () from /lib/libc.so.6
#1  0x00002ae9361cf3fa in vsnprintf () from /lib/libc.so.6
#2  0x00000000008b2e4f in Log::log (mask=1, text=0x40843990 "\b", args=0x0) at Log.cpp:186
#3  0x00000000008b3171 in Log::log (
    txt=0xbff2d0 "\nModule\tLine\tIn Use\tSpace in Use\tDeleted\tSpace deleted\n") at Log.cpp:99
#4  0x00000000008b33e5 in LogStream::putSegment (this=<value optimized out>,
    string=0xbff2d0 "\nModule\tLine\tIn Use\tSpace in Use\tDeleted\tSpace deleted\n") at LogStream.cpp:42
#5  0x00000000008b3849 in MemMgr::analyze (this=0x10ca000, mask=0, stream=0x40843ec0, summaryTable=0x0,
    detailTable=0x0) at MemMgr.cpp:1067
#6  0x0000000000892a26 in Database::retireRecords (this=0x2aaaaf108b98, forced=true) at Database.cpp:1642
#7  0x0000000000892ca6 in Database::forceRecordScavenge (this=0x40843420) at Database.cpp:2264
#8  0x00000000008c2d16 in Record::allocRecordData (this=0x3ae8270, length=13) at Record.cpp:950
#9  0x00000000008c306a in Record::setRecordData (this=0x40843420,
    dataIn=0x2aaab106d09a "��\024\232ZLwXd\201�\201\211��\025\232xNrGD\201�\202\211��\026\232AKyMH\201�\203\211��\027\232pDzBy\201�\204\211��\030\232sdzET\201�\205\211��\031\232CiVlY\201�\206\211��\032\232XmuxQ\201�\207\211��\033\232COMut\201�\210\211��\034\232vTaRT\201�\211\211��\035\232YfWdn\201�\212\211��\036\232RuMYX\201�\213\211��\037\232YzGsj\201�\214\211�� \232iKMMF\201�\215\211��!\232BsyZz\201�\216\211��\"\232Cbzdf\201�\217\211��#\232r"..., dataLength=1082407312) at Record.cpp:882
#10 0x00000000008ed1f8 in SRLUpdateRecords::thaw (this=0x40844af8, record=0x3ae8270) at SRLUpdateRecords.cpp:93
#11 0x000000000087d55d in Transaction::thaw (this=0x2aaab24bc3e8, record=0x3ae8270) at Transaction.cpp:531
#12 0x00000000008c4835 in RecordVersion::thaw (this=0x3ae8270) at RecordVersion.cpp:275
#13 0x00000000008c44c3 in RecordScavenge::inventoryRecord (this=0x408456c0, record=0x3ae8270) at Record.h:116
#14 0x00000000008c24e5 in RecordLeaf::inventoryRecords (this=<value optimized out>, recordScavenge=0x408456c0)
    at RecordLeaf.cpp:247
#15 0x000000000090c68e in RecordGroup::inventoryRecords (this=<value optimized out>, recordScavenge=0x408456c0)
    at RecordGroup.cpp:192
---Type <return> to continue, or q <return> to quit---
#16 0x000000000090c68e in RecordGroup::inventoryRecords (this=<value optimized out>, recordScavenge=0x408456c0)
    at RecordGroup.cpp:192
#17 0x00000000008740ce in Table::inventoryRecords (this=0x1306ae0, recordScavenge=0x408456c0) at Table.cpp:1607
#18 0x0000000000892a70 in Database::retireRecords (this=0x2aaaaf108b98, forced=true) at Database.cpp:1648
#19 0x0000000000892ca6 in Database::forceRecordScavenge (this=0x40843420) at Database.cpp:2264
#20 0x00000000008c2d16 in Record::allocRecordData (this=0x3ae8270, length=13) at Record.cpp:950
#21 0x00000000008c306a in Record::setRecordData (this=0x40843420,
    dataIn=0x2aaab106d09a "��\024\232ZLwXd\201�\201\211��\025\232xNrGD\201�\202\211��\026\232AKyMH\201�\203\211��\027\232pDzBy\201�\204\211��\030\232sdzET\201�\205\211��\031\232CiVlY\201�\206\211��\032\232XmuxQ\201�\207\211��\033\232COMut\201�\210\211��\034\232vTaRT\201�\211\211��\035\232YfWdn\201�\212\211��\036\232RuMYX\201�\213\211��\037\232YzGsj\201�\214\211�� \232iKMMF\201�\215\211��!\232BsyZz\201�\216\211��\"\232Cbzdf\201�\217\211��#\232r"..., dataLength=1082407312) at Record.cpp:882
#22 0x00000000008ed1f8 in SRLUpdateRecords::thaw (this=0x40845ea8, record=0x3ae8270) at SRLUpdateRecords.cpp:93
#23 0x000000000087d55d in Transaction::thaw (this=0x2aaab24bc3e8, record=0x3ae8270) at Transaction.cpp:531
#24 0x00000000008c4835 in RecordVersion::thaw (this=0x3ae8270) at RecordVersion.cpp:275
#25 0x00000000008c44c3 in RecordScavenge::inventoryRecord (this=0x40846a70, record=0x3ae8270) at Record.h:116
#26 0x00000000008c24e5 in RecordLeaf::inventoryRecords (this=<value optimized out>, recordScavenge=0x40846a70)
    at RecordLeaf.cpp:247
#27 0x000000000090c68e in RecordGroup::inventoryRecords (this=<value optimized out>, recordScavenge=0x40846a70)
    at RecordGroup.cpp:192
#28 0x000000000090c68e in RecordGroup::inventoryRecords (this=<value optimized out>, recordScavenge=0x40846a70)
    at RecordGroup.cpp:192
#29 0x00000000008740ce in Table::inventoryRecords (this=0x1306ae0, recordScavenge=0x40846a70) at Table.cpp:1607
#30 0x0000000000892a70 in Database::retireRecords (this=0x2aaaaf108b98, forced=true) at Database.cpp:1648
#31 0x0000000000892ca6 in Database::forceRecordScavenge (this=0x40843420) at Database.cpp:2264