This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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"
and run without redirecting output. Adds additional printf statements to output
2) fork called but never returns. one hang situation.
build with g++
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++
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.


Description: Binary data

Attachment: cygcheck.out
Description: Binary data

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]