Bug #77308 Assertion failure in file fil0fil.c line 859 - Unable to lock ibd, error: 37
Submitted: 11 Jun 2015 8:07 Modified: 12 Mar 2016 5:15
Reporter: Stephan Großberndt Email Updates:
Status: Can't repeat Impact on me:
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.5.43 OS:Any
Assigned to: CPU Architecture:Any

[11 Jun 2015 8:07] Stephan Großberndt
On a virtual host in a debian wheezy os.
The host system is configured with a numflock limit of 1000 for each guest.

ulimit -n gives 1024 by default.

InnoDB is configured with innodb_file_per_table=1

There are ~40 databases with ~100-200 tables each on the instance

If ulimit -n, innodb_open_files, innodb_io_capacity, open_files_limit are all configured to be >1000 and the numflock limit is reached, MySQL crashes.

If all tables are MyISAM this does not happen.

InnoDB: Unable to lock ./demo/tx_extbase_cache_object.ibd, error: 37
150610  9:26:02  InnoDB: Assertion failure in thread 140654092109568 in file fil0fil.c line 859
InnoDB: Failing assertion: ret
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.
150610  9:26:02 [ERROR] 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.

To report this bug, see http://kb.askmonty.org/en/reporting-bugs

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.

Server version: 5.5.43-MariaDB-1~wheezy-log
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1926397 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x0x7fed8ac98000
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 = 0x7fec95323e50 thread_stack 0x48000

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

How to repeat:
Create an instance with more than 1000 innodb tables, set numflock to 1000, run mysqlcheck -A

Suggested fix:
MySQL should not crash - this leads to crashed MyISAM tables. The numflock limit should be taken into account.
[11 Jun 2015 8:28] Stephan Großberndt
How to fix temporarily: 

set ulimit -n, innodb_open_files, innodb_io_capacity, open_files_limit to <1000
[12 Mar 2016 5:15] MySQL Verification Team
Hello Stephan,

Thank you for the report.
I'm not seeing this issue with reported version and latest GA builds.
If you can provide more information, feel free to add it to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.