Bug 170257 - aio operations are inherited partially after fork()
aio operations are inherited partially after fork()
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
4
i686 Linux
medium Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-10 05:55 EDT by Elena Vengerova
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-02-22 14:09:34 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Elena Vengerova 2005-10-10 05:55:04 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Fedora/1.7.8-2

Description of problem:
POSIX says that "No asynchronous input or asynchronous output operations shall be inherited by the child process.".
However if a request is posted in the one process, aio_cancel() returns AIO_CANCELED instead AIO_ALLDONE in child (but request, of course, is not cancelled).

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Create pair of connected sockets.
2. Post 2 read requests on the one socket.
3. fork the child process.
4. Call aio_cancel() for the second request. 

  

Actual Results:  aio_cancel() returns AIO_CANCELED.

Expected Results:  aio_cancel() should return AIO_ALLDONE.

Additional info:
Comment 1 Jakub Jelinek 2005-10-10 06:20:41 EDT
You can't call aio_cancel in the child.
See
http://www.opengroup.org/onlinepubs/009695399/functions/fork.html
..."the child process may only execute async-signal-safe operations
until such time as one of the exec functions is called."
http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04_03
(aio_cancel is not async-signal-safe function)
Comment 2 Elena Vengerova 2005-10-10 07:39:38 EDT
Agree, aio_cancel() cannot be used.
However aio_error() is async-signal-safe, but is returns EINPROGRESS instead 0
in forked child...
Comment 3 Ulrich Drepper 2006-01-04 03:30:52 EST
And why should it aio_error return zero?  The request in the new process is not
defined at all.   If anything, it should return EINVAL and this isn't required.
 Returning zero gives a completely invalid picture of the situation.

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