Bug #3818 | Using Embedded Server function my_server_init causes crash | ||
---|---|---|---|
Submitted: | 18 May 2004 19:37 | Modified: | 26 May 2004 7:18 |
Reporter: | David Woakes | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Embedded Library ( libmysqld ) | Severity: | S2 (Serious) |
Version: | 4.0.18 | OS: | Windows (Windows 2000) |
Assigned to: | Alexey Botchkov | CPU Architecture: | Any |
[18 May 2004 19:37]
David Woakes
[18 May 2004 22:17]
MySQL Verification Team
Thank you for the bug report. I tested your sample code getting the crash reported: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at testbug.LibWrap.ServerInit(Int32 argc, IntPtr[] args, IntPtr[] groups) at testbug.Class1.Main(String[] args) in c:\temp\testbug\class1.cs:line 54 Added \libmysql\my_thr_init.c like you said but I got a compiler error with the below line: #if defined(__WIN__) && defined(EMBEDDED_LIBRARY) tmp->thread_self= (pthread_t)getpid(); #endif my_thr_init.c(175) : error C2039: 'thread_self' : is not a member of 'st_my_thread_var' I commented it just for test purposes and the libmysqld.dll in fact not crash your application.
[18 May 2004 22:24]
David Woakes
I had to make a couple of other changes apart from those I mentioned. Not quite sure but somehow initially it did compile but later refused. I changed the line you mentioned: tmp->thread_self= (pthread_t)getpid(); to tmp->pthread_self= (pthread_t)getpid(); And also copied the file mysys_priv.h into mylibsqld to get it recompiled. When I do this I no error and can connect. It was by adding traces to the routines in libmysqld I was able to find the error was caused by line 169 in my_thr_init.c. Apologies for my incomplete report. I find it odd that your traces didnt tell you where the error was occuring! What did your traces tell you ?
[26 May 2004 7:18]
Alexey Botchkov
bk commit - 4.0 tree (hf:1.1849) BUG#3818
[26 May 2004 7:18]
Alexey Botchkov
Thank you for your bug report. This issue has already been fixed in the latest released version of that product, which you can download at http://www.mysql.com/downloads/
[26 May 2004 7:31]
David Woakes
I note that this issue has been closed with the comment that a fix is incorporated into the latest version of MySQL. 4.0.18 is the current production release of MySQL for windows and is where I found the bug. Or does this mean a new release is about to be made ?