Bug 172757 - aio_suspend hangs when file I/O
Summary: aio_suspend hangs when file I/O
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: glibc
Version: 4.0
Hardware: ia64
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-11-09 05:46 UTC by Liang Dianpeng
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-11-09 08:27:53 UTC
Target Upstream Version:
Embargoed:


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

Description Liang Dianpeng 2005-11-09 05:46:22 UTC
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):
glibc-2.3.4-2.9

How reproducible:
Always

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 
  -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DFORK"
       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 05:54:04 UTC
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 

   -D_GNU_SOURCE -DFORK

Comment 2 Jakub Jelinek 2005-11-09 07:30:53 UTC
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
http://www.opengroup.org/onlinepubs/009695399/functions/fork.html
So you can't e.g. call lio_listio there, as it is not async-signal-safe.

Comment 3 Liang Dianpeng 2005-11-09 07:57:52 UTC
 Thanks a lot. It is understood.
 In Red Hat is  there  other asynchronous I/O function ?


Comment 4 Jakub Jelinek 2005-11-09 08:02:22 UTC
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.