Bug #39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch
Submitted: 14 Sep 2008 10:33 Modified: 18 Jun 2010 23:04
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S1 (Critical)
Version:5.1.26,5.1.28 OS:Any
Assigned to: Vasil Dimov
Triage: Triaged: D1 (Critical) / R2 (Low) / E2 (Low)

[14 Sep 2008 10:33] Shane Bester
Description:
when running the testcase for bug #39436 against 5.1.x the crash happens in the SELECT with following call stack:

mysqld.exe!fil_space_get_latch  Line 341
mysqld.exe!fsp_get_available_space_in_free_extents
mysqld.exe!ha_innobase::info
mysqld.exe!make_join_statistics
mysqld.exe!JOIN::optimize
mysqld.exe!mysql_select
mysqld.exe!handle_select
mysqld.exe!execute_sqlcom_select
mysqld.exe!mysql_execute_command
mysqld.exe!mysql_parse
mysqld.exe!dispatch_command
mysqld.exe!do_command
mysqld.exe!handle_one_connection
mysqld.exe!pthread_start
mysqld.exe!_callthreadstart
mysqld.exe!_threadstart
kernel32.dll!BaseThreadStart

How to repeat:
see attached .c file
[14 Sep 2008 10:37] Shane Bester
testcase. run against server started with --innodb_file_per_table

Attachment: bug39436.c (text/plain), 6.26 KiB.

[21 Sep 2008 14:20] Inaam Rana
Shane,

I don't completely follow the test case. There are three threads issuing flush, discard, import and select randomly. How can we do import without having a proper 'clean backup'? I don't see where you create a backup in the test and copy it back to the data directory.

regards,
inaam
[22 Sep 2008 9:45] Shane Bester
Inaam, I agree the testcase is rather nonsensical and results in huge number of error messages both in the error log and the program.  But is server crash to be expected?
[1 Oct 2008 9:16] Vasil Dimov
Inaam, thank you for finding a simple test case!
Btw this bug existed before r2545 which fixed Bug#38185.
[1 Oct 2008 12:35] Vasil Dimov
I created a patch for this, review pending...
[12 Mar 2009 21:53] Paul Dubois
Noted in 5.1.31, 6.0.10 changelogs.

Following ALTER TABLE ... DISCARD TABLESPACE for an InnoDB table, an
attempt to determine the free space for the table before the ALTER
TABLE operation had completely finished could cause a server crash.
[5 May 2010 15:25] Bugs System
Pushed into 5.1.47 (revid:joro@sun.com-20100505145753-ivlt4hclbrjy8eye) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[6 May 2010 16:02] Paul Dubois
Push resulted from incorporation of InnoDB tree. No changes pertinent to this bug.
Re-closing.
[28 May 2010 6:12] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100524190136-egaq7e8zgkwb9aqi) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (pib:16)
[28 May 2010 6:40] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100524190941-nuudpx60if25wsvx) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[28 May 2010 7:08] Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100524185725-c8k5q7v60i5nix3t) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[29 May 2010 15:19] Paul Dubois
Push resulted from incorporation of InnoDB tree. No changes pertinent to this bug.
Re-closing.
[17 Jun 2010 12:18] Bugs System
Pushed into 5.1.47-ndb-7.0.16 (revid:martin.skold@mysql.com-20100617114014-bva0dy24yyd67697) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 13:05] Bugs System
Pushed into 5.1.47-ndb-6.2.19 (revid:martin.skold@mysql.com-20100617115448-idrbic6gbki37h1c) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 13:45] Bugs System
Pushed into 5.1.47-ndb-6.3.35 (revid:martin.skold@mysql.com-20100617114611-61aqbb52j752y116) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)