Bug #40768 InnoDB regression: server crashes if tmpdir is unwritable
Submitted: 17 Nov 2008 0:10 Modified: 29 Jan 2009 17:07
Reporter: Alexey Stroganov Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.1.29-win64, 5.1.30-win64 OS:Windows
Assigned to: Assigned Account CPU Architecture:Any

[17 Nov 2008 0:10] Alexey Stroganov
Description:
- I unpacked mysql-noinstall-5.1.30-winx64.zip
- I started MySQL server as following and server crashes:

$ ./bin/mysqld --no-defaults --datadir=data/ --basedir=.  --console --tmpdir=c:/

081117  0:53:26  InnoDB: Error: unable to create temporary file; errno: 2
081117  0:53:26 [ERROR] Plugin 'InnoDB' init function returned error.
081117  0:53:26 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
081117  0:53:26 - mysqld got exception 0xc0000005 ;
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=8388600
read_buffer_size=131072
max_used_connections=0
max_threads=151
threads_connected=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 338114 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0x1c8d890
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...
00000001401AF1D4    mysqld.exe!intern_plugin_lock()[sql_plugin.cc:617]
00000001401AF262    mysqld.exe!plugin_lock()[sql_plugin.cc:656]
0000000140047A68    mysqld.exe!ha_resolve_by_legacy_type()[handler.cc:193]
0000000140047AC6    mysqld.exe!ha_checktype()[handler.cc:209]
000000014021DD85    mysqld.exe!open_binary_frm()[table.cc:706]
0000000140220B65    mysqld.exe!open_table_def()[table.cc:619]
0000000140162094    mysqld.exe!get_table_share()[sql_base.cc:377]
00000001401621AD    mysqld.exe!get_table_share_with_create()[sql_base.cc:476]
0000000140164EE3    mysqld.exe!open_unireg_entry()[sql_base.cc:3835]
0000000140169190    mysqld.exe!open_table()[sql_base.cc:2905]
000000014016A205    mysqld.exe!open_tables()[sql_base.cc:4553]
000000014016A898    mysqld.exe!open_and_lock_tables_derived()[sql_base.cc:4956]
0000000140150A4D    mysqld.exe!acl_reload()[sql_acl.cc:702]
00000001401572F0    mysqld.exe!acl_init()[sql_acl.cc:287]
0000000140101800    mysqld.exe!win_main()[mysqld.cc:4295]
0000000140101C02    mysqld.exe!mysql_service()[mysqld.cc:4439]
0000000140101F18    mysqld.exe!main()[mysqld.cc:4612]
00000001403CBEB5    mysqld.exe!__tmainCRTStartup()[crt0.c:327]
000000007758495D    kernel32.dll!BaseThreadInitThunk()
00000000776B8791    ntdll.dll!RtlUserThreadStart()
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0000000000000000=(null)
thd->thread_id=0
thd->killed=NOT_KILLED
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.

When I started MySQL server with writable tmpdir like following all works ok:

$ ./bin/mysqld --no-defaults --datadir=data/ --basedir=.  --console --tmpdir=c:/tmp
081117  0:53:21  InnoDB: Started; log sequence number 0 46409
081117  0:53:21 [Note] Event Scheduler: Loaded 0 events
081117  0:53:21 [Note] c:\tmp\mysql-5.1.30-winx64\bin\mysqld.exe: ready for connections.
Version: '5.1.30-community'  socket: ''  port: 3306  MySQL Community Server (GPL)

On Linux all works ok in case --tmpdir is unwritable:
./bin/mysqld --no-defaults --basedir=. --datadir=data/ --tmpdir=/root
./bin/mysqld: Can't create/write to file '/root/ib65PvYW' (Errcode: 13)
081116  7:38:39  InnoDB: Error: unable to create temporary file; errno: 13
081116  7:38:39 [ERROR] Plugin 'InnoDB' init function returned error.
081116  7:38:39 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

I verified previous win releases and found out that issue above is observed in 5.1.29 as well but in  5.1.28 and 5.1.27 all works ok.

How to repeat:
Start server on windows with unwritable tmpdir:

./bin/mysqld --no-defaults --datadir=data/ --basedir=.  --console --tmpdir=c:/
[17 Nov 2008 1:29] Alexey Stroganov
I've just got another crash for another wrong innodb option and believe that this is general  problem of handling of exceptions from storage engine.

Error that I've just got:
InnoDB: Error: log file .\ib_logfile0 is of different size 0 104857600 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
081117  2:17:17 [ERROR] Plugin 'InnoDB' init function returned error.
081117  2:17:17 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
081117  2:17:17 - mysqld got exception 0xc0000005 ;
[17 Nov 2008 1:30] Alexey Stroganov
Look at related: BUG#40757
[18 Nov 2008 8:01] Calvin Sun
See my comments in bug#40757. The crash is caused by the fix of bug#37958, specifically the reuse of plugin array slot.
[29 Jan 2009 17:07] Ramil Kalimullin
Duplicate, see bug#40757: "Starting server on Windows with innodb_flush_method=wrong_value causes crash"