XtraDB crashes on startup on windows

Reported by Sergey Petrunia on 2009-08-23
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Maria
Fix Released
High
Hakan Küçükyılmaz
Percona-XtraDB
Fix Released
High
Unassigned

Bug Description

I've tried to run MariaDB for Windows (WinXP, Visual Studio 8). After fixing a number of apparent failures, I've got it to compile but the obtained binary crashes on startup.
-------------------------------------------------------------------------------------------------------------------------

G:\maria\maria-5.1\mysql-test>perl ./mysql-test-run.pl t/innodb.test
Logging: ./mysql-test-run.pl t/innodb.test
MySQL Version 5.1.35
Checking supported features...
 - skipping ndbcluster, mysqld not compiled with ndbcluster
 - SSL connections supported
 - binaries are debug compiled
Collecting tests...
vardir: G:/maria/maria-5.1/mysql-test/var
Checking leftover processes...
Removing old var directory...
Creating var directory 'G:/maria/maria-5.1/mysql-test/var'...
Installing system database...
Using server port 3541

==============================================================================

TEST RESULT TIME (ms)
------------------------------------------------------------

worker[1] Using MTR_BUILD_THREAD 250, with reserved ports 12500..12509
worker[1] mysql-test-run: WARNING: Process [mysqld.1 - pid: 4752, winpid: 4752, exit: 1280] died
Could not open event or process 4752, error: 87
Couldn't open the winpid: 4752 for pid: 4752, try one more time
Could not open event or process 4752, error: 87
Couldn't open the winpid: 4752 for pid: 4752, continue and see what happens...
main.innodb [ fail ]
        Test ended at 2009-08-22 06:26:00

CURRENT_TEST: main.innodb
InnoDB: The InnoDB memory heap is disabled
InnoDB: Neither mutexes nor rw_locks use GCC atomic builtins.
InnoDB: The first specified data file .\ibdata1 did not exist:
InnoDB: a new database to be created!
090822 6:25:53 InnoDB: Setting file .\ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
090822 6:25:54 InnoDB: Log file .\ib_logfile0 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
090822 6:25:54 InnoDB: Log file .\ib_logfile1 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
090822 6:25:55 InnoDB: Assertion failure in thread 2932 in file .\os\os0file.c line 3686
InnoDB: Failing assertion: slot->reserved
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.1/en/forcing-recovery.html
InnoDB: about forcing recovery.
InnoDB: Thread 4728 stopped in file G:\maria\maria-5.1\storage\xtradb\include\buf0buf.ic line 622
InnoDB: Thread 5724 stopped in file .\buf\buf0flu.c line 235
090822 16:25:55 - 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=1048576
read_buffer_size=131072
max_used_connections=0
max_threads=153
threads_connected=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 60788 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0x0
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...
0091D6A6 mysqld.exe!os_aio_windows_handle()[os0file.c:3686]
00918CFF mysqld.exe!fil_aio_wait()[fil0fil.c:4738]
00908927 mysqld.exe!io_handler_thread()[srv0start.c:464]
7C80B699 kernel32.dll!GetModuleFileNameA()
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.
Writing a core file
Minidump written to G:\maria\maria-5.1\mysql-test\var\mysqld.1\data\mysqld.dmp

Failed to start mysqld.1

 - saving 'G:/maria/maria-5.1/mysql-test/var/log/main.innodb/' to 'G:/maria/maria-5.1/mysql-test/var/log/main.innodb/'
 - found 'mysqld.dmp' (0/5)

Trying 'cdb' to get a backtrace
OS debug symbols will be downloaded and stored in C:\cdb_symbols.
You can control the location of symbol cache with _NT_SYMBOL_PATH
environment variable. Please refer to Microsoft KB article
http://support.microsoft.com/kb/311503 for details about _NT_SYMBOL_PATH
-------------------------------------------------------------------------
Output from cdb follows. Faulting thread is printed twice,with and without function parameters
Search for STACK_TEXT to see the stack trace of
the faulting thread. Callstacks of other threads are printed after it.

