Bug #47455 The myisam_crash_before_flush_keys test fails on Windows

Submitted: 19 Sep 2009 20:10 Modified: 18 Dec 2009 23:47
Reporter: Igor Babaev Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.1 OS:Windows
Assigned to: Sergey Vojtovich CPU Architecture:Any

[19 Sep 2009 20:10] Igor Babaev
Description:
When working on Windows with the build created from the current mysql-5.1 tree 
(http://bazaar.launchpad.net/~mysql/mysql-server/mysql-5.1/) and trying to run

mysql-5.1\mysql-test>perl mysql-test-run.pl myisam_crash_before_flush_keys

I've got an unexpected result.

How to repeat:
Install MySQL from the build tree on Windows following the instructions that could be found in win/README.

Run 

mysql-5.1\mysql-test>perl mysql-test-run.pl myisam_crash_before_flush_keys

You'll get something like this:

C:\mysql-5.1\mysql-test>perl mysql-test-run.pl myisam_crash_before_flush_keys
Logging: mysql-test-run.pl  myisam_crash_before_flush_keys
MySQL Version 5.1.40
Checking supported features...
 - skipping ndbcluster, mysqld not compiled with ndbcluster
 - SSL connections supported
 - binaries are debug compiled
Collecting tests...
vardir: C:/mysql-5.1/mysql-test/var
Checking leftover processes...
Removing old var directory...
Creating var directory 'C:/mysql-5.1/mysql-test/var'...
Installing system database...
Using server port 3647

==============================================================================

TEST                                      RESULT   TIME (ms)
------------------------------------------------------------

worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009
Could not open event or process 1952, error: 87
Couldn't open the winpid: 1952 for pid: 1952, try one more time
Could not open event or process 1952, error: 87
Couldn't open the winpid: 1952 for pid: 1952, continue and see what happens...
main.myisam_crash_before_flush_keys      [ fail ]
        Test ended at 2009-09-19 12:40:14

CURRENT_TEST: main.myisam_crash_before_flush_keys
mysqltest: At line 33: command "$MYISAMCHK -rs $MYSQLD_DATADIR/test/t1" failed

Output from before failure:
exec of 'C:\mysql-5.1\storage\myisam\debug\myisamchk.exe -rs C:/mysql-5.1/mysql-test/var/mysqld.1/data//test/t1' failed, error: 1, status: 1, errno: 0

The result from queries just before the failure was:
< snip >
SET GLOBAL delay_key_write=ALL;
CREATE TABLE t1(a INT,
b INT,
PRIMARY KEY(a , b),
KEY(b)) ENGINE=MyISAM DELAY_KEY_WRITE = 1;
INSERT INTO t1 VALUES (1,2),(2,3),(3,4),(4,5),(5,6);
# Setup the mysqld to crash at certain point
SET SESSION debug="d,crash_before_flush_keys";
# Write file to make mysql-test-run.pl expect crash
# Run the crashing query
FLUSH TABLE t1;
ERROR HY000: Lost connection to MySQL server during query
# Run MYISAMCHK tool to check the table t1 and repair
myisamchk.exe: MyISAM file MYSQLD_DATADIR/test/t1
myisamchk.exe: warning: 1 client is using or hasn't closed the table properly
myisamchk.exe: error: Size of indexfile is: 1024            Should be: 3072
MYISAMCHK: Unknown error 126
myisamchk.exe: error: Can't read indexpage from filepos: 1024
MyISAM-table 'MYSQLD_DATADIR/test/t1' is corrupted
Fix it using switch "-r" or "-o"

More results from queries before failure can be found in C:\mysql-5.1\mysql-test\var\log\myisam

 - saving 'C:/mysql-5.1/mysql-test/var/log/main.myisam_crash_before_flush_keys/' to 'C:/mysql-5.1/mysql-test/var/log/main.myisam_crash_before_flush_keys/'
------------------------------------------------------------
The servers were restarted 0 times
Spent 0.000 of 41 seconds executing testcases

Failed 1/1 tests, 0.00% were successful.

Failing test(s): main.myisam_crash_before_flush_keys

The log files in var/log may give you some hint of what went wrong.

If you want to report this error, please read first the documentation
at http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html

mysql-test-run: *** ERROR: there were failing test cases

Suggested fix:
The problem is that the myisamchk utility exits in this test with the error code (int) -1.
On Linux -1 is converted to 0xFF (255), while on on Windows it's converted to 0xFFFFFFFF.
[21 Sep 2009 12:10] MySQL Verification Team
c:\build\mysql-5.1\mysql-test>perl mysql-test-run.pl myisam_crash_before_flush_keys
Found handle.exe version 3.42
Logging: mysql-test-run.pl  myisam_crash_before_flush_keys
090921  9:08:07 [Note] Plugin 'FEDERATED' is disabled.
090921  9:08:07 [Warning] Forcing shutdown of 1 plugins
MySQL Version 5.1.40
Checking supported features...
 - skipping ndbcluster, mysqld not compiled with ndbcluster
 - SSL connections supported
 - binaries are debug compiled
Collecting tests...
vardir: c:/build/mysql-5.1/mysql-test/var
Removing old var directory...
Creating var directory 'c:/build/mysql-5.1/mysql-test/var'...
Installing system database...
Using server port 50503

==============================================================================

TEST                                      RESULT   TIME (ms)
------------------------------------------------------------

worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009
Could not open event or process 6148, error: 87
Couldn't open the winpid: 6148 for pid: 6148, try one more time
Could not open event or process 6148, error: 87
Couldn't open the winpid: 6148 for pid: 6148, continue and see what happens...
main.myisam_crash_before_flush_keys      [ fail ]
        Test ended at 2009-09-21 09:09:06

CURRENT_TEST: main.myisam_crash_before_flush_keys
mysqltest: At line 32: command "$MYISAMCHK -cs $MYSQLD_DATADIR/test/t1 2>&1" succeeded - should have failed with errno 255...

The result from queries just before the failure was:
#
# BUG#41330 - Myisam table open count set to zero before index blocks are written.
#
# Don't test this under valgrind, memory leaks will occur
# Binary must be compiled with debug for crash to occur
SET GLOBAL delay_key_write=ALL;
[21 Sep 2009 12:14] MySQL Verification Team
Thank you for the bug report.
[14 Oct 2009 11:26] 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/86785

3167 Sergey Vojtovich	2009-10-14
      BUG#47455 - The myisam_crash_before_flush_keys test fails on Windows
      
      Simplified and made more determenistic myisam_crash_before_flush_keys
      test.
     @ mysql-test/r/myisam_crash_before_flush_keys.result
        We don't need myisamchk to test this bug fix. CHECK TABLE
        after server restart is enough to ensure that the fix
        works.
     @ mysql-test/t/myisam_crash_before_flush_keys.test
        We don't need myisamchk to test this bug fix. CHECK TABLE
        after server restart is enough to ensure that the fix
        works.
[4 Nov 2009 9:25] Bugs System
Pushed into 5.1.41 (revid:joro@sun.com-20091104092152-qz96bzlf2o1japwc) (version source revid:kristofer.pettersson@sun.com-20091020070001-gng3hmne2tyuhbxn) (merge vers: 5.1.41) (pib:13)
[5 Nov 2009 1:38] Paul DuBois
Test case changes. No changelog entry needed.

Setting report to NDI pending push to 5.0.x, 5.5.x, ...
[11 Nov 2009 6:52] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091110093407-rw5g8dys2baqkt67) (version source revid:alik@sun.com-20091109080109-7dxapd5y5pxlu08w) (merge vers: 6.0.14-alpha) (pib:13)
[11 Nov 2009 7:00] Bugs System
Pushed into 5.5.0-beta (revid:alik@sun.com-20091109115615-nuohp02h8mdrz8m2) (version source revid:alik@sun.com-20091105090244-qlvr0xg4scrhf4k4) (merge vers: 5.5.0-beta) (pib:13)
[11 Nov 2009 14:25] Paul DuBois
Changes to test cases. No changelog entry needed.
[18 Dec 2009 10:32] Bugs System
Pushed into 5.1.41-ndb-7.1.0 (revid:jonas@mysql.com-20091218102229-64tk47xonu3dv6r6) (version source revid:jonas@mysql.com-20091218095730-26gwjidfsdw45dto) (merge vers: 5.1.41-ndb-7.1.0) (pib:15)
[18 Dec 2009 10:48] Bugs System
Pushed into 5.1.41-ndb-6.2.19 (revid:jonas@mysql.com-20091218100224-vtzr0fahhsuhjsmt) (version source revid:jonas@mysql.com-20091217101452-qwzyaig50w74xmye) (merge vers: 5.1.41-ndb-6.2.19) (pib:15)
[18 Dec 2009 11:03] Bugs System
Pushed into 5.1.41-ndb-6.3.31 (revid:jonas@mysql.com-20091218100616-75d9tek96o6ob6k0) (version source revid:jonas@mysql.com-20091217154335-290no45qdins5bwo) (merge vers: 5.1.41-ndb-6.3.31) (pib:15)
[18 Dec 2009 11:17] Bugs System
Pushed into 5.1.41-ndb-7.0.11 (revid:jonas@mysql.com-20091218101303-ga32mrnr15jsa606) (version source revid:jonas@mysql.com-20091218064304-ezreonykd9f4kelk) (merge vers: 5.1.41-ndb-7.0.11) (pib:15)

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.047 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.