Bug #52884 mysql-test-run does not work with --debug option
Submitted: 16 Apr 2010 10:50 Modified: 14 Oct 2010 14:44
Reporter: Sergei Glukhov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: General Severity:S2 (Serious)
Version:5.1-bugteam, mysql-pe OS:Any
Assigned to: Sergei Glukhov CPU Architecture:Any

[16 Apr 2010 10:50] Sergei Glukhov
Description:
mysql-test-run does not work with --debug option:

./mysql-test-run.pl --debug alias
MySQL Version 6.0.14
Checking supported features...
 - skipping ndbcluster, mysqld not compiled with ndbcluster
 - SSL connections supported
 - binaries are debug compiled
Collecting tests...
vardir: /MySQL/mysql-pe/mysql-test/var
Checking leftover processes...
Removing old var directory...
Creating var directory 'MySQL/mysql-pe/mysql-test/var'...
Installing system database...
mysql-test-run: *** ERROR: Error executing mysqld --bootstrap
Could not install system database from /MySQL/mysql-pe/mysql-test/var/tmp/bootstrap.sql
see /MySQL/mysql-pe/mysql-test/var/log/bootstrap.log for errors

How to repeat:
run ./mysql-test-run.pl --debug alias.
[16 Apr 2010 12:29] Sveta Smirnova
Thank you for the report.

Verified as described.
[13 May 2010 10:10] Sergei Glukhov
Now mysql-5.1-bugteam has the same problem,
mysql-test-run.pl does not work with --debug:

./mysql-test-run.pl --debug alias
Logging: ./mysql-test-run.pl  --debug alias
100513 14:05:48 [Note] Plugin 'FEDERATED' is disabled.
MySQL Version 5.1.47
Checking supported features...
 - skipping ndbcluster, mysqld not compiled with ndbcluster
 - SSL connections supported
 - binaries are debug compiled
Collecting tests...
vardir: /mysql-5.1-bugteam/mysql-test/var
Checking leftover processes...
Removing old var directory...
Creating var directory '/mysql-5.1-bugteam/mysql-test/var'...
Installing system database...
mysql-test-run: *** ERROR: Error executing mysqld --bootstrap
Could not install system database from /mysql-5.1-bugteam/mysql-test/var/tmp/bootstrap.sql
see /mysql-5.1-bugteam/mysql-test/var/log/bootstrap.log for errors

It should be fixed ASAP as it prevents some important debug operations.
[18 May 2010 13:41] Bjørn Munch
This would be a server bug. You need to examine var/log/bootstrap.log. I was able to reproduce but get more output:

Installing system database...
*** glibc detected *** /home/bm136801/my/ldebug-51/sql/mysqld: corrupted double-linked list: 0x0000000012d3df00 ***
<Some hex stuff of no help to you>

In var/log/bootstrap.log I see:

---
Warning: Not freed memory segments: 1
Warning: Memory that was not free'ed (512 bytes):
           512 bytes at 0x12d65bf8, allocated at line   42 in 'rpl_tblmap.cc'
Maximum memory usage: 9284885 bytes (9068k)
100518 15:33:18 - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=10344644715844964239
read_buffer_size=131072
max_used_connections=0
max_threads=151
threads_connected=0
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 10102192105647487 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = (nil) thread_stack 0x40000
[0x79ef42]
[0x4e9238]
[0x7007b0]
[0x853725]
[0x8189b0]
[0x82ac8b]
[0x832765]
[0x8363a7]
[0x825c7b]
[0x7af38a]
[0x7aebc3]
[0x7aed4a]
[0x779ebe]
[0x4ea61c]
[0x4ecdfb]
[0x813900]
[0x4001b9]
---
[18 May 2010 15:15] 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/108532

3387 Sergey Glukhov	2010-05-18
      Bug#52884 mysql-test-run does not work with --debug option
      Server crashes on 64bit linux with 'double free or corruption'
      message, on 32bit mysql-test-run silently fails on bootstrap
      stage. The fix is to remove superfluous FreeState() call.
     @ dbug/dbug.c
        Server crashes on 64bit linux with 'double free or corruption'
        message, on 32bit mysql-test-run silently fails on bootstrap
        stage. The fix is to remove superfluous FreeState() call.
[18 May 2010 16:00] 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/108543

3387 Sergey Glukhov	2010-05-18
      Bug#52884 mysql-test-run does not work with --debug option
      Server crashes on 64bit linux with 'double free or corruption'
      message, on 32bit mysql-test-run silently fails on bootstrap
      stage. The problem is that FreeState() is called twice
      for init_settings struct in _db_end_ function.
      The fix is to remove superfluous FreeState() call.
     @ dbug/dbug.c
        The problem is that FreeState() is called twice
        for init_settings struct in _db_end_ function.
        The fix is to remove superfluous FreeState() call.
[20 May 2010 5:58] Tor Didriksen
See also:
Bug #53779 mtr --debug was broken by bugfix 52629
Bug #46165 server crash in dbug
[20 May 2010 6:30] 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/108720

3391 Sergey Glukhov	2010-05-20
      Bug#52884 mysql-test-run does not work with --debug option
      Server crashes on 64bit linux with 'double free or corruption'
      message, on 32bit mysql-test-run silently fails on bootstrap
      stage. The problem is that FreeState() is called twice
      for init_settings struct in _db_end_ function.
      The fix is to remove superfluous FreeState() call.
      Additional fix:
      fixed discrepancy of result file when
      debug & valgrind options are enabled
      for MTR.
     @ dbug/dbug.c
        The problem is that FreeState() is called twice
        for init_settings struct in _db_end_ function.
        The fix is to remove superfluous FreeState() call.
     @ mysql-test/r/variables_debug.result
        fixed discrepancy of result file when
        debug & valgrind options are enabled
        for MTR.
     @ mysql-test/t/variables_debug.test
        fixed discrepancy of result file when
        debug & valgrind options are enabled
        for MTR.
     @ sql/set_var.cc
        fixed discrepancy of result file when
        debug & valgrind options are enabled
        for MTR.
