Artifacts Associated With Ticket 749639ffffffffff
Ticket change [6ee765099b] (rid 100219) by dizzi on 2003-06-05 16:31:15:
- assignee initialized to: "andreas_kupries"
- cmimetype initialized to: "text/plain"
- comment initialized to:
When compiled with --enable-threads Tcl8.4.3 doesn't handle correctly the exit from child processes created with fork if they don't execl some other program. The problem is explained in detail in this bug report against TclX that I filed yesterday, which seems in fact a Tcl8.4 bug: http://sourceforge.net/tracker/index.php?func=detail&aid=748835&group_id=13247&atid=113247 The problem seems to be that when the child process exits without executing another program it sends a 'q' message to a notifier process that belongs to its parent. The child then waits for some signal from the parent that is never sent and hangs forever. It is true that Tcl doesn't have the fork and execl commands, but these commands are provided by the TclX extension and they can't work correctly because of a bug in the Tcl exit code. The patch in attachment seems to fix the problem, but since I don't really know how the threaded notifier works it may be wrong. My solution simply does nothing in Tcl_FinalizeNotifier() if the current process is not the one which created the notifier thread. In this way the notifier thread can be terminated only by its parent and child processes should be able to exit without interfering with the parent threads. -- Massimo Dal Zotto <[email protected]>
- foundin initialized to: "obsolete: 8.4.3"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dizzi"
- subsystem initialized to: "49. Threading"
- title initialized to:
exit fom child process hangs if --enable-threads set
- type initialized to: "Bug"
Add attachment "unix-notify.patch" [efdc5deca0] (rid 109072) by dizzi on 2003-06-05 23:31:15.
Ticket change [9096ee85f4] (rid 120477) by dizzi on 2003-06-05 23:31:15:
- icomment:
File Added - 52276: unix-notify.patch
- login: "dizzi"
- mimetype: "text/plain"
- username: "dizzi"
- icomment:
Ticket change [80e7aae7cb] (rid 116949) by gnepp on 2003-07-02 05:22:28:
- icomment:
Logged In: YES user_id=698369 I think this is slightly wrong -- Tcl_ConditionFinalize(&(tsdPtr->waitCV)); is no longer called in the child process but still needs to be. An alternative patch would be to set notifierCount = 0 post- fork in the child, using a pthread_atfork() handler, but I don't know how portable that is. Andrei - login: "gnepp"
- mimetype: "text/plain"
- username: "gnepp"
- icomment:
Ticket change [6e1f38adc0] (rid 128822) by hobbs on 2003-10-14 02:20:36:
- priority changed to: "8"
Ticket change [48c7875849] (rid 99954) by davidw on 2004-03-25 19:19:27:
- icomment:
Logged In: YES user_id=240 Jeff Hobbs created a patch which uses pthread_atfork, which is really what needs to happen. The patch locks all the mutexes before forking, then unlocks them in both the parent and child afterwards. I have cleaned up the patch just a bit, added 2 test commands (testfork and testwaitpid), and a couple of basic tests. One modification to the patch that needs more thinking is how to expose the atfork stuff to Tcl. For starters, I have created two functions, one that is called in the parent, the other in the child. Otherwise, there seems to be no way of knowing which you are running in, and that information might be necessary at some point.
- login: "davidw"
- mimetype: "text/plain"
- username: "davidw"
- icomment:
Ticket change [35531c0bf2] (rid 106903) by davidw on 2004-03-25 19:26:41:
- icomment:
Logged In: YES user_id=240 Since it's apparently not possible to actually attach a patch, it is located at: http://sourceforge.net/tracker/index.php?func=detail&aid=923072&group_id=10894&atid=310894
- login: "davidw"
- mimetype: "text/plain"
- username: "davidw"
- icomment:
Ticket change [d4257da899] (rid 123402) by ferrieux on 2011-09-24 05:11:25:
- closedate changed to: "2011-09-23T22:11:25"
- closer changed to: "ferrieux"
- icomment:
Wiped out by the 2001201 quick exit reform.
- login: "ferrieux"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "ferrieux"