Bug #31960 All "embedded" tests crash
Submitted: 30 Oct 2007 16:25 Modified: 11 Jan 2008 16:20
Reporter: Joerg Bruehe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Embedded Library ( libmysqld ) Severity:S1 (Critical)
Version:6.0.4-alpha OS:Linux
Assigned to: Alexey Botchkov CPU Architecture:Any

[30 Oct 2007 16:25] Joerg Bruehe
Description:
Running
  MTR_BUILD_THREAD=auto ./mysql-test-run.pl --comment=embedded --timer --embedded-server --skip-rpl --skip-ndbcluster       

All tests crash like this:

=====
main.1st                       [ fail ]

ERROR: mysqltest returned unexpected code 139, it has probably crashed

Aborting: main.1st failed in embedded mode.
To continue, re-run with '--force'.
=====

Debugger backtrace:
(gdb) where
#0  0x08234fa4 in emb_read_query_result (mysql=0x8a49d00) at lib_sql.cc:234
#1  0x081dc6b4 in mysql_read_query_result (mysql=0x8a49d00) at libmysql.c:5271
#2  0x081b294a in run_query_normal (cn=0x8a49d00, command=0x8aa4098, flags=3, query=0x8f57180 "show databases",
    query_len=14, ds=0x8a6af00, ds_warnings=0xbfffc3e0) at mysqltest.c:5809
#3  0x081b32b1 in run_query (cn=0x8a49d00, command=0x8aa4098, flags=3) at mysqltest.c:6468
#4  0x081b531d in main (argc=145005824, argv=0xbfffcd44) at mysqltest.c:6982
Current language:  auto; currently c++
(gdb)               

How to repeat:
Run embedded tests.

Suggested fix:
I will add a target "test-embedded" to the top-level Makefile to make testing the embedded server easier, and IMO we should make that part of the standard tests run after every change.

To prevent issues like this from creeping into 5.1, I will add it from 5.1 up.
[30 Oct 2007 19:35] Joerg Bruehe
A Makefile change to allow

   make test-embedded

is pushed into the build team trees for 5.1.23 and 6.0.4,
I expect it to be merged to the main trees quite soon.
[31 Oct 2007 15:26] Joerg Bruehe
Identical failure symptoms on
- SuSE 9.3   (gcc 3.3.5) on x86,
- Debian 3.1 (gcc 4.1.2) on PowerPC.

Stack backtrace on PPC is the same (function, line#, command) as for x86 (above).
[8 Nov 2007 7:09] 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/37306

ChangeSet@1.2625, 2007-11-08 10:04:33+04:00, holyfoot@mysql.com +2 -0
  Bug #31960 All embedded test crash
  
  Crash happens as a result of NO_EMBEDDED_ACCESS_CHECKS option
  (which is default for embedded server).
  check_table_access failed on using unintialized structure.
  Better solutions here is to disable that code completely in this case.
  Though the crash happens only in 6.0 i belive it's good to do it in 5.1
[13 Nov 2007 8: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/37635

ChangeSet@1.2625, 2007-11-13 12:10:22+04:00, holyfoot@mysql.com +2 -0
  Bug #31960 All embedded test crash
  
  Crash happens as a result of NO_EMBEDDED_ACCESS_CHECKS option
  (which is default for embedded server).
  check_table_access failed on using unintialized structure.
  Better solutions here is to disable that code completely in this case.
  Though the crash happens only in 6.0 i belive it's good to do it in 5.1
[14 Dec 2007 8:18] Bugs System
Pushed into 5.1.23-rc
[14 Dec 2007 8:22] Bugs System
Pushed into 6.0.5-alpha
[11 Jan 2008 16:20] Paul DuBois
Noted in 5.1.23, 6.0.5 changelogs.

Grant table checks failed in libmysqld.