MySQL bug #60788: InnoDB crashes with an assertion failure when receiving a signal on pwrite()

Bug #764395 reported by Alexey Kopytov on 2011-04-18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Server
Percona Server moved to
Fix Released
Alexey Kopytov
Fix Released
Alexey Kopytov

Bug Description

Reporting on Launchpad so we can track our work on it and the status of the MySQL bug locally:

According to POSIX write()/pwrite() return -1 with errno set to EINTR when those calls
are interrupted by a signal before they write any data, or return the number of bytes
written if a signal is received after successfully writing some data.

Neither of those cases are handled correctly by InnoDB. Here is an example of pwrite()
returning -1 with errno set to EINTR:

InnoDB: Error: Write to file ./test/test.ibd failed at offset 0 5308416.
InnoDB: 983040 bytes should have been written, only -1 were written.
InnoDB: Operating system error number 4.
InnoDB: Check that your OS and file system support files of this size.
InnoDB: Check also that the disk is not full or a disk quota exceeded.
InnoDB: Error number 4 means 'Interrupted system call'.
InnoDB: Some operating system error numbers are described at
InnoDB: Assertion failure in thread 1140169024 in file os/os0file.c line 4205
InnoDB: Failing assertion: ret
InnoDB: We intentionally generate a memory trap.

MyISAM is not affected by this problem because mysys handles those cases correctly by
restarting the write.

I think all of the above applies to reads as well.

How to repeat:
Examine the os_file_pwrite()/os_file_pread() code. Compare with how EINTR is handled in

Related branches

Alexey Kopytov (akopytov) wrote :

Creating a remote bug watch:

Changed in percona-server:
assignee: nobody → Alexey Kopytov (akopytov)
status: New → In Progress
tags: added: cr
Changed in percona-server:
status: In Progress → Fix Committed
Changed in percona-server:
milestone: none → 5.5-20.2stable
status: Fix Committed → Fix Released
tags: added: upstream

Percona now uses JIRA for bug reports so this bug report is migrated to:

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.