Bug #80761 Server crashed in mutex_create due to invalid option
Submitted: 16 Mar 2016 9:15 Modified: 23 Mar 2016 14:02
Reporter: Allen Lai Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.7.11 OS:Any
Assigned to: CPU Architecture:Any

[16 Mar 2016 9:15] Allen Lai
Description:
If the startup fails due to invalid option, the unconditional mutex_create later causes a crash

2016-03-16T07:11:17.456242Z 0 [Note] InnoDB: Using Linux native AIO
2016-03-16T07:11:17.456257Z 0 [ERROR] InnoDB: Unrecognized value O_DIRECT_NOFSYNC for innodb_flush_method
2016-03-16T07:11:17.456276Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error

Program received signal SIGSEGV, Segmentation fault.
sync_latch_get_meta (id=id@entry=LATCH_ID_MASTER_KEY_ID_MUTEX)
    at /home/subains/work/5.7/storage/innobase/include/sync0types.h:880

How to repeat:
Start server with invalid option "O_DIRECT_NOFSYNC"

Suggested fix:
mutex_create(LATCH_ID_MASTER_KEY_ID_MUTEX, &master_key_id_mutex) in ha_innodb.cc
This mutex_create should check the err value
[23 Mar 2016 14:02] Daniel Price
Posted by developer:
 
Fixed as of the upcoming 5.7.13, 5.8.0 release, and here's the changelog entry:

A startup failure due to an invalid option resulted in a server exit
after a subsequent restart. An error returned by the
innobase_start_or_create_for_mysql function was not checked.

Thank you for the bug report.