hang when using pthread and fork in 1.5.23-1 and snapshot 20070118.

Peter Rehley peter@rehley.net
Sat Jan 20 02:03:00 GMT 2007


Hello,

One of the applications I've been working with has hanging issues.   
It will sometimes work properly, and sometimes it will hang and never  
continue through the rest of the program.

I've created a simple test case that does some of what the  
application does, and it will hang too. The test case has a loop that  
continually creates a pthread.  The pthread calls a function that  
forks and execve's to another program.  Eventually the main program  
will be unable to fork, and it will hang inside of the pthread after  
the thread's function has completed.   However, I can also get two  
other different results depending on how the program is compiled and  
run.

1) pthread_create failed : rc 11 - valid error.
   build with "g++ -DPRFAIL main.cc"
   and run without redirecting output.  Adds additional printf  
statements to output
2) fork called but never returns.  one hang situation.
    build with g++ main.cc
    and run with redirecting output to a file.
3) Unable to create fork, but program doesn't appear to leave thread  
and program hangs.
    build with g++ main.cc
    and run without redirecting output.

I suspect, maybe incorrectly, that the hangs are race conditions.   
I'm hoping that someone will be able to take the test case and be  
able to reproduce what I'm seeing.

The machine is a fresh install of windows xp only.  No webcam drivers  
or other known programs that interact badly with cygwin.  I have AVG  
antivirus installed but even with it uninstalled the program can  
still hang.

I've attached the cygcheck output and the simple test case.

Thanks,
Peter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cc
Type: application/octet-stream
Size: 1870 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20070120/88189098/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 81409 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20070120/88189098/attachment-0001.obj>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list