Bug #64680 InnoDB: Assertion failure in thread **** in file row0sel.c line 2441
Submitted: 17 Mar 2012 23:50 Modified: 18 Dec 2012 19:43
Reporter: Konrad Pawlus Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:5.5.21 OS:Linux (Ubuntu 10.4)
Assigned to: CPU Architecture:Any
Tags: assertion failure, innodb

[17 Mar 2012 23:50] Konrad Pawlus
Description:
After restore from mysqldump I received this error:

120318  0:27:17  InnoDB: Assertion failure in thread 139772289087232 in file row0sel.c line 2441
InnoDB: Failing assertion: buf + data_len <= original_buf + buf_len

Hardwer seams to be fine.

120318  0:27:17  InnoDB: Assertion failure in thread 139772289087232 in file row0sel.c line 2441
InnoDB: Failing assertion: buf + data_len <= original_buf + buf_len
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.5/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
23:27:17 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.

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

Thread pointer: 0x2c395120
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 = 7f1f45a3ee68 thread_stack 0x40000
/usr/local/mysql/bin/mysqld(my_print_stacktrace+0x35)[0x79b455]
/usr/local/mysql/bin/mysqld(handle_fatal_signal+0x403)[0x66a613]
/lib/libpthread.so.0(+0xf8f0)[0x7f25acf838f0]
/lib/libc.so.6(gsignal+0x35)[0x7f25ac15aa75]
/lib/libc.so.6(abort+0x180)[0x7f25ac15e5c0]
/usr/local/mysql/bin/mysqld[0x811bca]
/usr/local/mysql/bin/mysqld[0x7f20d0]
/usr/local/mysql/bin/mysqld(_ZN7handler18index_read_idx_mapEPhjPKhm16ha_rkey_function+0x7a)[0x66b1aa]
/usr/local/mysql/bin/mysqld[0x592f49]
/usr/local/mysql/bin/mysqld[0x59fcae]
/usr/local/mysql/bin/mysqld[0x5a8664]
/usr/local/mysql/bin/mysqld(_ZN4JOIN8optimizeEv+0x581)[0x5aa1e1]
/usr/local/mysql/bin/mysqld(_Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x171)[0x5ade21]
/usr/local/mysql/bin/mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x179)[0x5b3bd9]
/usr/local/mysql/bin/mysqld[0x571c61]
/usr/local/mysql/bin/mysqld(_Z21mysql_execute_commandP3THD+0x2216)[0x577236]
/usr/local/mysql/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x18a)[0x57980a]
/usr/local/mysql/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x1321)[0x57b3b1]
/usr/local/mysql/bin/mysqld(_Z24do_handle_one_connectionP3THD+0x167)[0x610037]
/usr/local/mysql/bin/mysqld(handle_one_connection+0x54)[0x6100a4]
/lib/libpthread.so.0(+0x69ca)[0x7f25acf7a9ca]
120318  0:27:17/lib/libc.so.6(clone+0x6d)[0x7f25ac20d70d]
  InnoDB: Assertion failure in thread 139772291483392 in file row0sel.c line 2441

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
InnoDB: Failing assertion: buf + data_len <= original_buf + buf_len
Query (2c3a0110): 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.5/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
Aborted
120318 00:27:17 mysqld_safe Number of processes running now: 0
120318 00:27:17 mysqld_safe mysqld restarted
120318  0:27:17 [Note] Plugin 'FEDERATED' is disabled.
120318  0:27:17 InnoDB: The InnoDB memory heap is disabled
120318  0:27:17 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120318  0:27:17 InnoDB: Compressed tables use zlib 1.2.3
120318  0:27:17 InnoDB: Using Linux native AIO
120318  0:27:17 InnoDB: Initializing buffer pool, size = 24.0G
120318  0:27:20 InnoDB: Completed initialization of buffer pool
120318  0:27:20 InnoDB: highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 518891828212
120318  0:27:21  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 518897070592
InnoDB: Doing recovery: scanned up to log sequence number 518899265570
InnoDB: 16 transaction(s) which must be rolled back or cleaned up
InnoDB: in total 35 row operations to undo
InnoDB: Trx id counter is 14B00
120318  0:27:21  InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
InnoDB: Last MySQL binlog file position 0 45002, file name ./mysql-bin.000099
InnoDB: Starting in background the rollback of uncommitted transactions
120318  0:27:25  InnoDB: Rolling back trx with id 148ED, 2 rows to undo
120318  0:27:25  InnoDB: Waiting for the background threads to start

Let me know if I need to send some more details.

This is default my.cf from huge template with just:

innodb_file_per_table
binlog_format=mixed
innodb_buffer_pool_instances = 4
innodb_buffer_pool_size = 24576M

I have 32GB of ram
This is running on VM (vSphere)

How to repeat:
Not sure...

