Bug #87423 os0file.cc assertion failed 'offset > 0' in os_file_io_complete
Submitted: 15 Aug 2017 15:14 Modified: 26 Nov 2018 13:59
Reporter: Vasily Nemkov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:5.7.18 OS:Linux
Assigned to: CPU Architecture:Any

[15 Aug 2017 15:14] Vasily Nemkov
Description:
Assertion failure is most likely to be caused by narrowing cast:
the value passed as `offset` argument to the `os_file_io_complete` is casted by the calling code prior to invoking from `os_offset_t` to `ulint`.

The bug was spotted in Percona xtrabackup, which shares that file with mysql server.

Please also see:
https://bugs.launchpad.net/percona-xtrabackup/+bug/1602537

The change was introduced in 2220cab3ac820d3c78d8066cf2538503a01ffba5

How to repeat:
Found no reliable way to reproduce.

Suggested fix:
Change type of `offset` argument of `os_file_io_complete` from `ulint` to `os_offset_t` and remove corresponding narrowing casts.
[16 Aug 2017 14:12] MySQL Verification Team
Hi!

I have analysed the code and especially the types used and I agree with you. I am verifying this bug, so that developers can provide their reasoning and eventually make a type change.

Verified.
[24 Dec 2017 13:33] MySQL Verification Team
Private testcase on https://bugs.mysql.com/bug.php?id=88956
[26 Nov 2018 13:59] Daniel Price
Posted by developer:
 
Fixed as of the upcoming 5.7.25, 8.0.14 release, and here's the changelog entry:

An assertion was raised when attempting to write to a tablespace file
greater than 4GB in size on a 64-bit Windows system. The failure was due
to a narrowing cast.