Bug #58380 mysqld --debug crashes immediately on Solaris due to null ptr passed to vfprintf
Submitted: 22 Nov 2010 13:23 Modified: 22 Nov 2010 19:51
Reporter: Bjørn Munch Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Logging Severity:S3 (Non-critical)
Version:5.1 OS:Solaris
Assigned to:

[22 Nov 2010 13:23] Bjørn Munch
Description:
I try to run mysqld --debug (via mtr) on a 5.1 build with Sun Studio on OpenSolaris x86.

It cores, and this is part of the stack trace:

  ---- called from signal handler with signal 11 (SIGSEGV) ------
  [8] strlen(0x0, 0x0, 0xe5b832, 0x0, 0x0, 0x73), at 0xfffffd7fff18a9e0 
  [9] _ndoprnt(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7fff1db906 
  [10] vfprintf(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7fff1df5a7 
  [11] _db_doprnt_(format = 0xe5b82b "name: '%s'", ... = 0xa438a6, ...), line 1168 in "dbug.c"
  [12] mysql_change_db(thd = 0x11e9110, new_db_name = 0xfffffd7fff0288c0, force_switch = true), line 1584 in "sql_db.cc"

How to repeat:
On a debug build, run ./mtr --debug 1st (or any test)

It works fine on Linux.

Suggested fix:
I put in a workaround for the crash by replacing the null ptr with an empty string in mysql_change_db but then it crashes another place. I fix this and it crashes a third place...

The code has been rewritten in 5.5 and the problem appears to gave gone away in the process, so this is a 5.1 only bug it seems.
[22 Nov 2010 19:46] Sveta Smirnova
Thank you for the report.

There is old bug #37850 with your comment. Why do you open new one?
[22 Nov 2010 19:47] Sveta Smirnova
Bug about very same problem I mean.
[22 Nov 2010 19:51] Bjørn Munch
Oops, sorry, see Bug #37850.