Bug #18275 invalid file descriptor causes crash on windows
Submitted: 16 Mar 2006 10:01 Modified: 7 Jul 2006 0:06
Reporter: Shane Bester
Status: Closed
Category:Server Severity:S1 (Critical)
Version:5.0.19-max-nt OS:Microsoft Windows (win2003sp1, x64)
Assigned to: Reggie Burnett Target Version:

[16 Mar 2006 10:01] Shane Bester
Description:
MySQL crashes when running the testcase from bug17750 on 5.0.19.
The following message appears when running the mysqld-debug.exe

<snip>
Program: ...
File lseeki64.c
Line: 78

Expression: (fh >= 0 && (signed)fh < (unsigned)_nhandle)

For importantion on how your program can cause an assertion failure, see the Visual C++
documentation on asserts.
</snip>

How to repeat:
Start mysql server

D:\server\mysql-5.0.19-win-src\mysql-5.0.19\client_debug>mysqld-debug
--defaults-file=d:/bug17750/ew.ini --skip-grant-tables

Run the private testcase from bug 17750.

test.bat

Wait for a crash.

Suggested fix:
not sure
[16 Mar 2006 13:48] Heikki Tuuri
Shane,

looks like mysqld was not able to open a temp file:

mysqld-debug.exe!my_seek(int fd=-1, unsigned __int64 pos=0, int whence=0, int MyFlags=0) 
Line 32 + 0x15 bytes	C

Do you have temp file settings right in your my.cnf?

Regards,

Heikki
[17 Mar 2006 14:55] Shane Bester
The MySQL officially released binaries from dev.mysql.com crash too. I just built my own
to get a stack trace...
[11 May 2006 14:35] Shane Bester
I don't see a crash anymore in 5.0.21 on win x64. Can somebody confirm if those binaries
are patched with the mysql-5.0.19-x64.patch ?
[12 May 2006 16:31] Reggie Burnett
Can I get a repost of the test case that reproduces this bug?  The link given is not
working.
[19 Jun 2006 11:29] Sveta Smirnova
Similar behaviour on 32-bit machine here: http://bugs.mysql.com/bug.php?id=20504
[5 Jul 2006 15:50] Reggie Burnett
Fixed in 5.0.23.
[7 Jul 2006 0:06] Paul DuBois
Noted in 5.0.23, 5.1.12 changelogs.

On Windows, corrected a crash stemming from differences in
Visual C runtime library routines from POSIX behavior
regarding invalid file descriptors.