Bug #47304 Test main.mdl_sync fails on embedded server
Submitted: 14 Sep 2009 9:38 Modified: 6 Mar 2010 23:58
Reporter: Ingo Strüwing Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Locking Severity:S2 (Serious)
Version:5.4.4 OS:Linux (x86_64)
Assigned to: Jon Olav Hauglid CPU Architecture:Any
Tags: disabled, pbfail, pushbuild, sporadic, test failure

[14 Sep 2009 9:38] Ingo Strüwing
Description:
main.mdl_sync [ fail ]
        Test ended at 2009-09-12 13:55:36

CURRENT_TEST: main.mdl_sync
Got error 22 when trying to lock mutex mysys_var->mutex at sql_show.cc, line 1892
mysqltest got signal 6
read_command_buf at 0x16bb520 = let $success= `$wait_condition`
conn->name at 0x1ff0ba18 = 
conn->cur_query at 0x2006afdd = show fields from t2;
Attempting backtrace...
stack_bottom = (nil) thread_stack 0x40000
/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/libmysqld/examples/mysqltest_embedded(my_print_stacktrace+0x44) [0x5f78e1]
/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/libmysqld/examples/mysqltest_embedded [0x5b51bb]
/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/libmysqld/examples/mysqltest_embedded [0x5b521d]
/lib64/libpthread.so.0 [0x36e2e0de70]
/lib64/libc.so.6(gsignal+0x35) [0x36e2230155]
/lib64/libc.so.6(abort+0x110) [0x36e2231bf0]
/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/libmysqld/examples/mysqltest_embedded(safe_mutex_lock+0x37d) [0x5f8f1b]
/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/libmysqld/examples/mysqltest_embedded(fill_schema_processlist(THD*, TABLE_LIST*, Item*)+0x77c) [0x893248]
/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/libmysqld/examples/mysqltest_embedded(get_schema_tables_result(JOIN*, enum_schema_table_state)+0x4ce) [0x87da62]
/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/libmysqld/examples/mysqltest_embedded(JOIN::exec()+0xada) [0x86768e]
/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/libmysqld/examples/mysqltest_embedded(mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*)+0x529) [0x8615db]
/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/libmysqld/examples/mysqltest_embedded(handle_select(THD*, LEX*, select_result*, unsigned long)+0x2b0) [0x86acc0]
/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/libmysqld/examples/mysqltest_embedded [0x7d7121]
/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/libmysqld/examples/mysqltest_embedded(mysql_execute_command(THD*)+0xada) [0x7d8732]
/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/libmysqld/examples/mysqltest_embedded(mysql_parse(THD*, char const*, unsigned int, char const**)+0x369) [0x7e2ffd]
/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/libmysqld/examples/mysqltest_embedded(dispatch_command(enum_server_command, THD*, char*, unsigned int)+0xf5c) [0x7e4ebc]
/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/libmysqld/examples/mysqltest_embedded [0x6a1218]
/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/libmysqld/examples/mysqltest_embedded(mysql_send_query+0xb3) [0x636764]
/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/libmysqld/examples/mysqltest_embedded(mysql_real_query+0xed) [0x63686a]
/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/libmysqld/examples/mysqltest_embedded(var_query_set(VAR*, char const*, char const**)+0x239) [0x5ca417]
/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/libmysqld/examples/mysqltest_embedded(eval_expr(VAR*, char const*, char const**)+0x226) [0x5c97aa]
/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/libmysqld/examples/mysqltest_embedded(var_set(char const*, char const*, char const*, char const*)+0x20f) [0x5ca9bd]
/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/libmysqld/examples/mysqltest_embedded(do_let(st_command*)+0x2ea) [0x5caef2]
/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/libmysqld/examples/mysqltest_embedded(main+0x1363) [0x5cff11]
/lib64/libc.so.6(__libc_start_main+0xf4) [0x36e221d8b4]
/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/libmysqld/examples/mysqltest_embedded [0x5b0ac9]
Writing a core file...

 - saving '/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/mysql-test/var/log/main.mdl_sync/' to '/export/home4/pb2/build/sb_3-None-1252712107.73/mysql-pe-gcov/mysql-test/var/log/main.mdl_sync/'

