Bug #47809 innodb-autoinc.test fails with valgrind errors with the innodb plugin
Submitted: 4 Oct 12:12 Modified: 13 Oct 11:45
Reporter: Georgi Kodinov
Status: Verified
Category:Server: InnoDB Plugin Severity:S3 (Non-critical)
Version:5.1-bk OS:Linux (Fedora Core 11/x86_64)
Assigned to: Sunny Bains Target Version:5.1+
Triage: Triaged: D2 (Serious)

[4 Oct 12:12] Georgi Kodinov
Description:
innodb-autoinc.test fails for the innodb plugin when run under valgrind as follows (see
the attached log file for details) :
....
==19435== 168 bytes in 1 blocks are indirectly lost in loss record 24 of 158
==19435==    at 0x4A05E5D: malloc (vg_replace_malloc.c:195)
==19435==    by 0x5F3129A: ???
==19435==    by 0x5F30521: ???
==19435==    by 0x5F2F855: ???
==19435==    by 0x5F2F9BA: ???
==19435==    by 0x5F06FD9: ???
==19435==    by 0x5EE8333: ???
==19435==    by 0x5EE41A6: ???
==19435==    by 0x5EE4DC4: ???
==19435==    by 0x5F7E928: ???
==19435==    by 0x5F094AB: ???
==19435==    by 0x7E6376: ha_initialize_handlerton(st_plugin_int*) (handler.cc:435)
==19435==    by 0x8B28FA: plugin_initialize(st_plugin_int*) (sql_plugin.cc:1014)
==19435==    by 0x8B316B: plugin_init(int*, char**, int) (sql_plugin.cc:1238)
==19435==    by 0x699980: init_server_components() (mysqld.cc:3928)
==19435==    by 0x69A44F: main (mysqld.cc:4399)
...

How to repeat:
build with valgrind (BUILD/compile-pentium-valgrind-max) and run
./mysql-test-run --valgrind innodb-autoinc.test

Suggested fix:
"cure" the valgrind warnings
[4 Oct 12:13] Georgi Kodinov
full valgrind log file

Attachment: mysqld.1.err.zip (application/zip, text), 7.21 KiB.

[4 Oct 12:17] 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/85665

3151 Georgi Kodinov	2009-10-04
      Make innodb-autoinc.test experimental until bug#47809 is fixed.
[6 Oct 11:00] Bugs System
Pushed into 5.1.40 (revid:joro@sun.com-20091006073316-lea2cpijh9r6on7c) (version source
revid:joro@sun.com-20091004101656-t71s5xli0wm3q5c5) (merge vers: 5.1.40) (pib:11)
[13 Oct 1:44] Sunny Bains
I ran the test on our 5.1 branch and was unable to reproduce the error. I
built the code using:  BUILD/compile-pentium-valgrind-max. Then ran the
test using : ./mysql-test-run --valgrind innodb-autoinc.test

...

Logging: ./mysql-test-run  --valgrind innodb-autoinc.test
091013 10:39:57 [Note] Plugin 'FEDERATED' is disabled.
091013 10:39:57 [Note] Plugin 'ndbcluster' is disabled.
091013 10:39:57 [Warning] Forcing shutdown of 2 plugins
MySQL Version 5.1.40
Turning on valgrind for all executables
Running valgrind with options " --show-reachable=yes "
Checking supported features...
 - using ndbcluster when necessary, mysqld supports it
 - SSL connections supported
 - binaries are debug compiled
Using "../libtool" when running valgrind or debugger
...
main.innodb-autoinc                      [ pass ]  20323
...
==3494== 
==3494== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 7 from 1)
==3494== malloc/free: in use at exit: 1,796 bytes in 6 blocks.
==3494== malloc/free: 5,462 allocs, 5,456 frees, 2,239,064 bytes allocated.
==3494== For counts of detected errors, rerun with: -v
==3494== searching for pointers to 6 not-freed blocks.
==3494== checked 2,163,440 bytes.
==3494== 
==3494== 256 bytes in 1 blocks are still reachable in loss record 4 of 6
==3494==    at 0x4C2260E: malloc (vg_replace_malloc.c:207)
==3494==    by 0x50B83D9: my_malloc (my_malloc.c:34)
==3494==    by 0x50C17C7: init_dynamic_string (string.c:39)
==3494==    by 0x4176E2: run_query(st_connection*, st_command*, int) (mysqltest.cc:7026)
==3494==    by 0x418D65: main (mysqltest.cc:7837)
==3494== 
==3494== LEAK SUMMARY:
==3494==    definitely lost: 0 bytes in 0 blocks.
==3494==      possibly lost: 0 bytes in 0 blocks.
==3494==    still reachable: 256 bytes in 1 blocks.
==3494==         suppressed: 1,540 bytes in 5 blocks.
[13 Oct 11:45] Sergey Vojtovich
Still repeatable with the same backtrace, InnoPlug-1.0.5 from the current 5.1-bugteam:
BUILD/compile-pentium-valgrind-max
cd mysql-test; ./mtr --valgrind-mysqld innodb-autoinc
[22 Oct 8:35] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091022063126-l0qzirh9xyhp0bpc) (version
source revid:alik@sun.com-20091019135554-s1pvptt6i750lfhv) (merge vers: 6.0.14-alpha)
(pib:13)
[22 Oct 9:07] Bugs System
Pushed into 5.5.0-beta (revid:alik@sun.com-20091022060553-znkmxm0g0gm6ckvw) (version
source revid:alik@sun.com-20091013094238-g67x6tgdm9a7uik0) (merge vers: 5.5.0-beta)
(pib:13)