Bug #15871 Running ./mysql-test-run --debug t/ps_2myisam.test causes crash
Submitted: 19 Dec 2005 22:49 Modified: 3 Jul 2006 1:40
Reporter: Sergey Petrunya Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.1-bk, -debug-max OS:Linux (Linux, x86)
Assigned to: Sergey Petrunya

[19 Dec 2005 22:49] Sergey Petrunya
Description:
Running 

./mysql-test-run --debug t/ps_2myisam.test 

causes the server to crash during the test.

The crash happens for 5.1 tree compiled with compile-pentium-debug-max, -O0 optimization.

I've tried it with recent 5.1, tip cset 
ChangeSet@1.1967, 2005-12-19 17:00:53+01:00, kent@mysql.com
and with older 5.1, tip cset
ChangeSet@1.1955, 2005-12-05 18:09:42-08:00, jimw@mysql.com

The crash doesn't happen without --debug, but I suspect this bug could be the cause of bogus failures one gets after adding another function to class Item.

How to repeat:
Get 5.1, compile with compile-pentium-debug-max (-O1 replaced with -O0, dont know if this is required).
Then run 
$ ./mysql-test-run --debug t/ps_2myisam.test 
ps_2myisam                     [ fail ]

Errors are (from /home/psergey/mysql-5.1-ppruning-merge/mysql-test/var/log/mysqltest-time) :
mysqltest: In included file "./include/ps_query.inc": At line 153: query 'execute stmt1 using @arg00, @arg01 ' failed: 2013: Lost connection to MySQL server during query
Maximum memory usage: 243016 bytes (238k)
(the last lines may be the most important ones)

Stack trace:
Program received signal SIGSEGV, Segmentation fault.
0x081662c5 in Item_param::query_val_str (this=0x922b5f8, str=0xb5f34210)
    at item.cc:2656
2656          if (value.cs_info.character_set_client->escape_with_backslash_is_dangerous)
(gdb) wher 
#0  0x081662c5 in Item_param::query_val_str (this=0x922b5f8, str=0xb5f34210)
    at item.cc:2656
#1  0x08166922 in Item_param::print (this=0x922b5f8, str=0xb5f34310)
    at item.cc:2800
#2  0x08182d7d in Item_func::print_op (this=0x922ba20, str=0xb5f34310)
    at item_func.cc:342
#3  0x081a1318 in Item_bool_func2::print (this=0x922ba20, str=0xb5f34310)
    at item_cmpfunc.h:209
#4  0x0819d98b in Item_cond::print (this=0x921e938, str=0xb5f34310)
    at item_cmpfunc.cc:2718
#5  0x08289cdd in print_where (cond=0x921e938, info=0x86e89ba "original")
    at sql_test.cc:58
#6  0x0826048c in optimize_cond (join=0x921ea20, conds=0x921e938, 
    join_list=0x921ab30, cond_value=0x921f754) at sql_select.cc:7778
#7  0x0824ede8 in JOIN::optimize (this=0x921ea20) at sql_select.cc:619
#8  0x08253148 in mysql_select (thd=0x91eee78, rref_pointer_array=0x921ab7c,
[20 Dec 2005 18:09] Miguel Solorzano
I was unable to repeat:

Loading Standard Test Databases
Starting Tests

TEST                            RESULT
-------------------------------------------------------
ps_2myisam                     [ pass ]   
-------------------------------------------------------

Ending Tests
Shutting-down MySQL daemon
[21 Dec 2005 8:47] 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/313
[27 Apr 2006 13:29] Magnus BlÄudd
Looks ok to me.
[3 Jul 2006 1:40] Sergey Petrunya
Not repeatable anymore in 5.0.12