Suggested fix:
Fix
[18 Mar 2012 7:34] Konrad Pawlus
I did reinstal mysql once again, using same data files I got som more info in log, pointing to some query:

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (2bbb9730): select visitstats0_.ID as ID3_, visitstats0_.VERSION as VERSION3_, visitstats0_.VENDOR_ID as VENDOR3_3_, visitstats0_.INFORMATION_TYPE as INFORMAT4_3_, visitstats0_.WEBSITE as WEBSITE3_, visitstats0_.PERIOD as PERIOD3_, visitstats0_.DATE as DATE3_, visitstats0_.CREATED_ON as CREATED8_3_, visitstats0_.TOTAL_VISITS as TOTAL9_3_, visitstats0_.PARTNERS_VISITS as PARTNERS10_3_, visitstats0_.PROSPECTS_VISITS as PROSPECTS11_3_, visitstats0_.CUSTOMERS_VISITS as CUSTOMERS12_3_, visitstats0_.OTHER_VISITS as OTHER13_3_, visitstats0_.ANONYMOUS_VISITS as ANONYMOUS14_3_, visitstats0_.TOTAL_TIME as TOTAL15_3_, visitstats0_.PARTNERS_TIME as PARTNERS16_3_, visitstats0_.PROSPECTS_TIME as PROSPECTS17_3_, visitstats0_.CUSTOMERS_TIME as CUSTOMERS18_3_, visitstats0_.OTHER_TIME as OTHER19_3_, visitstats0_.ANONYMOUS_TIME as ANONYMOUS20_3_ from SM_VISIT_STATS visitstats0_ where visitstats0_.VENDOR_ID='8d24361f-d1c2-4dc8-a300-449594b7d549' and visitstats0_.INFORMATION_TYPE='GENERAL' and visitstats0_.WEBSITE='test.pl' and visitstats0_.
Connection ID (thread ID): 100
Status: NOT_KILLED

I tried to recreate this table - but same issue ocures.

Table create:

CREATE TABLE `SM_VISIT_STATS` (
  `ID` char(128) COLLATE utf8_polish_ci NOT NULL,
  `VERSION` int(11) NOT NULL,
  `VENDOR_ID` varchar(255) COLLATE utf8_polish_ci NOT NULL,
  `WEBSITE` varchar(255) COLLATE utf8_polish_ci NOT NULL,
  `PERIOD` varchar(255) COLLATE utf8_polish_ci NOT NULL,
  `DATE` datetime NOT NULL,
  `CREATED_ON` datetime NOT NULL,
  `TOTAL_VISITS` int(11) NOT NULL,
  `PARTNERS_VISITS` int(11) NOT NULL,
  `PROSPECTS_VISITS` int(11) NOT NULL,
  `CUSTOMERS_VISITS` int(11) NOT NULL,
  `ANONYMOUS_VISITS` int(11) NOT NULL,
  `TOTAL_TIME` bigint(20) NOT NULL,
  `PARTNERS_TIME` bigint(20) NOT NULL,
  `PROSPECTS_TIME` bigint(20) NOT NULL,
  `CUSTOMERS_TIME` bigint(20) NOT NULL,
  `ANONYMOUS_TIME` bigint(20) NOT NULL,
  `OTHER_VISITS` int(11) NOT NULL,
  `OTHER_TIME` bigint(20) NOT NULL,
  `INFORMATION_TYPE` varchar(255) COLLATE utf8_polish_ci NOT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `VENDOR_ID` (`VENDOR_ID`,`INFORMATION_TYPE`,`WEBSITE`,`PERIOD`,`DATE`),
  KEY `FK_VISIT_STATS_VENDOR_ID` (`VENDOR_ID`),
  KEY `IDX_VISIT_STATS_UPSERT` (`VENDOR_ID`,`INFORMATION_TYPE`,`WEBSITE`,`PERIOD`,`DATE`),
  KEY `IDX_VISIT_STATS_LOAD` (`VENDOR_ID`,`INFORMATION_TYPE`,`PERIOD`,`DATE`),
  CONSTRAINT `FK_VISIT_STATS_VENDOR_ID` FOREIGN KEY (`VENDOR_ID`) REFERENCES `SM_VENDOR` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_polish_ci
[25 Mar 2012 14:47] Valeriy Kravchuk
Please, send the output of EXPLAIN for this query and the output of SHOW TABLE STATUS for the table.
[26 Apr 2012 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".
[20 Nov 2012 18:02] Marc O'Morain
I'm hitting the same issue. Here is the output from MySQL:

https://gist.github.com/4119620

Here is the output of explain and show table status (the query also causes a disconnect I'm afraid)

https://gist.github.com/4119629
[20 Nov 2012 18:38] Marc O'Morain
I've tried poking at this bug. The crash happens when I do this:

    SELECT * FROM `install_tracking_results`  WHERE game_id IN (1, 2, 3) AND target_game_id = 2 AND segment_id = 'default_segment' AND category = 'clickthru' AND `install_tracking_results`.`source` IN ('test') AND (time BETWEEN 'D-2012-10-10' AND 'D-2012-10-13');

but not when I do this:

    SELECT * FROM `install_tracking_results`  WHERE game_id IN (1, 2, 3) AND target_game_id = 2 AND segment_id = 'default_segment' AND category = 'clickthru' AND `install_tracking_results`.`source` IN ('test') AND (time BETWEEN 'D-2012-10-10' AND 'D-2012-10-1');

(The change is that I removed the last character from the WHERE BETWEEN clause.
[18 Dec 2012 19:43] Sveta Smirnova
Marc,

thank you for the feedback.

Your query crashes in version 5.5.28, but does not in 5.5.29. Please wait when this version is released and upgrade.