[28 May 2010 5:55] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100524190136-egaq7e8zgkwb9aqi) (version source revid:alik@sun.com-20100524190136-egaq7e8zgkwb9aqi) (pib:16)
[28 May 2010 6:24] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100524190941-nuudpx60if25wsvx) (version source revid:alik@sun.com-20100524190409-5w4l7mje1wk1c90l) (merge vers: 6.0.14-alpha) (pib:16)
[28 May 2010 6:52] Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100524185725-c8k5q7v60i5nix3t) (version source revid:alexey.kopytov@sun.com-20100523204118-0tl3goawu658rxh6) (merge vers: 5.5.5-m3) (pib:16)
[2 Jun 2010 8:49] Bugs System
Pushed into 5.1.48 (revid:georgi.kodinov@oracle.com-20100602084411-2yu607bslbmgufl3) (version source revid:sergey.glukhov@sun.com-20100520063103-0cwsyi6bwh88t68f) (merge vers: 5.1.47) (pib:16)
[4 Jun 2010 2:05] Paul Dubois
Noted in 5.1.48, 5.5.5, 6.0.14 changelogs.

DBUG code could in some cirsumstances call FreeState() twice, leading
to a server crash or failure.
[15 Jun 2010 7:40] Sveta Smirnova
See also bug #54478
[15 Jun 2010 9:53] 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/111115

3106 Martin Skold	2010-06-15
      Forward port of patch for bug#52884
      
       3391 Sergey Glukhov    2010-05-20
            Bug#52884 mysql-test-run does not work with --debug option
            Server crashes on 64bit linux with 'double free or corruption'
            message, on 32bit mysql-test-run silently fails on bootstrap
            stage. The problem is that FreeState() is called twice
            for init_settings struct in _db_end_ function.
            The fix is to remove superfluous FreeState() call.
            Additional fix:
            fixed discrepancy of result file when
            debug & valgrind options are enabled
            for MTR.
           @ dbug/dbug.c
              The problem is that FreeState() is called twice
              for init_settings struct in _db_end_ function.
              The fix is to remove superfluous FreeState() call.
           @ mysql-test/r/variables_debug.result
              fixed discrepancy of result file when
              debug & valgrind options are enabled
              for MTR.
           @ mysql-test/t/variables_debug.test
              fixed discrepancy of result file when
              debug & valgrind options are enabled
              for MTR.
           @ sql/set_var.cc
              fixed discrepancy of result file when
              debug & valgrind options are enabled
              for MTR.
      modified:
        dbug/dbug.c
        mysql-test/r/variables_debug.result
        mysql-test/t/variables_debug.test
        sql/set_var.cc
[17 Jun 2010 11:56] Bugs System
Pushed into 5.1.47-ndb-7.0.16 (revid:martin.skold@mysql.com-20100617114014-bva0dy24yyd67697) (version source revid:martin.skold@mysql.com-20100616204905-jxjg342w35ks9vfy) (merge vers: 5.1.47-ndb-7.0.16) (pib:16)
[17 Jun 2010 12:35] Bugs System
Pushed into 5.1.47-ndb-6.2.19 (revid:martin.skold@mysql.com-20100617115448-idrbic6gbki37h1c) (version source revid:martin.skold@mysql.com-20100615095037-53ys3nxoskmtlh0p) (merge vers: 5.1.47-ndb-6.2.19) (pib:16)
[17 Jun 2010 13:22] Bugs System
Pushed into 5.1.47-ndb-6.3.35 (revid:martin.skold@mysql.com-20100617114611-61aqbb52j752y116) (version source revid:martin.skold@mysql.com-20100616120453-jh7wr05z1vf7r8pm) (merge vers: 5.1.47-ndb-6.3.35) (pib:16)
[14 Oct 2010 8:31] Bugs System
Pushed into mysql-5.1-telco-7.0 5.1.51-ndb-7.0.20 (revid:martin.skold@mysql.com-20101014082627-jrmy9xbfbtrebw3c) (version source revid:vasil.dimov@oracle.com-20100513074652-0cvlhgkesgbb2bfh) (merge vers: 5.5.5-m3) (pib:21)
[14 Oct 2010 8:46] Bugs System
Pushed into mysql-5.1-telco-6.3 5.1.51-ndb-6.3.39 (revid:martin.skold@mysql.com-20101014083757-5qo48b86d69zjvzj) (version source revid:vasil.dimov@oracle.com-20100513074652-0cvlhgkesgbb2bfh) (merge vers: 5.5.5-m3) (pib:21)
[14 Oct 2010 9:01] Bugs System
Pushed into mysql-5.1-telco-6.2 5.1.51-ndb-6.2.19 (revid:martin.skold@mysql.com-20101014084420-y54ecj85j5we27oa) (version source revid:vasil.dimov@oracle.com-20100513074652-0cvlhgkesgbb2bfh) (merge vers: 5.5.5-m3) (pib:21)
[14 Oct 2010 14:44] Jon Stephens
Already documented in the 5.1.48 changelog; no new changelog entries required. setting back to Closed state.