Bug 172757 - aio_suspend hangs when file I/O
aio_suspend hangs when file I/O
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: glibc (Show other bugs)
ia64 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2005-11-09 00:46 EST by Liang Dianpeng
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-11-09 03:27:53 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
aio_suspend test program which can reproduce aio_suspend hangs (3.28 KB, text/plain)
2005-11-09 00:54 EST, Liang Dianpeng
no flags Details

  None (edit)
Description Liang Dianpeng 2005-11-09 00:46:22 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)

Description of problem:
 After The parent process   has called lio_listio()/aio_suspend/aio_return to read/write file ,fork a child proces by fork() .when  called lio_listio()/aio_suspend/aio_return to read/write the same file int the  child process,
 the aio_suspend hangs . gdb  back trace is the following:

 gdb) bt
#0  0xa000000000010641 in ?? ()
#1  0x20000000002f71d0 in __lll_lock_wait () from /lib/tls/libpthread.so.0
#2  0x20000000002f1b60 in pthread_cond_signal@@GLIBC_2.3.2 ()
   from /lib/tls/libpthread.so.0
#3  0x200000000022ceb0 in pthread_cond_signal@@GLIBC_2.3.2 ()
   from /lib/tls/libc.so.6.1
#4  0x2000000000049230 in __aio_enqueue_request () from /lib/tls/librt.so.1
#5  0x200000000004ba30 in lio_listio64 () from /lib/tls/librt.so.1
#6  0x4000000000001990 in main (argc=4, argv=0x60000fffffffba68)

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

How reproducible:

Steps to Reproduce:
1. run testaio liang 100 100 in attachment file.
Notice a testaio was testaio.c by "gcc -g testaio.c -o testaio -lrt 
       b liang is not exist file.

Actual Results:  the expected "end wait" has been output to stdout and the child process hangs

Expected Results:  end wait has been output and the program can normally exit

Additional info:
Comment 1 Liang Dianpeng 2005-11-09 00:54:04 EST
Created attachment 120834 [details]
aio_suspend test program which can reproduce aio_suspend hangs

compile method is the follow :
 gcc  -g testaio.c -o testaio -lrt -D_LARGEFILE64_SOURCE -_FILE_OFFSET_BITS=64 

Comment 2 Jakub Jelinek 2005-11-09 02:30:53 EST
lio_listio implies multi-threaded process.  And in a multi-threaded process
you are not allowed to call almost any function after fork (except
async-signal-safe functions), see
So you can't e.g. call lio_listio there, as it is not async-signal-safe.
Comment 3 Liang Dianpeng 2005-11-09 02:57:52 EST
 Thanks a lot. It is understood.
 In Red Hat is  there  other asynchronous I/O function ?
Comment 4 Jakub Jelinek 2005-11-09 03:02:22 EST
Just aio_* and lio_*.  It really depends on what exactly you want to do.
Either use a thread instead of forking, or exec a child program and do the
work in there.

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