Bug 107015 - aio_return wrongly yields zero
Summary: aio_return wrongly yields zero
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: glibc   
(Show other bugs)
Version: 2.1
Hardware: i686 Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-10-14 12:01 UTC by Yngve Svendsen
Modified: 2016-11-24 14:58 UTC (History)
4 users (show)

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


Attachments (Terms of Use)

Description Yngve Svendsen 2003-10-14 12:01:54 UTC
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
zero.

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 12:06:34 UTC
are you using glibc or kernel AIO ?

Comment 2 Yngve Svendsen 2003-10-14 12:15:57 UTC
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 12:19:58 UTC
then the kernel is the wrong component to file this against ;)


Comment 4 Yngve Svendsen 2004-01-08 18:49:09 UTC
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 20:11:17 UTC
I haven't been able to reproduce this.  Can you provide a testcase?

Comment 6 Ulrich Drepper 2004-08-26 05:07:47 UTC
No answer in 7 months.  Closing.

Comment 7 Alexey Roytman 2005-05-26 13:04:09 UTC
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.