Bug #20260 mysqld crash on SELECT... LEFT JOIN... query
Submitted: 4 Jun 2006 19:06 Modified: 7 Jun 2006 21:52
Reporter: Vladimir Petrov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.22 OS:Linux (RHEL)
Assigned to: Sveta Smirnova CPU Architecture:Any

[4 Jun 2006 19:06] Vladimir Petrov
Description:
Hello!

I got such messages in error log:
----------------------------------------------------------------
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=268435456

read_buffer_size=131072

max_used_connections=12

max_connections=300

threads_connected=4

It is possible that mysqld could use up to 

key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 914941 K

bytes of memory

Hope that's ok; if not, decrease some variables in the equation.

thd=0xa6b6ecf0

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=0x8669f4, backtrace may not be correct.

Stack range sanity check OK, backtrace follows:

0x8177184

0xa2d888

0x820f51d

0x820f51d

0x820f1d5

0x821410c

0x81c8f8e

0x81d02a5

0x81d61c9

0x81d688f

0x818cf6f

0x81935e3

0x8193d9f

0x8194b72

0x81955dc

0xa27371

0x9929be

New value of fp=(nil) failed sanity check, terminating stack trace!

Please read http://dev.mysql.com/doc/mysql/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 0x8fc5070 = SELECT forum.forumid

                        FROM VB_forum AS forum

                        LEFT JOIN VB_forumread AS forumread ON (forum.forumid = forumread.forumid
AND forumread.userid = 149)

                        WHERE forum.forumid IN (20,14,-1)

                                AND forum.forumid NOT IN (20, -1)

                                AND (forum.lastpost = 0 OR

                                        IF(forumread.readtime IS NULL, 1148545013,
forumread.readtime) > forum.lastpost

                                )

thd->thread_id=2952

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.

Number of processes running now: 0

060604 08:16:53  mysqld restarted
----------------------------------------------------------------

OS - RHEL 4.0 
MySQL-server-standard-5.0.22-0.rhel4 from official rpm.
Server hardware is OK. No other errors in the log.

How to repeat:
This querry used in vBulletin v.3.5.3
[5 Jun 2006 8:02] Sveta Smirnova
Thank you for a problem report. Could you please provide output of SHOW CREATE TABLE VB_forum; and SHOW CREATE TABLE VB_forumread;?
[5 Jun 2006 9:37] Vladimir Petrov
SHOW CREATE TABLE VB_forum;
+----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table    | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
+----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| VB_forum | CREATE TABLE `VB_forum` (
  `forumid` smallint(5) unsigned NOT NULL auto_increment,
  `styleid` smallint(5) unsigned NOT NULL default '0',
  `title` varchar(100) NOT NULL default '',
  `title_clean` varchar(100) NOT NULL default '',
  `description` text,
  `description_clean` text,
  `options` int(10) unsigned NOT NULL default '0',
  `displayorder` smallint(6) NOT NULL default '0',
  `replycount` int(10) unsigned NOT NULL default '0',
  `lastpost` int(11) NOT NULL default '0',
  `lastposter` varchar(100) NOT NULL default '',
  `lastthread` varchar(250) NOT NULL default '',
  `lastthreadid` int(10) unsigned NOT NULL default '0',
  `lasticonid` smallint(6) NOT NULL default '0',
  `threadcount` mediumint(8) unsigned NOT NULL default '0',
  `daysprune` smallint(6) NOT NULL default '0',
  `newpostemail` varchar(250) NOT NULL default '',
  `newthreademail` varchar(250) NOT NULL default '',
  `parentid` smallint(6) NOT NULL default '0',
  `parentlist` varchar(250) NOT NULL default '',
  `password` varchar(50) NOT NULL default '',
  `link` varchar(200) NOT NULL default '',
  `childlist` varchar(250) NOT NULL default '',
  PRIMARY KEY  (`forumid`)
) ENGINE=MyISAM DEFAULT CHARSET=cp1251 | 
+----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

SHOW CREATE TABLE VB_forumread; 
+--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table        | Create Table                                                                                                                                                                                                                                                                                         |
+--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| VB_forumread | CREATE TABLE `VB_forumread` (
  `userid` int(10) unsigned NOT NULL default '0',
  `forumid` smallint(5) unsigned NOT NULL default '0',
  `readtime` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`forumid`,`userid`),
  KEY `readtime` (`readtime`)
) ENGINE=MyISAM DEFAULT CHARSET=cp1251 | 
+--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
[7 Jun 2006 22:04] Sveta Smirnova
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html
[7 Jun 2006 22:44] Sveta Smirnova
I recreated crash in released version. Also I test against the last 5.0.23 sources and the bug does'nt exist there. Thank you for the help.