Microsoft (R) Windows Debugger Version 6.11.0001.404 X86
Copyright (c) Microsoft Corporation. All rights reserved.

Loading Dump File [G:\maria\maria-5.1\mysql-test\var\log\main.innodb\mysqld.1\data\mysqld.dmp]
User Mini Dump File: Only registers, stack and portions of memory are available

Symbol search path is: C:\WINDOWS\system32;G:\maria\maria-5.1\sql\debug;.;srv*C:\cdb_symbols*http://msdl.microsoft.com/download/symbols
Executable search path is: C:\WINDOWS\system32;G:\maria\maria-5.1\sql\debug;.
Windows XP Version 2600 (Service Pack 2) MP (2 procs) Free x86 compatible
Product: WinNt, suite: SingleUserTS
Machine Name:
Debug session time: Sat Aug 22 06:25:55.000 2009 (GMT-7)
System Uptime: not available
Process Uptime: 0 days 0:00:02.000
....................
This dump file has an exception of interest stored in it.
The stored exception information can be accessed via .ecxr.
(c8c.b74): Access violation - code c0000005 (first/second chance not available)
eax=03de0000 ebx=00151bd8 ecx=00000007 edx=7c90e514 esi=00151bb0 edi=00151c08
eip=7c90e514 esp=0335e900 ebp=0335e910 iopl=0 nv up ei pl zr na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246
ntdll!KiFastSystemCallRet:
             ret
0:015> cdb: Reading initial command '!sym prompts off; !analyze -v; .ecxr; !for_each_frame dv /t;!uniqstack -p;q'
quiet mode - symbol prompts off

FAULTING_IP:
mysqld!os_aio_windows_handle+f6 [g:\maria\maria-5.1\storage\xtradb\os\os0file.c @ 3686]
         cmp dword ptr [eax],0

EXCEPTION_RECORD: ffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 0091d6a6 (mysqld!os_aio_windows_handle)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 00000000
   Parameter[1]: 00000000
Attempt to read from address 00000000

PROCESS_NAME: mysqld.exe

ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at "0x%08lx" referenced memory at "0x%08lx". The memory could not be "%s".

EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - The instruction at "0x%08lx" referenced memory at "0x%08lx". The memory could not be "%s".

EXCEPTION_PARAMETER1: 00000000

EXCEPTION_PARAMETER2: 00000000

READ_ADDRESS: 00000000

FOLLOWUP_IP:
mysqld!os_aio_windows_handle+f6 [g:\maria\maria-5.1\storage\xtradb\os\os0file.c @ 3686]
         cmp dword ptr [eax],0

FAULTING_THREAD: 00000b74

BUGCHECK_STR: APPLICATION_FAULT_NULL_POINTER_READ_FILL_PATTERN_cccccccc

PRIMARY_PROBLEM_CLASS: NULL_POINTER_READ_FILL_PATTERN_cccccccc

DEFAULT_BUCKET_ID: NULL_POINTER_READ_FILL_PATTERN_cccccccc

LAST_CONTROL_TRANSFER: from 00918cff to 0091d6a6

STACK_TEXT:
mysqld!os_aio_windows_handle [g:\maria\maria-5.1\storage\xtradb\os\os0file.c @ 3686]
mysqld!fil_aio_wait [g:\maria\maria-5.1\storage\xtradb\fil\fil0fil.c @ 4738]
mysqld!io_handler_thread [g:\maria\maria-5.1\storage\xtradb\srv\srv0start.c @ 464]
kernel32!BaseThreadStart

FAULTING_SOURCE_CODE:
  3682: os_mutex_enter(array->mutex);
  3683:
  3684: slot = os_aio_array_get_nth_slot(array, i);
  3685:
> 3686: ut_a(slot->reserved);
  3687:
  3688: if (orig_seg != ULINT_UNDEFINED) {
  3689: srv_set_io_thread_op_info(orig_seg,
  3690: "get windows aio return value");
  3691: }

SYMBOL_STACK_INDEX: 0

SYMBOL_NAME: mysqld!os_aio_windows_handle+f6

