Bug #18275 invalid file descriptor causes crash on windows
Submitted: 16 Mar 2006 9:01 Modified: 6 Jul 2006 22:06
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.19-max-nt OS:Microsoft Windows (win2003sp1, x64)
Assigned to: Reggie Burnett CPU Architecture:Any

[16 Mar 2006 9: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 12: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 13: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 12: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 14: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 9:29] Sveta Smirnova
Similar behaviour on 32-bit machine here: http://bugs.mysql.com/bug.php?id=20504
[5 Jul 2006 13:50] Reggie Burnett
Fixed in 5.0.23.
[6 Jul 2006 22: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.