Bug #72557 Prefixed wildcard search causes MySQL to crash (assertion error in fts0que.cc)
Submitted: 7 May 2014 7:45 Modified: 8 Jun 2014 12:30
Reporter: Benjamin Wilher Email Updates:
Status: No Feedback Impact on me:
Category:MySQL Server: FULLTEXT search Severity:S2 (Serious)
Version:5.6.10 OS:Linux (linux-glibc2.5-x86_64)
Assigned to: CPU Architecture:Any

[7 May 2014 7:45] Benjamin Wilher
I got a fairly big table (~25,000,000 rows, 4.0GB, index size 1.3GB) with a FULLTEXT-indexed data column. The table gets updated several times a day. The indexed data column contains a compound string of several terms (text and numbers)
Since a couple of days the mysql server occationally crashes and restarts with the following error log output:

------------------ error.log ----------------------------------------------------------

2014-05-06 10:02:23 7f8a1d4a1700  InnoDB: Assertion failure in thread 140231173609216 in file fts0que.cc line 3142
InnoDB: Failing assertion: ret == 0
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
08:02:23 UTC - mysqld got signal 6 ;
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.

It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 2710731 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x32aacec0
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 = 7f8a1d4a0e10 thread_stack 0x40000

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f89e8004c30): is an invalid pointer
Connection ID (thread ID): 7

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.
140506 10:02:23 mysqld_safe Number of processes running now: 0
140506 10:02:23 mysqld_safe mysqld restarted


How to repeat:
We could identify the query which caused the problem:

SELECT entry_id FROM entrysearchindex WHERE MATCH(entry_content) AGAINST('+100*' IN BOOLEAN MODE)

The table structure used:

CREATE TABLE `entrysearchindex` (
	`entry_id` INT(11) UNSIGNED NOT NULL,
	`entry_content` TEXT NOT NULL,
	PRIMARY KEY (`entry_id`),
	INDEX `ix_lastsynced` (`entry_lastsynced`),
	FULLTEXT INDEX `ft_content` (`entry_content`),
[7 May 2014 10:22] Benjamin Wilher
Another crash was caused by this WHERE expression 'MATCH(entry_content) AGAINST('an' IN BOOLEAN MODE)'
[7 May 2014 14:45] MySQL Verification Team
Please check against 5.6.17 version. Thanks.
[8 May 2014 8:24] Benjamin Wilher
5.6.17 required me to rebuild the index, because of a bug which is not solved until 5.6.19.

But we've rebuilt the index anyway (using the same version 5.6.10). Now the server doesn't crash anymore. This proves, that the index was broken in some way. The strange thing is, that we have two exactly identical setups on two servers, which are not connected to each other. The first crashed on 3rd May, the second one crashed on the 6th. The index was created about a year ago and did not make any problem since now.
[8 May 2014 12:30] MySQL Verification Team
Thank you for the feedback. Please check for duplicate with http://bugs.mysql.com/bug.php?id=68987 where a FTS index is involved. Thanks.
[9 Jun 2014 1: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".