FOLLOWUP_NAME: MachineOwner

MODULE_NAME: mysqld

IMAGE_NAME: mysqld.exe

DEBUG_FLR_IMAGE_TIMESTAMP: 4a8fb0ce

STACK_COMMAND: ~15s; .ecxr ; kb

FAILURE_BUCKET_ID: NULL_POINTER_READ_FILL_PATTERN_cccccccc_c0000005_mysqld.exe!os_aio_windows_handle

BUCKET_ID: APPLICATION_FAULT_NULL_POINTER_READ_FILL_PATTERN_cccccccc_mysqld!os_aio_windows_handle+f6

WATSON_STAGEONE_URL: http://watson.microsoft.com/StageOne/mysqld_exe/0_0_0_0/4a8fb0ce/mysqld_exe/0_0_0_0/4a8fb0ce/c0000005/0051d6a6.htm?Retriage=1

Followup: MachineOwner
---------

eax=00000000 ebx=00e3ec28 ecx=fec464b0 edx=00e41618 esi=cccccccc edi=0335ff54
eip=0091d6a6 esp=0335ff1c ebp=0335ff54 iopl=0 nv up ei pl nz na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010202
mysqld!os_aio_windows_handle:
         cmp dword ptr [eax],0 ds:0023:00000000=????????
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
mysqld!os_aio_windows_handle [g:\maria\maria-5.1\storage\xtradb\os\os0file.c @ 3686]
unsigned long segment = 4
unsigned long pos = 0
struct fil_node_struct ** message1 = 0x0335ff90
void ** message2 = 0x0335ff84
unsigned long * type = 0x0335ff78
struct os_aio_array_struct * array = 0x0175f028
unsigned long ret_val = 0xcccccccc
unsigned long orig_seg = 0xe
struct os_aio_slot_struct * slot = 0x0175f160
int ret = -858993460
unsigned long len = 0xcccccccc
unsigned long n = 0x20
unsigned long i = 0
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
mysqld!fil_aio_wait [g:\maria\maria-5.1\storage\xtradb\fil\fil0fil.c @ 4738]
unsigned long segment = 0xe
void * message = 0xcccccccc
unsigned long ret = 0xcccccccc
struct fil_node_struct * fil_node = 0xcccccccc
struct fil_system_struct * system = 0x01764458
unsigned long type = 0xcccccccc
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
mysqld!io_handler_thread [g:\maria\maria-5.1\storage\xtradb\srv\srv0start.c @ 464]
void * arg = 0x00e3ec28
unsigned long segment = 0xe
unsigned long i = 0
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kernel32!BaseThreadStart
Unable to enumerate locals, HRESULT 0x80004005
Private symbols (symbols.pri) are required for locals.
Type ".hh dbgerr005" for details.
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
mysqld!os_aio_windows_handle [g:\maria\maria-5.1\storage\xtradb\os\os0file.c @ 3686]
Processing 21 threads, please wait

. 0 Id: c8c.1278 Suspend: 0 Teb: 7ffdf000 Unfrozen
      Priority: 0

ntdll!KiFastSystemCallRet
ntdll!NtDelayExecution
kernel32!SleepEx
kernel32!Sleep
mysqld!os_thread_sleep(unsigned long tm = 0x3b9aca00) [g:\maria\maria-5.1\storage\xtradb\os\os0thread.c @ 279]
mysqld!ut_dbg_stop_thread(char * file = 0x00dc60dc "--- memory read error at address 0x00dc60dc ---", unsigned long line = 0x26e) [g:\maria\maria-5.1\storage\xt
radb\ut\ut0dbg.c @ 111]
mysqld!buf_page_get_page_no(struct buf_page_struct * bpage = 0x01b41cd0) [g:\maria\maria-5.1\storage\xtradb\include\buf0buf.ic @ 622]
mysqld!buf_flush_write_block_low(struct buf_page_struct * bpage = 0x01b41cd0) [g:\maria\maria-5.1\storage\xtradb\buf\buf0flu.c @ 751]
mysqld!buf_flush_page(struct buf_page_struct * bpage = 0x01b41cd0, buf_flush flush_type = BUF_FLUSH_LIST (2)) [g:\maria\maria-5.1\storage\xtradb\buf\buf0flu.c @
 877]
