Bug #20211 Doing continous select from slow_log causes MySQLD to core
Submitted: 1 Jun 2006 19:04 Modified: 22 Jun 2006 19:32
Reporter: Jonathan Miller Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Logging Severity:S1 (Critical)
Version:5.1.12 OS:Linux (Linux 32 Bit OS)
Assigned to: Assigned Account

[1 Jun 2006 19:04] Jonathan Miller
Description:
Hi,
Was working with DBT2 on cluster to day. Tomas and I where both using the slow_log to figure out issues. Twice when we were both accessing the slow_log at the same time we got the "Lost Connection" message.

Stack Trace is:
0x81eeacc handle_segfault + 438
0x4af420 (?)
0xcda1 (?)
0x82b96a9 _Z13rr_sequentialP14st_read_record + 115
0x8251b97 _Z10sub_selectP4JOINP13st_join_tableb + 333
0x8251e9c _Z9do_selectP4JOINP4ListI4ItemEP8st_tableP9Procedure + 668
0x8261ed5 _ZN4JOIN4execEv + 6235
0x8262151 _Z12mysql_selectP3THDPPP4ItemP13st_table_listjR4ListIS1_ES2_jP8st_orderSB_S2_SB_mP13select_resultP18st_select_lex_unitP13st_sel + 561
0x82623ac _Z13handle_selectP3THDP6st_lexP13select_resultm + 352
0x8207e4e _Z21mysql_execute_commandP3THD + 1880
0x820f767 _Z11mysql_parseP3THDPcj + 535
0x821004a _Z16dispatch_command19enum_server_commandP3THDPcj + 1996
0x821118c _Z10do_commandP3THD + 260
0x8211543 handle_one_connection + 725
0x640bd4 (?)
0x5984fe (?)

Back Trace:
#0  0x004af402 in __kernel_vsyscall ()
(gdb) bt
#0  0x004af402 in __kernel_vsyscall ()
#1  0x0064364f in pthread_kill () from /lib/libpthread.so.0
#2  0x0833cb67 in write_core ()
#3  0x081eebbc in handle_segfault ()
#4  <signal handler called>
#5  0x0836be71 in find_eoln ()
#6  0x0836c61e in ha_tina::find_current_row ()
#7  0x0836cf60 in ha_tina::rnd_next ()
#8  0x082b96a9 in rr_sequential ()
#9  0x08251b97 in sub_select ()
#10 0x08251e9c in do_select ()
#11 0x08261ed5 in JOIN::exec ()
#12 0x08262151 in mysql_select ()
#13 0x082623ac in handle_select ()
#14 0x08207e4e in mysql_execute_command ()
#15 0x0820f767 in mysql_parse ()
#16 0x0821004a in dispatch_command ()
#17 0x0821118c in do_command ()
#18 0x08211543 in handle_one_connection ()
#19 0x00640bd4 in start_thread () from /lib/libpthread.so.0
#20 0x005984fe in clone () from /lib/libc.so.6
(gdb) quit

I just did a pull and build from 5.1-new today, so it is the latest code.

I will add more information later.

How to repeat:
Setup dbt2 database. Start dbt2 testing. Have 2 users accessing the slow_log at the same time.
[1 Jun 2006 19:53] Jonathan Miller
Another was to produce this is just to keep doing selects one after another while the database is being updated with slow_logs

mysql> select * from slow_log;
ERROR 2013 (HY000): Lost connection to MySQL server during query
[22 Jun 2006 19:32] Petr Chardin
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the original bug instead.

Thank you for your interest in MySQL.

Additional info:

This is a duplicate of the bug Bug #17589  	select count(*) from general_log; with file size of 27GB results in core. The fix was merged to the mainstream tree a week ago.