Bug #63035 Segmentation fault error in Item_field::fix_fields
Submitted: 31 Oct 2011 11:34 Modified: 31 Oct 2011 14:39
Reporter: Oleg Efimov Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.5.15 OS:Linux (CentOS / 2.6.18-238.19.1.el5 / x86_64)
Assigned to: CPU Architecture:Any
Tags: crash, join, segfault, SELECT

[31 Oct 2011 11:34] Oleg Efimov
Description:
Our MySQL server had been crashed 2 times at last month with error log:
111030  7:38:02 - 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=2147483648
read_buffer_size=134217728
max_used_connections=302
max_threads=1500
thread_count=66
connection_count=66
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 395330191 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x2064bcd0
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...
stack_bottom = 0x5b8080f0 thread_stack 0x40000
/usr/local/mysql/bin/mysqld(my_print_stacktrace+0x33)[0x764883]
/usr/local/mysql/bin/mysqld(handle_segfault+0x36e)[0x4ee18e]
/lib64/libpthread.so.0[0x325980eb10]
/usr/local/mysql/bin/mysqld(_ZN10Item_field10fix_fieldsEP3THDPP4Item+0x2c5)[0x663a05]
/usr/local/mysql/bin/mysqld(_Z12setup_fieldsP3THDPP4ItemR4ListIS1_E17enum_mark_columnsPS5_b+0x14c)[0x5219cc]
/usr/local/mysql/bin/mysqld(_ZN4JOIN7prepareEPPP4ItemP10TABLE_LISTjS1_jP8st_orderS7_S1_S7_P13st_select_lexP18st_select_lex_unit+0x2d5)[0x581735]
/usr/local/mysql/bin/mysqld(_Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x70d)[0x59385d]
/usr/local/mysql/bin/mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x16f)[0x593bff]
/usr/local/mysql/bin/mysqld[0x5583b0]
/usr/local/mysql/bin/mysqld(_Z21mysql_execute_commandP3THD+0x3cf3)[0x55c603]
/usr/local/mysql/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0xfe)[0x55e71e]
/usr/local/mysql/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x1353)[0x55fad3]
/usr/local/mysql/bin/mysqld(_Z10do_commandP3THD+0xc2)[0x55fe02]
/usr/local/mysql/bin/mysqld(_Z24do_handle_one_connectionP3THD+0xf2)[0x5eac82]
/usr/local/mysql/bin/mysqld(handle_one_connection+0x4a)[0x5ead5a]
/lib64/libpthread.so.0[0x325980673d]
/lib64/libc.so.6(clone+0x6d)[0x32590d44bd]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x2aab49031380): is an invalid pointer
Connection ID (thread ID): 731180926
Status: NOT_KILLED

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
pure virtual method called
pure virtual method called
pure virtual method called
pure virtual method called
pure virtual method called
pure virtual method called
pure virtual method called
pure virtual method called
pure virtual method called
pure virtual method called
pure virtual method called
pure virtual method called
pure virtual method called
111030 07:38:02 mysqld_safe mysqld from pid file /tmp/mysql2.pid ended

Resolved stack trace:

0x764883 my_print_stacktrace + 51
0x4ee18e handle_segfault + 878
0x325980eb10 _end + 1485641304
0x663a05 Item_field::fix_fields(THD*, Item**) + 709
0x5219cc setup_fields(THD*, Item**, List<Item>&, enum_mark_columns, List<Item>*, bool) + 332
0x581735 JOIN::prepare(Item***, TABLE_LIST*, unsigned int, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, st_select_lex*,  + 725
0x59385d mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order* + 1805
0x593bff handle_select(THD*, LEX*, select_result*, unsigned long) + 367
0x5583b0 execute_sqlcom_select(THD*, TABLE_LIST*) + 192
0x55c603 mysql_execute_command(THD*) + 15603
0x55e71e mysql_parse(THD*, char*, unsigned int, Parser_state*) + 254
0x55fad3 dispatch_command(enum_server_command, THD*, char*, unsigned int) + 4947
0x55fe02 do_command(THD*) + 194
0x5eac82 do_handle_one_connection(THD*) + 242
0x5ead5a handle_one_connection + 74
0x325980673d _end + 1485607557
0x32590d44bd _end + 1478062085

How to repeat:
I can't provide clear way to reproduce this bug. Both times it hangs on day peak, but on Sunday, when our service traffic is not maximum.

Server operates 15 databases with 10-30 MyISAM tables with 5-15Gb data in each database.
[31 Oct 2011 13:13] Valeriy Kravchuk
Looks like a duplicate of bug #60279. Please, check.
[31 Oct 2011 13:53] Oleg Efimov
Yep, they are very similar. I think you can mark this report a duplicate of #60279. I'll subscribe for original report for updates. Thanks for your help, Valeriy!
[31 Oct 2011 14:39] Valeriy Kravchuk
This is a duplicate of bug #60279.