Bug #51001 valgrind errors in innodb mutex code when shutting down 5.5
Submitted: 8 Feb 2010 16:28 Modified: 24 Jun 2010 7:54
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: InnoDB Plugin storage engine Severity:S1 (Critical)
Version:5.5.99-m3 with plugin 1.0.6, 5.5-m2 OS:Any (fc6 x86)
Assigned to: Assigned Account CPU Architecture:Any
Tags: valgrind

[8 Feb 2010 16:28] Shane Bester
Description:
shutting down 5.5.99 when running under valgrind shows us many errors like this:

091123 17:01:45  InnoDB: Starting shutdown...
Thread 18:
Invalid write of size 4
at: mutex_free (sync0sync.c:333)
by: sync_close (sync0sync.c:1373)
by: innobase_shutdown_for_mysql (srv0start.c:2014)
by: innobase_end(handlerton*, ha_panic_function) (ha_innodb.cc:2304)
by: ha_finalize_handlerton(st_plugin_int*) (handler.cc:407)
by: plugin_deinitialize(st_plugin_int*, bool) (sql_plugin.cc:852)
by: reap_plugins() (sql_plugin.cc:940)
by: plugin_shutdown() (sql_plugin.cc:1630)
by: clean_up(bool) (mysqld.cc:1445)
by: unireg_end() (mysqld.cc:1361)
by: kill_server(void*) (mysqld.cc:1296)
by: kill_server_thread (mysqld.cc:1324)
by: start_thread (in /lib/libpthread-2.5.so)
by: clone (in /lib/libc-2.5.so)
 Address 0x61f54c4 is 164 bytes inside a block of size 224 free'd

my environment:
branch revno: 2998
valgrind-3.5.0
Fedora Core release 6 (Zod)
Linux box1.hti.co.za 2.6.18-1.2798.fc6xen #1 SMP Mon Oct 16 15:11:19 EDT 2006 i686 athlon i386 GNU/Linux

How to repeat:
valgrind --tool=memcheck --track-origins=yes --leak-check=full -v 
--show-reachable=yes --num-callers=50 ./bin/mysqld --no-defaults 
--skip-grant-tables --skip-name-resolve --basedir=. --datadir=./data

./bin/mysqladmin -uroot shutdown
[8 Feb 2010 16:35] MySQL Verification Team
full outputs

Attachment: bug51001_full_valgrind_output.txt (text/plain), 97.93 KiB.

[9 Feb 2010 8:15] Sveta Smirnova
Thank you for the report.

Verified as described.
[28 Apr 2010 19:43] MySQL Verification Team
maybe this is related to bug #53239 !
[24 Jun 2010 7:54] MySQL Verification Team
no longer repeatable with this tree:

bzr+ssh://XXX@bk-internal.mysql.com/bzrroot/server/mysql-trunk/
Now on revision 3072

Probably a duplicate of bug #53947