Artifacts Associated With Ticket 597997ffffffffffffffffffffffffffffffffff
Ticket change [b658720eb7] (rid 125401) by msofer on 2002-08-20 23:06:46:
- assignee initialized to: "andreas_kupries"
- cmimetype initialized to: "text/plain"
- comment initialized to:
This (granted, stupid) script panics. [mig@mini unix]$ cat /tmp/test.tcl lappend auto_path /CVS/thread/unix package require Thread proc spawn {} { global i imax forever after 10 spawn if {[incr i] <= $imax} { thread::create "puts $i" flush stdout } set forever 1 } set i 0 if {[lindex $argv 0] ne {}} { set imax [lindex $argv 0] } else { set imax 10 } spawn vwait forever flush stdout [mig@mini unix]$ ./tclsh /tmp/test.tcl 1 called Tcl_FindHashEntry on deleted table Aborted - foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "msofer"
- subsystem initialized to: "49. Threading"
- title initialized to: "async+thread panic"
- type initialized to: "Bug"
Ticket change [1a51e39606] (rid 122962) by andreas_kupries on 2002-08-22 04:00:28:
- icomment:
Logged In: YES user_id=75003 And here is a shell script to run the tcl script until we get a core. It takes to long to get one when doing this manually. % while [ ! -f core ] ; do ./i/bin/tclsh8.4 tst.tcl ; done
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [2b52b8044c] (rid 118722) by andreas_kupries on 2002-08-22 04:11:22:
- icomment:
Logged In: YES user_id=75003 Well, the script reliably dumps core (panic, segfault, plain unwanted exit) ... Unfortunately the generated dumps are useless. Here is a typical stack trace (gdb) where #0 0x401d317e in __select () from /lib/libc.so.6 #1 0x400e9820 in ?? () from /home/andreask/sf- dev/84/i//lib/libtcl8.4g.so #2 0x400fab85 in pthread_start_thread (arg=0xbf7ffe40) at manager.c:241 Obviously something is smashing the stack(s) very badly.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [a7f7ca9c43] (rid 98893) by andreas_kupries on 2002-08-22 04:23:22:
- icomment:
Logged In: YES user_id=75003 Adding a 'return' just after the 'flush stdout' in spawn makes the crash go away. What the change does is defer 'set forever 1' until the chosen number of threads were created. This means that the 'vwait' at the end of the scripts exist only after the system is done with the threads. Setting forever to one while still spawning a thread causes the system to sometimes exit vwait and the application while a spawned thread is still running and accessing shared data structures. In other words: This seems to be the same problem we already know about, i.e. do not exit the application until you are sure that all sub-thread are done. Just in a different guise. See Tcl Bug #486399.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [22de011b88] (rid 130828) by msofer on 2002-08-22 21:21:46:
- icomment:
Logged In: YES user_id=148712 Mislabeled ticket, this has nothing to do with async and is indeed an "exit before all threads returned": the following script shows the same behaviour lappend auto_path /CVS/thread/unix package require Thread set i 0 while {[incr i] <= 2} { thread::create "puts $i" } and everything is fixed by adding the following at the end: # make sure to wait until all threads have returned # before exiting [bug #597997] while {[llength [thread::names]] > 1} { after 100 set x 1 vwait x } - login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [b1b18a00f9] (rid 98193) by dgp on 2003-11-13 07:55:05:
- foundin changed to: "obsolete: 8.4.4"
Ticket change [11d28bd50d] (rid 95209) by msofer on 2004-04-01 20:47:23:
- icomment:
Logged In: YES user_id=148712 Andreas: should we then relabel this bug and close it as duplicate?
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [d49ef9867d] (rid 123483) by andreas_kupries on 2006-03-15 07:59:21:
- icomment:
Logged In: YES user_id=75003 Yes.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [4744384ee9] (rid 99669) by msofer on 2006-03-15 17:06:54:
- closedate changed to: "2006-03-15T10:06:54"
- closer changed to: "msofer"
- icomment:
Logged In: YES user_id=148712 Closed as dup of #486399.
- login: "msofer"
- mimetype: "text/plain"
- resolution changed to: "Duplicate"
- status changed to: "Closed"
- username: "msofer"