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

Bug #764395 reported by Alexey Kopytov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
Undecided
Alexey Kopytov
5.1
Fix Released
Undecided
Alexey Kopytov

Bug Description

Reporting http://bugs.mysql.com/bug.php?id=60788 on Launchpad so we can track our work on it and the status of the MySQL bug locally:

Description:
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: http://dev.mysql.com/doc/refman/5.1/en/operating-system-error-codes.html
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
my_pwrite()/my_pread().

Tags: upstream cr

Related branches

Revision history for this message
Alexey Kopytov (akopytov) wrote :

Creating a remote bug watch: http://bugs.mysql.com/bug.php?id=60788

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
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-2628

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

Other bug subscribers

Remote bug watches

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