Bug #44914 Centos 4.4 Mysqld 4.1.22-2.el4 crash when SAVEPOINT is issued
Submitted: 16 May 2009 9:34 Modified: 27 May 2009 14:09
Reporter: Joel Heenan Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Locking Severity:S1 (Critical)
Version:4.1.22-2 OS:Linux (Centos 4.4)
Assigned to: CPU Architecture:Any
Tags: CentOS, crash, mysqld, savepoint

[16 May 2009 9:34] Joel Heenan
Description:
We are using an email program called Interspire Email Marketerer version 5.5 . When we import contacts from a CSV file, select both a username and a email mapping, and the program hits a SAVEPOINT statement mysqld crashes. 

For some reason it seems if you do not map the username field it doesn't crash. Maybe this is a clue somehow. 

I have checked all datafiles with myisamchk and they are all clean. 

Attached is the query log just before it crashes.

How to repeat:
Connect using to the email marketer. Select Import contacts from a file, upload a CSV file and map both the username and email address fields. Within 4-6 contacts mysqld will crash.
[16 May 2009 9:35] Joel Heenan
mysqld query crash log

Attachment: mysqld-crash-log.txt (text/plain), 8.06 KiB.

[16 May 2009 9:36] Joel Heenan
mysqld error log

Attachment: mysqld-error-log.txt (text/plain), 1.97 KiB.

[16 May 2009 11:20] Valeriy Kravchuk
Thank you for the problem report. Please, send the resolved stack trace and your my.cnf file content.
[16 May 2009 11:59] Joel Heenan
my.cnf file

Attachment: my.cnf.txt (text/plain), 1000 bytes.

[16 May 2009 12:02] Joel Heenan
my.cnf is attached

resolved stack dump:
0x8139eec handle_segfault + 610
0x4f6e67 (?)
0x831b884 trx_allocate_for_mysql + 25
0x81c22a7 innobase_mysql_tmpfile + 547
0x81c3150 _Z18innobase_savepointP3THDPcy + 56
0x81b5f53 _Z12ha_savepointP3THDPc + 235
0x814f934 _Z21mysql_execute_commandP3THD + 10282
0x8151b3c _Z11mysql_parseP3THDPcj + 166
0x815255a _Z16dispatch_command19enum_server_commandP3THDPcj + 2472
0x8152db5 _Z10do_commandP3THD + 127
0x815375b handle_one_connection + 2237
0x4f5371 (?)
0x3f5ffe (?)
[17 May 2009 15:45] Valeriy Kravchuk
Thank you for the additional information. Please, send the results of:

df -k
free

from your OS also.
[17 May 2009 21:59] Joel Heenan
# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda5             67401428  27208412  36769168  43% /
/dev/sda1               101086     11515     84352  13% /boot
/dev/sda3              1035692     34552    948528   4% /tmp
none                   2042004         0   2042004   0% /dev/shm

# free
             total       used       free     shared    buffers     cached
Mem:       4084012    4067856      16156          0      50480    3310540
-/+ buffers/cache:     706836    3377176
Swap:      2048276        144    2048132

I can see from the logs that at some point tmp ran out of space: 

/usr/libexec/mysqld: Disk is full writing '/tmp/STRbJrzp' (Errcode: 28). Waiting for someone to free space... Retry in 60 secs

I did try removing all the non-default options from the my.cnf and I was still able to cause the crash.
[18 May 2009 3:59] Valeriy Kravchuk
Please, try to set tmpdir server variable to some directory in / filesystem, big enough to hold temporary data. Read http://dev.mysql.com/doc/refman/5.0/en/server-options.html#option_mysqld_tmpdir for the details.

Let's check if this will help.
[18 May 2009 12:03] Joel Heenan
Valeriy,

Sorry no dice mate didn't help. I set it to /var/tmp/ , couldn't see anything at all get written to the /tmp/ dir so I don't think that is our problem. 

The disk is full messages are very old and I only just started administering this box so I don't know the history. I didn't mean they get printed during this problem, I don't think that is related. 

Joel
[26 May 2009 6:07] Sveta Smirnova
Thank  you for the report.

Please provide output of SHOW CREATE TABLE and SHOW TABLES STATUS for tables email_banned_emails, email_list_subscribers, email_lists.
[26 May 2009 9:51] Joel Heenan
show create tables and show table status

Attachment: create_tables_table_status.txt (text/plain), 118.81 KiB.

[26 May 2009 9:52] Joel Heenan
Sveta,

Please find the information you require.

Joel
[26 May 2009 10:17] Sveta Smirnova
Thank you for the feedback.

Verified as described.

Bug fixed in version 5.0 and later.

Problem is you use MyISAM tables which don't support transactions. So either change logic of your application and don't use SAVEPOINTs or change engine of tables to InnoDB.
[26 May 2009 10:18] Sveta Smirnova
test case

Attachment: bug44914.test (application/octet-stream, text), 3.23 KiB.

[27 May 2009 14:10] Omer Barnir
Issue is 4.1 specific - will not be fixed