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] |
On Fri, 26 Jan 2007, Peter Rehley wrote:hmmm, rereading those descriptions I see what you mean. I'll try to clarify.
Hello,
I tried the latest release of cygwin1.dll (1.5.24-1) and it still is hanging in the same way. I've tried to debug further with gdb, but so far I haven't got any useful information out of gdb.
I'll keep trying to get some debug information, but if any one else can reproduce the problem I would be most appreciative.
I can reproduce a problem. Your descriptions of it are a bit hard to
follow, so I'm not sure if it is your problem or not. Unfortunately, I
don't have time to debug it right now. I do have a few comments, though.
Our main application handles requests from a named socket. Some of the requests call shell scripts. Most of these shell scripts can send more requests to the application (I didn't write this, I just have to maintain it ). So for those requests that call shell scripts the application has to create a thread and within the thread fork and then exec.
Why are you creating a thread just to fork/exec another process?
Pedantically, I believe you are supposed to call _exit, not exit, if fork
fails as stated here in the Solaris man page for fork:
An applications should call _exit() rather than exit(3C) if it cannot execve(), since exit() will flush and close stan- dard I/O channels and thereby corrupt the parent process's standard I/O data structures. Using exit(3C) will flush buf- fered data twice. See exit(2).
I've modified my test case to make sure that execve has valid arguments, but I still get the hang. FWIW, execve is being used because of the shell scripts being called.
I don't know, however, if this is really true in Cygwin, but it might explain some misdiagnosed hangs on your part.
Also, the execve call appears to be suspect. Again, the Solaris man page
for execve states:
The value in argv[0] should point to a filename that is associated with the process being started by one of the exec functions. [snip] As indicated, argc is at least one and the first member of the array points to a string containing the name of the file.
Attached is a modified test case that fixes a few of these issues, but
still hangs (or stutters; it does appear to proceed after long periods of
time).
-- 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/
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |