Bug #53028 mysqld got signal 7
Submitted: 21 Apr 2010 15:49 Modified: 6 Jun 2010 21:39
Reporter: R M Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.1.42ce OS:Linux
Assigned to: CPU Architecture:Any
Tags: mysqld got signal 7 crash

[21 Apr 2010 15:49] R M
Description:
When user runs the below query the mysql server crashes everytime
=================================================================
select gateway_funct as Policy, if(left(user,3)="CN=",right(substring_index(user,",",1),length(substring_index(user,",",1))-3),user)  as 'User', `Last Accessed`
from(
Select concat_ws(".",orig_addr_oct1,orig_addr_oct2,orig_addr_oct3,orig_addr_oct4) as Gateway,  `user` as 'User', max(datetime) as'Last Accessed'
FROM fwlogger_mrg  where user <>'' and datetime between '2010-04-01 00:00' and '2010-04-18 23:59'
group by concat_ws(".",orig_addr_oct1,orig_addr_oct2,orig_addr_oct3,orig_addr_oct4),user) raw
left join gateway on concat_ws(".",gateway_oct1, gateway_oct2, gateway_oct3,gateway_oct4)=Gateway
where gateway_funct = 'VPN'
order by  'Last Accessed' desc
limit 65000

mysql version:
==============
5.1.42-community 

os arch
=======
Linux <hostname excluded> 2.6.18-128.7.1.el5 #1 SMP Mon Aug 24 08:21:56 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

mysql error log
===============
100420 14:48:13 [Note] Event Scheduler: Purging the queue. 0 events
100420 14:48:13  InnoDB: Starting shutdown...
100420 14:48:14  InnoDB: Shutdown completed; log sequence number 0 46429
100420 14:48:14 [Note] /usr/sbin/mysqld: Shutdown complete

100420 14:48:14 mysqld_safe mysqld from pid file /sql/mysql//<host name excluded>.pid ended
100420 14:48:15 mysqld_safe Starting mysqld daemon with databases from /sql/mysql/
100420 14:48:15 [Note] Plugin 'FEDERATED' is disabled.
100420 14:48:15  InnoDB: Started; log sequence number 0 46429
100420 14:48:15 [Note] Event Scheduler: Loaded 0 events
100420 14:48:15 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.42-community'  socket: '/sql/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL)
100420 18:47:11 - mysqld got signal 7 ;
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=134217728
read_buffer_size=209715200
max_used_connections=5
max_threads=200
threads_connected=2
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 123013104 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0xf161990
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 = 0x4561bf20 thread_stack 0x40000
/usr/sbin/mysqld(my_print_stacktrace+0x2e)[0x84bfde]
/usr/sbin/mysqld(handle_segfault+0x322)[0x5c0782]
/lib64/libpthread.so.0[0x2acb93f184c0]
/usr/sbin/mysqld[0x810ec1]
/usr/sbin/mysqld(_mi_pack_rec_unpack+0x61)[0x811621]
/usr/sbin/mysqld[0x811842]
/usr/sbin/mysqld(myrg_rrnd+0x117)[0x835d57]
/usr/sbin/mysqld(_ZN12ha_myisammrg8rnd_nextEPh+0x34)[0x8336f4]
/usr/sbin/mysqld(_Z13rr_sequentialP11READ_RECORD+0x2d)[0x6948cd]
/usr/sbin/mysqld(_Z10sub_selectP4JOINP13st_join_tableb+0x56)[0x62adc6]
/usr/sbin/mysqld[0x62b19a]
/usr/sbin/mysqld(_ZN4JOIN4execEv+0x4ff)[0x63703f]
/usr/sbin/mysqld(_Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x16e)[0x638efe]
/usr/sbin/mysqld(_Z21mysql_derived_fillingP3THDP6st_lexP10TABLE_LIST+0x117)[0x6e8ac7]
/usr/sbin/mysqld(_Z20mysql_handle_derivedP6st_lexPFbP3THDS0_P10TABLE_LISTE+0x68)[0x6e85b8]
/usr/sbin/mysqld(_Z28open_and_lock_tables_derivedP3THDP10TABLE_LISTb+0xd2)[0x60e822]
/usr/sbin/mysqld[0x5cb092]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x4c1)[0x5cdab1]
/usr/sbin/mysqld(_Z11mysql_parseP3THDPKcjPS2_+0x1fa)[0x5d2faa]
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x101b)[0x5d3fdb]
/usr/sbin/mysqld(_Z10do_commandP3THD+0xe4)[0x5d4584]
/usr/sbin/mysqld(handle_one_connection+0x6f0)[0x5c7730]
/lib64/libpthread.so.0[0x2acb93f10367]
/lib64/libc.so.6(clone+0x6d)[0x2acb94ad009d]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0xf364e10 = Select gateway_funct as Policy, if(left(user,3)="CN=",right(substring_index(user,",",1),length(substring_index(user,",",1))-3),user)  as 'User', `Last Accessed`
from(
Select concat_ws(".",orig_addr_oct1,orig_addr_oct2,orig_addr_oct3,orig_addr_oct4) as Gateway,  `user` as 'User', max(datetime) as'Last Accessed'
FROM fwlogger_mrg  where user <>'' and datetime between '2010-04-01 00:00' and '2010-04-18 23:59'
group by concat_ws(".",orig_addr_oct1,orig_addr_oct2,orig_addr_oct3,orig_addr_oct4),user) raw
left join gateway on concat_ws(".",gateway_oct1, gateway_oct2, gateway_oct3,gateway_oct4)=Gateway
where gateway_funct = 'VPN'
order by  'Last Accessed' desc
limit 65000
thd->thread_id=2
thd->killed=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.
100420 18:47:13 mysqld_safe Number of processes running now: 0
100420 18:47:13 mysqld_safe mysqld restarted
100420 18:47:13 [Note] Plugin 'FEDERATED' is disabled.
100420 18:47:14  InnoDB: Started; log sequence number 0 46429
100420 18:47:14 [Note] Event Scheduler: Loaded 0 events
100420 18:47:14 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.42-community'  socket: '/sql/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL)

STEPS TAKEN TO RESOLVE
======================
1. Upgraded from 5.1.38 to 5.1.42 (same results for both versions).
2. Doubled the following params values:
| interactive_timeout        | 57600 |
| wait_timeout               | 57600 |

How to repeat:
Run above query.
[21 Apr 2010 20:59] Sveta Smirnova
Thank you for the report.

Please send us output of SHOW CREATE TABLE  fwlogger_mrg and SHOW TABLE STATUS LIKE ' fwlogger_mrg'
[21 Apr 2010 21:18] R M
Table DDL and table status.

Attachment: table_ddl_status.txt (text/plain), 10.11 KiB.

[21 Apr 2010 21:22] R M
Table DDL and table status.

Attachment: bug-data-53028.txt (text/plain), 10.11 KiB.

[21 Apr 2010 21:26] R M
Ive attached a file(bug-data-53028.txt) which includes the tbl DDL and tbl status of (fwlogger_mrg).
[24 Apr 2010 9:32] Sveta Smirnova
Thank you for the feedback.

Please also send output of SHOW CREATE TABLE gateway and SHOW TABLE STATUS LIKE 'gateway'
[26 Apr 2010 12:18] R M
Create table and status of gateway tbl.

Attachment: bug-data-53028_gateway.txt (text/plain), 2.42 KiB.

[5 May 2010 14:43] R M
Where are we with this?
[6 May 2010 17:58] Sveta Smirnova
Thank you for the update.

We are still testing.
[6 May 2010 21:39] Sveta Smirnova
Just finished testing.

I could not repeat crash with latest development version of server. Could you please try current version 5.1.46 in your environment to verify if this is solved?
[6 Jun 2010 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".