Red Hat Bugzilla – Bug 107015
aio_return wrongly yields zero
Last modified: 2016-11-24 09:58:03 EST
Description of problem:
From one of our developers:
There seems to be a bug in asynchronous I/O on this platform.
We schedule an I/O operation, read or write, and wait for completion
notification. We then call aio_error(), and if this call returns zero,
we call aio_return().
In roughly one out of 1.000.000 calls, aio_return() will reply
with zero, rather than 16K, the size of our I/O request.
This of course, makes our database server fail.
When forcing a core-dump in this situation, I could see that the aiocb
struct contained the value 16K, even though aio_return() had returned
As an ad hoc workaround, I called aio_return() one more time,
after having printed a warning, it then returns 16K (!!!!)
According to the specificaion, aio_return() should be called exactly
once. We disassembled the routine, it simply returns a value in the
aiocb struct, so calling it twice should be OK.
To me, this seems to a thread/process synchronization bug in asynch
I/O on this platform.
Version-Release number of selected component (if applicable): QU2 kernel
(2.4.9-e.24) and unofficial e.27.6
Approx 1/1 million
Steps to Reproduce:
1. Schedule IO, wait for completion
2. Call aio_error
3. if aio_error returns zero, call aio_return
aio_return yields 0 K
aio_return should yield 16 K
This will be flagged in the Sun - Redhat Issue Tracker
are you using glibc or kernel AIO ?
It comes from /usr/include/aio.h, so that would make it part of glibc as far as
we can see.
then the kernel is the wrong component to file this against ;)
Is there any progress on this?
We have seen instances where the workaround of calling aio_return once
more does not help. Calling it yet again seems to "always" generate
the correct answer, since the chance of the bug occuring a third time
in one go is so small.
I haven't been able to reproduce this. Can you provide a testcase?
No answer in 7 months. Closing.
It seems that the fix for bug #132494 (for RHEL 3AS) should be backported to 2.1AS.