Bug #75842 static SyncDebug syncDebug;
Submitted: 10 Feb 2015 15:06 Modified: 23 Feb 2015 15:31
Reporter: Tor Didriksen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any

[10 Feb 2015 15:06] Tor Didriksen
Description:
Currently, when running mtr tests, I always get the message
InnoDB: Return value 16 when calling pthread_mutex_destroy(). Byte contents of the pthread mutex at 0x25b6748: len 40; hex 000000000000000000000000d2ffffff000100000000000000000000000000000000000000000000;

OS error code  16 means  Device or resource busy

How to repeat:
./sql/mysqld --help --verbose

I added a DBUG_ASSERT(false); and ran in gdb, here is the call stack:

#0  0x00007ffff67ccc39 in raise () from /lib64/libc.so.6
#1  0x00007ffff67ce348 in abort () from /lib64/libc.so.6
#2  0x00007ffff67c5b96 in __assert_fail_base () from /lib64/libc.so.6
#3  0x00007ffff67c5c42 in __assert_fail () from /lib64/libc.so.6
#4  0x00000000015a2149 in OSBasicMutex<TrackPolicy>::destroy (this=0x25b6740 <syncDebug>)
    at /export-b/home/didrik/gitclone/trunk-bug20430526asangeom/storage/innobase/include/ib0mutex.h:106
#5  0x00000000015a111c in OSTrackMutex<TrackPolicy>::destroy (this=0x25b6740 <syncDebug>)
    at /export-b/home/didrik/gitclone/trunk-bug20430526asangeom/storage/innobase/include/ib0mutex.h:222
#6  0x00000000015a0921 in SyncDebug::~SyncDebug (this=0x25b6740 <syncDebug>, __in_chrg=<optimized out>)
    at /export-b/home/didrik/gitclone/trunk-bug20430526asangeom/storage/innobase/sync/sync0debug.cc:230
#7  0x00007ffff67d04c9 in __run_exit_handlers () from /lib64/libc.so.6
#8  0x00007ffff67d0515 in exit () from /lib64/libc.so.6
#9  0x0000000000bbbcc4 in mysqld_exit (exit_code=1) at /export-b/home/didrik/gitclone/trunk-bug20430526asangeom/sql/mysqld.cc:1312
#10 0x0000000000bbbc34 in unireg_abort (exit_code=1) at /export-b/home/didrik/gitclone/trunk-bug20430526asangeom/sql/mysqld.cc:1283
#11 0x0000000000bc0b25 in init_server_components () at /export-b/home/didrik/gitclone/trunk-bug20430526asangeom/sql/mysqld.cc:4108
#12 0x0000000000bc1d30 in mysqld_main (argc=9, argv=0x25f2670) at /export-b/home/didrik/gitclone/trunk-bug20430526asangeom/sql/mysqld.cc:4690
#13 0x0000000000bb99f0 in main (argc=3, argv=0x7fffffffdb58) at /export-b/home/didrik/gitclone/trunk-bug20430526asangeom/sql/main.cc:25

Suggested fix:
Do not use global static objects,
running of destructors not well defined.

See here
http://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Static_and_Global_Variable...
[23 Feb 2015 15:31] Daniel Price
Posted by developer:
 
Fixed as of the upcoming 5.7.7, 5.8.0 releases, and here's the changelog entry:

"Return value 16 when calling pthread_mutex_destroy()" warnings were
returned during "atexit()" processing.

Thank you for the bug report.