Bug 107015 - aio_return wrongly yields zero
aio_return wrongly yields zero
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: glibc (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2003-10-14 08:01 EDT by Yngve Svendsen
Modified: 2016-11-24 09:58 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-08-26 01:07:47 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Yngve Svendsen 2003-10-14 08:01:54 EDT
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

How reproducible:
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
Actual results:
aio_return yields 0 K

Expected results:
aio_return should yield 16 K

Additional info:
This will be flagged in the Sun - Redhat Issue Tracker
Comment 1 Arjan van de Ven 2003-10-14 08:06:34 EDT
are you using glibc or kernel AIO ?
Comment 2 Yngve Svendsen 2003-10-14 08:15:57 EDT
It comes from /usr/include/aio.h, so that would make it part of glibc as far as
we can see.
Comment 3 Arjan van de Ven 2003-10-14 08:19:58 EDT
then the kernel is the wrong component to file this against ;)
Comment 4 Yngve Svendsen 2004-01-08 13:49:09 EST
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. 
Comment 5 Jakub Jelinek 2004-01-08 15:11:17 EST
I haven't been able to reproduce this.  Can you provide a testcase?
Comment 6 Ulrich Drepper 2004-08-26 01:07:47 EDT
No answer in 7 months.  Closing.
Comment 7 Alexey Roytman 2005-05-26 09:04:09 EDT
It seems that the fix for bug #132494 (for RHEL 3AS) should be backported to 2.1AS.
Should it?

Note You need to log in before you can comment on or make changes to this bug.