mysqld!buf_flush_try_neighbors(unsigned long space = 0, unsigned long offset = 1, buf_flush flush_type = BUF_FLUSH_LIST (2)) [g:\maria\maria-5.1\storage\xtradb\
buf\buf0flu.c @ 962]
mysqld!buf_flush_batch(buf_flush flush_type = BUF_FLUSH_LIST (2), unsigned long min_n = 0xfffffffe, unsigned int64 lsn_limit = 0xffffffff`ffffffff) [g:\maria\ma
ria-5.1\storage\xtradb\buf\buf0flu.c @ 1107]
mysqld!log_preflush_pool_modified_pages(unsigned int64 new_oldest = 0xffffffff`ffffffff, unsigned long sync = 1) [g:\maria\maria-5.1\storage\xtradb\log\log0log.
c @ 1612]
mysqld!log_make_checkpoint_at(unsigned int64 lsn = 0xffffffff`ffffffff, unsigned long write_always = 1) [g:\maria\maria-5.1\storage\xtradb\log\log0log.c @ 2027]

mysqld!trx_sys_create_doublewrite_buf(void) [g:\maria\maria-5.1\storage\xtradb\trx\trx0sys.c @ 387]
mysqld!innobase_start_or_create_for_mysql(void) [g:\maria\maria-5.1\storage\xtradb\srv\srv0start.c @ 1665]
mysqld!innobase_init(void * p = 0x01373850) [g:\maria\maria-5.1\storage\xtradb\handler\ha_innodb.cc @ 2262]
mysqld!ha_initialize_handlerton(struct st_plugin_int * plugin = 0x01372a10) [g:\maria\maria-5.1\sql\handler.cc @ 431]
mysqld!plugin_initialize(struct st_plugin_int * plugin = 0x01372a10) [g:\maria\maria-5.1\sql\sql_plugin.cc @ 1003]
mysqld!plugin_init(int * argc = 0x00e25d7c, char ** argv = 0x012d9640, int flags = 0) [g:\maria\maria-5.1\sql\sql_plugin.cc @ 1216]
mysqld!init_server_components(void) [g:\maria\maria-5.1\sql\mysqld.cc @ 3981]
mysqld!win_main(int argc = 11, char ** argv = 0x012d4078) [g:\maria\maria-5.1\sql\mysqld.cc @ 4451]
mysqld!mysql_service(void * p = 0x00000000) [g:\maria\maria-5.1\sql\mysqld.cc @ 4626]
mysqld!main(int argc = 11, char ** argv = 0x012d4078) [g:\maria\maria-5.1\sql\mysqld.cc @ 4797]
mysqld!__tmainCRTStartup(void) [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 327]
mysqld!mainCRTStartup(void) [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 196]
kernel32!BaseProcessStart

Sergey Petrunia (sergefp) wrote :

An [obvious] patch to make MariaDB to compile on windows.

Changed in percona-xtradb:
assignee: nobody → Yasufumi Kinoshita (yasufumi-kinoshita)
importance: Undecided → High
status: New → Confirmed

innodb_io_patches.patch doesn't consider Windows at all for now.
So, Windows specific feature may not work (e.g. native aio in this case).

Please use "innodb_flush_method = normal" to avoid windows native aio for now.
I will check later.

Thank you.

Changed in percona-xtradb:
status: Confirmed → In Progress
Changed in maria:
importance: Undecided → High
status: New → Confirmed

The fix was pushed.
It is based on Sergey's fix. And Windows native async i/o is disabled as default.
And the current revision is for Plugin 1.0.4.

Changed in percona-xtradb:
status: In Progress → Fix Committed
Changed in percona-xtradb:
status: Fix Committed → Fix Released
tags: added: windows

Fix is in MariaDB 5.1.39

Changed in maria:
assignee: nobody → Hakan Küçükyılmaz (hakan-askmonty)
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers