Bug #2312 Sequence of Stored Procedure Calls Causes 5.0 to Crash
Submitted: 7 Jan 2004 19:13 Modified: 23 Jan 2004 9:00
Reporter: Mark Matthews Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.0 OS:Linux (Linux)
Assigned to: Per-Erik Martin CPU Architecture:Any

[7 Jan 2004 19:13] Mark Matthews
Description:
While trying to get the JDBC compliance tests to work, I've found that the following sequence of queries (uploaded as mark-cts-queries.sql) on the given database (uploaded as mark-cts-dump.sql), causes mysqld to segfault.

Not sure if the backtrace is correct because it shows mysqld going off into the weeds into GIS functions (where none are used anywhere in this query):

mysqld got signal 11;
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=16384
read_buffer_size=131072
max_used_connections=0
max_connections=100
threads_connected=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 19212 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd=0x86aa7f0
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...
Cannot determine thread, fp=0x41baaf7c, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x815ef7d _Z8clean_upb + 233
0x40167618 _end + 935160488
0x86b20a0 _end + 1185072
0x81999db _Z7openfrmPKcS0_jjjP8st_table + 4317
0x819d4a4 _ZN4JOIN8optimizeEv + 1966
0x8199725 _Z7openfrmPKcS0_jjjP8st_table + 3623
0x8174303 _Z16dispatch_command19enum_server_commandP3THDPcj + 4151
0x824a3e4 _Z26get_all_items_for_categoryP3THDP8st_tableP5FieldP10SQL_SELECTP4ListI6StringE + 268
0x824a22b _Z17search_categoriesP3THDP8st_tableP13st_find_fieldP10SQL_SELECTP4ListI6StringEPs + 257
0x8248792 _ZNK16GMultiLineString15get_data_as_wktEP6String + 160
0x8248f0d _ZNK13GMultiPolygon4areaEPd + 23
0x81779be _Z21mysql_execute_commandP3THD + 12776
0x8179112 _Z21mysql_execute_commandP3THD + 18748
0x81721b3 _Z16check_connectionP3THD + 1423
0x8171ad0 _Z9check_mqhP3THDj + 384
0x8170fbf _Z10check_userP3THD19enum_server_commandPKcjS3_b + 107
0x401622b6 _end + 935139142
0x420de407 _end + 968153239
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://www.mysql.com/doc/en/Using_stack_trace.html and follow instructions on how to resolve the stack trace. Resolved
stack trace is much more helpful in diagnosing the problem, so please do
resolve it
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0x869ca10 = CALL Numeric_Proc(@MAX_PARAM,@MIN_PARAM,@NULL_PARAM)
thd->thread_id=10
The manual page at http://www.mysql.com/doc/en/Crashing.html contains
information that should help you find out what is causing the crash.

How to repeat:
Create the database 'cts' using the uploaded dump file. Run the uploaded query script.
[23 Jan 2004 8:51] Mark Matthews
File that recreates the database (without SPs)

Attachment: mark-cts-dump.sql (text/plain), 19.12 KiB.

[23 Jan 2004 9:00] Per-Erik Martin
This seems to work in the current source version.