Bug #47809 innodb-autoinc.test fails with valgrind errors with the innodb plugin
Submitted: 4 Oct 2009 10:12 Modified: 14 May 2010 5:13
Reporter: Georgi Kodinov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB Plugin storage engine Severity:S3 (Non-critical)
Version:5.1-bk OS:Linux (Fedora Core 11/x86_64)
Assigned to: Sunny Bains CPU Architecture:Any
Triage: Triaged: D2 (Serious)

[4 Oct 2009 10: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 2009 10:13] Georgi Kodinov
full valgrind log file

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

[4 Oct 2009 10: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 2009 9: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)
[12 Oct 2009 23: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 2009 9: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 2009 6: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 2009 7: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)
[25 Nov 2009 23:22] Sunny Bains
This bug seems to have been fixed by changes that were made to address bug#45992.
[26 Nov 2009 8:37] Georgi Kodinov
Can you please re-enable the test before closing the bug ? 
I've tried it on the latest 5.1-bugteam and I'm getting : 
main.innodb-autoinc                      [ fail ]
        Test ended at 2009-11-26 10:28:14

CURRENT_TEST: main.innodb-autoinc
--- /home/kgeorge/mysql/work/test-5.1-bugteam/mysql-test/r/innodb-autoinc.resul2009-11-18 15:28:22.000000000 +0300
+++ /home/kgeorge/mysql/work/test-5.1-bugteam/mysql-test/r/innodb-autoinc.rejec2009-11-26 11:28:13.000000000 +0300
@@ -875,11 +875,11 @@
 SELECT * FROM t1;
 d1
 1
-3
+2
 SELECT * FROM t1;
 d1
 1
-3
+2
 INSERT INTO t1 VALUES(null);
 Got one of the listed errors
 ALTER TABLE t1 AUTO_INCREMENT = 3;
@@ -888,13 +888,13 @@
 t1     CREATE TABLE `t1` (
   `d1` int(11) NOT NULL AUTO_INCREMENT,
   PRIMARY KEY (`d1`)
-) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
 INSERT INTO t1 VALUES(null);
 SELECT * FROM t1;
 d1
 1
+2
 3
-4
 DROP TABLE t1;
 SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
 SHOW VARIABLES LIKE "%auto_inc%";

mysqltest: Result content mismatch
[18 Dec 2009 10:34] Bugs System
Pushed into 5.1.41-ndb-7.1.0 (revid:jonas@mysql.com-20091218102229-64tk47xonu3dv6r6) (version source revid:jonas@mysql.com-20091218095730-26gwjidfsdw45dto) (merge vers: 5.1.41-ndb-7.1.0) (pib:15)
[18 Dec 2009 10:50] Bugs System
Pushed into 5.1.41-ndb-6.2.19 (revid:jonas@mysql.com-20091218100224-vtzr0fahhsuhjsmt) (version source revid:jonas@mysql.com-20091217101452-qwzyaig50w74xmye) (merge vers: 5.1.41-ndb-6.2.19) (pib:15)
[18 Dec 2009 11:05] Bugs System
Pushed into 5.1.41-ndb-6.3.31 (revid:jonas@mysql.com-20091218100616-75d9tek96o6ob6k0) (version source revid:jonas@mysql.com-20091217154335-290no45qdins5bwo) (merge vers: 5.1.41-ndb-6.3.31) (pib:15)
[18 Dec 2009 11:19] Bugs System
Pushed into 5.1.41-ndb-7.0.11 (revid:jonas@mysql.com-20091218101303-ga32mrnr15jsa606) (version source revid:jonas@mysql.com-20091218064304-ezreonykd9f4kelk) (merge vers: 5.1.41-ndb-7.0.11) (pib:15)