How to repeat:
http://pb2.norway.sun.com/web.py?template=mysql_show_test_failure&test_failure_id=2315387&...
[14 Sep 2009 9:53] Ingo Strüwing
Critical defect - crashes application with embedded serevr.
No workaround known.
Widespread impact - lets many test runs fail.
[25 Sep 2009 13:19] Alexander Nozdrin
On the second thought: disable the test case for embedded server.
[28 Sep 2009 16:34] 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/84899

3624 Jon Olav Hauglid	2009-09-28
      Bug #47304 Test main.mdl_sync fails on embedded server
      
      The problem was that SHOW PROCESSLIST was trying to access
      a thread that was not properly running and therefore had an 
      uninitialized mutex.
      
      This patch explicitly resets thd->mysys_var after each embedded
      server command to prevent the mutex from being accessed in an
      illegal state.
      
      The patch also re-enables lock_multi.test and mdl_sync.test for 
      embedded server as they had been disabled because of this bug.
[29 Sep 2009 7:35] Jon Olav Hauglid
Pushed to mysql-6.0-codebase-bugfixing (version 6.0.14-alpha)
[9 Oct 2009 8:47] Bugs System
Pushed into 6.0.14-alpha (revid:alik@ibmvm-20091009083208-0o0f0i9w1sq3c1kn) (version source revid:jon.hauglid@sun.com-20090928163426-2lg1gofzz44xzzxf) (merge vers: 6.0.14-alpha) (pib:12)
[14 Oct 2009 15:40] Paul DuBois
Noted in 6.0.14 changelog.

Selecting from the process list in the embedded server caused a
crash.
[10 Nov 2009 14: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/89959

2914 Davi Arnaut	2009-11-10
      Backport of Bug#47304 to mysql-next-mr
      ------------------------------------------------------------
      revno: 3624
      revision-id: jon.hauglid@sun.com-20090928163426-2lg1gofzz44xzzxf
      parent: alik@sun.com-20090928050057-r0a62x9czr01q7oe
      committer: Jon Olav Hauglid <jon.hauglid@sun.com>
      branch nick: mysql-6.0-codebase-bugfixing-bug47304
      timestamp: Mon 2009-09-28 18:34:26 +0200
      message:
        Bug #47304 Test main.mdl_sync fails on embedded server
        
        The problem was that SHOW PROCESSLIST was trying to access
        a thread that was not properly running and therefore had an 
        uninitialized mutex.
        
        This patch explicitly resets thd->mysys_var after each embedded
        server command to prevent the mutex from being accessed in an
        illegal state.
        
        The patch also re-enables lock_multi.test and mdl_sync.test for 
        embedded server as they had been disabled because of this bug.
[10 Nov 2009 18:03] Davi Arnaut
Queued to mysql-next-mr-runtime
[20 Nov 2009 12:53] Bugs System
Pushed into 5.6.0-beta (revid:davi.arnaut@sun.com-20091119234808-xbjpkwaxjt5x5c0b) (version source revid:sp1r-davi@mysql.com/endora.local-20080418131946-26951) (merge vers: 6.0.6-alpha) (pib:13)
[20 Nov 2009 12:56] Bugs System
Pushed into 6.0.14-alpha (revid:kostja@sun.com-20091120124947-yi6h2jbgw0kbciwm) (version source revid:sp1r-davi@mysql.com/endora.local-20080418131946-26951) (merge vers: 6.0.6-alpha) (pib:13)
[20 Nov 2009 20:17] Paul DuBois
Noted in 5.6.0 changelog.

Already fixed in 6.0.x.
[6 Mar 2010 10:52] Bugs System
Pushed into 5.5.3-m3 (revid:alik@sun.com-20100306103849-hha31z2enhh7jwt3) (version source revid:sp1r-davi@mysql.com/endora.local-20080418131946-26951) (merge vers: 6.0.6-alpha) (pib:16)
[6 Mar 2010 23:58] Paul DuBois
Move 5.6.0 changelog entry to 5.5.3.