Bug #27597 mysqld-debug broken
Submitted: 2 Apr 2007 21:18 Modified: 15 Jun 2007 19:48
Reporter: Sveta Smirnova Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.38 OS:Windows (Windows)
Assigned to: Magnus Blåudd CPU Architecture:Any
Tags: bfsm_2007_04_05, regression

[2 Apr 2007 21:18] Sveta Smirnova
Description:
Error occurs when client tries to connect to mysqld-debug.exe from 5.0.38 package.

How to repeat:
Start mysqld-debug.exe and try to connect to it.
[2 Apr 2007 21:23] MySQL Verification Team
stack trace of debug assertion when running 'show processlist'

Attachment: bug27597_windows_5.0.38_stack.txt (text/plain), 1.11 KiB.

[2 Apr 2007 21:32] MySQL Verification Team
Uploading full Dr. Watson dump

Attachment: mysqldebug_5038_crash.zip (application/zip, text), 159.13 KiB.

[4 Apr 2007 8:35] Magnus Blåudd
This is caused by the binary being compiled with the VC++ compiler option
"Basic runtime checks" set to detect uninitialized variables.

Just press the ignore button....
[11 May 2007 12:58] Magnus Blåudd
mysys/my_init.c should have a new function like this:

#ifdef __MSVC_RUNTIME_CHECKS
#include <rtcapi.h>

/*
  handle_rtc_failure
  Catch the RTC error and dump it to stderr
*/

int handle_rtc_failure(int err_type, const char *file, int line, const char* module,
                       const char *format, ...)
{
  va_list args;
  va_start(args, format);
  fprintf(stderr, "Error at %s:%d: ", file, line);
  vfprintf(stderr, format, args);
  fprintf(stderr, "\n");
  va_end(args);
  (void) fflush(stderr);

  return 0; /* Error is handled */
}
#endif

and it should be installed in 'my_win_init'

#ifdef __MSVC_RUNTIME_CHECKS
  /*
    Install handler to send RTC (Runtime Error Check) warnings
    to log file
  */
  //_RTC_SetErrorFunc(handle_rtc_failure);
#endif

that will take care of sending and left over CRT errors to the the error log
[14 May 2007 14:04] 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/26613

ChangeSet@1.2440, 2007-05-14 16:04:36+02:00, msvensson@pilot.blaudden +1 -0
  Bug#27597 mysqld-debug broken
  - Send errors from RTC(Runtime Error Check) to stderr instead of
  popping up an MessageBox asking to debug
[25 May 2007 15:52] Iggy Galarza
Marked Bug #24267 as a duplicate.
[6 Jun 2007 16:54] Bugs System
Pushed into 5.1.20-beta
[6 Jun 2007 16:58] Bugs System
Pushed into 5.0.44
[15 Jun 2007 19:48] Peter Lavin
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html

Added to the changelogs for 5.0.44 and 5.1.20.
[2 Oct 2007 18:44] 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/34772

ChangeSet@1.2527, 2007-10-02 20:44:37+02:00, msvensson@pilot.mysql.com +1 -0
  Bug#27597 mysqld-debug broken
   - "on" -> "restore" to avoid warning in MSVC when compiling with debug
[18 Oct 2007 21:35] Bugs System
Pushed into 5.1.23-beta
[18 Oct 2007 21:37] Bugs System
Pushed into 5.0.52