Artifacts Associated With Ticket 1082283fffffffff
Ticket change [e2514793c3] (rid 87602) by doko on 2004-12-09 17:11:34:
- assignee initialized to: "andreas_kupries"
- cmimetype initialized to: "text/plain"
- comment initialized to:
tcl8.4.7 (and current 8.4 branch) segfault when running on Linux 2.6 kernels on machines with 2 or more processors. It takes several runs to reproduce sometimes and gdb isn't very helpful. (gdb) run ./www/c_interface.tcl >c_interface.html Starting program: /home/james/scratch/tcl8.4/tcl8.4-8.4.7/unix/tclsh ./www/c_interface.tcl >c_interface.html [Thread debugging using libthread_db enabled] [New Thread 1076113536 (LWP 14342)] [New Thread 1084509104 (LWP 14343)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1076113536 (LWP 14342)] 0x4000c410 in _dl_fini () from /lib/ld-linux.so.2 (gdb) bt #0 0x4000c410 in _dl_fini () from /lib/ld-linux.so.2 #1 0x4013490f in exit () from /lib/tls/i686/cmov/libc.so.6 #2 0x40069b44 in Tcl_Exit () from /usr/lib/libtcl8.4.so.0 #3 0x4004a3b5 in Tcl_ExitObjCmd () from /usr/lib/libtcl8.4.so.0 #4 0x40044604 in TclEvalObjvInternal () from /usr/lib/libtcl8.4.so.0 #5 0x400451b4 in Tcl_EvalEx () from /usr/lib/libtcl8.4.so.0 #6 0x4004563b in Tcl_Eval () from /usr/lib/libtcl8.4.so.0 #7 0x4008eafe in Tcl_Main () from /usr/lib/libtcl8.4.so.0 #8 0x08048733 in main (argc=134512916, argv=0x8048114) at ../unix/tclAppInit.c:90 (gdb) Disabling TLS (LD_ASSUME_KERNEL=2.4.21) seems to 'fix' it. The problematic change appears to be this: * unix/tclUnixNotfy.c (NotifierThreadProc): Accepted Joe Mistachkin's patch for [Tcl SF Bug 990500], properly closing the notifier thread when its exits. cf. http://sourceforge.net/tracker/?group_id=10894&atid=110894&func=detail&aid=990500 If I revert that patch, I can longer reproduce the segfault, even with 10,000 iterations. See https://bugzilla.ubuntu.com/show_bug.cgi?id=4141 for the original bug report. - foundin initialized to: "obsolete: 8.4.9"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "doko"
- subsystem initialized to: "49. Threading"
- title initialized to:
tcl8.4 segfaults running on linux-2.6 with SMP machines
- type initialized to: "Bug"
Ticket change [3a98085ed3] (rid 112582) by hobbs on 2004-12-10 02:58:53:
- assignee changed to: "mistachkin"
- icomment:
Logged In: YES user_id=72656 Joe needs to do more testing of his recommended core patches for the exit shutdown.
- login: "hobbs"
- mimetype: "text/plain"
- priority changed to: "9 Immediate"
- username: "hobbs"
Ticket change [3716e5f938] (rid 107217) by mistachkin on 2004-12-23 14:20:50:
- icomment:
Logged In: YES user_id=113501 Can anybody duplicate this bug on some non-Linux nix platform with 2 or more processors? We need to figure out if this problem is specific to Linux.
- login: "mistachkin"
- mimetype: "text/plain"
- username: "mistachkin"
- icomment:
Ticket change [eb1bb3eb06] (rid 103479) by mistachkin on 2004-12-23 14:22:06:
- icomment:
Logged In: YES user_id=113501 This bug may be related to bug #1011715.
- login: "mistachkin"
- mimetype: "text/plain"
- username: "mistachkin"
- icomment:
Ticket change [7105da43b1] (rid 100598) by mistachkin on 2005-03-03 14:28:39:
- assignee changed to: "hobbs"
- icomment:
Logged In: YES user_id=113501 I do not believe my patch is [directly] causing this issue. This appears to be happening at process termination. I have a theory on how to fix this problem. In "tclUnixNotfy.c", near line 303 we have: Tcl_MutexUnlock(¬ifierMutex); I suggest we add the following after this code: /* * Avoid possible race condition, physically wait for thread to die. */ Tcl_JoinThread(notifierThread); This should avoid a [potential] race condition between the process terminating (due to a premature return from Tcl_FinalizeNotifier) and the notifier thread actually calling TclpThreadExit. - login: "mistachkin"
- mimetype: "text/plain"
- username: "mistachkin"
Ticket change [464ff6636e] (rid 99498) by mistachkin on 2005-03-06 13:10:54:
- icomment:
Logged In: YES user_id=113501 The Tcl_CreateThread call for the notifier thread will also need the TCL_THREAD_JOINABLE flag. Near line 222 of tclUnixNotfy.c: if (TclpThreadCreate(¬ifierThread, NotifierThreadProc, NULL, TCL_THREAD_STACK_DEFAULT, TCL_THREAD_NOFLAGS) != TCL_OK) { Tcl_Panic("Tcl_InitNotifier: unable to start notifier thread"); } - login: "mistachkin"
- mimetype: "text/plain"
- username: "mistachkin"
- icomment:
Ticket change [7ffa38ec5b] (rid 97658) by hobbs on 2005-05-31 09:12:42:
- assignee changed to: "vasiljevic"
- priority changed to: "8"
Ticket change [83769b4237] (rid 117385) by vasiljevic on 2005-05-31 14:29:25:
- icomment:
Logged In: YES user_id=95086 I'm not 100% sure if this is going to fix the problem but Joe is right about the notifier thread termination. It is more clean to join the exiting notifier thread. There is an ever-lasting problem with proper termination of Tcl shell process with threads enabled. If you just exit() the process *while* there are still some threads running, you might get a core. This is not only related to the notifier thread but for threads in general. The reason is in the Tcl library design and has been observed and reported several times already (Bug #597575). The problem is not easy to solve but we can certainly close this subtle race condition by joining the notifier thread. I will add this into both core-8-4-branch and head branch today and the poster of the bug-ticket should try to reproduce the problem, if possible, as I do not have MP-linux box here. I have MP-Darwin and MP-Solaris boxes and I've not observed any problem there, provided all threads have been terminated before the exit() is called. I will leave this ticket open after applying the changes until we prove it solves the issue or not.
- login: "vasiljevic"
- mimetype: "text/plain"
- username: "vasiljevic"
- icomment:
Ticket change [88efbfe83a] (rid 131943) by vasiljevic on 2005-06-21 02:49:51:
- icomment:
Logged In: YES user_id=95086 This patch has been incorporated in 8.4.10 but I broke the code by compiling with new gcc 4.0.0 on MacOSX. Hence... I'd like to ask the original poster to try to reproduce the bug again if possible by giving it a try against the 8.4.11 which will soon be released (or by checking out the core-8-4-branch). I will keep this bug opened for 4 weeks after the 8.4.11 release and if nobody responds, I will consider this one solved and will close this ticket.
- login: "vasiljevic"
- mimetype: "text/plain"
- username: "vasiljevic"
- icomment:
Ticket change [07b6a685fc] (rid 89454) by dkf on 2005-06-21 16:02:20:
- icomment:
Logged In: YES user_id=79902 Just a general note: if you've got glibc 2.3.2, you should set LD_ASSUME_KERNEL to 2.4.19 to work around other threading bugs (in glibc) that have been found to impact on Tcl. Note that this trick also stabilizes other applications that make use of threads (e.g. it's helping keep my Java applications from locking up). This advice only applies to glibc 2.3.2, but that's disappointingly common still...
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [9e0845f399] (rid 96408) by mic42 on 2006-06-22 06:15:00:
- icomment:
Logged In: YES user_id=302287 Not sure if its the same or similar problem, but i see Segfaults when running 'make test' on a SuSE 10.1 x86_64 machine, compiling against Tcl 8.5a4 from CVS. Its an SMP kernel 2.6.19, glibc 2.4, gcc 4.1.0. The segfault vanishes when i use --enable-symbols while compiling the thread package (2.6.3 from cvs), but happens every time when leaving out symbols.
- login: "mic42"
- mimetype: "text/plain"
- username: "mic42"
- icomment:
Ticket change [b15c0923a8] (rid 98132) by ferrieux on 2011-09-24 05:09:21:
- icomment:
Sounds completely outdated. So much has been done since then, in both process termination and thread safety, that the odds are high that it's fixed by now.
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [c10dae4318] (rid 111259) by ferrieux on 2011-09-24 05:09:22:
- closedate changed to: "2011-09-23T22:09:22"
- closer changed to: "ferrieux"
- resolution changed to: "Fixed"
- status changed to: "Pending"
Ticket change [c066671b53] (rid 134174) by dkf on 2013-09-24 12:05:31:
- closedate changed to: "2456560.00383998"
- closer changed to: "dkf"
- comment changed to:
tcl8.4.7 (and current 8.4 branch) segfault when running on Linux 2.6 kernels on machines with 2 or more processors. It takes several runs to reproduce sometimes and gdb isn't very helpful. (gdb) run ./www/c_interface.tcl >c_interface.html Starting program: /home/james/scratch/tcl8.4/tcl8.4-8.4.7/unix/tclsh ./www/c_interface.tcl >c_interface.html [Thread debugging using libthread_db enabled] [New Thread 1076113536 (LWP 14342)] [New Thread 1084509104 (LWP 14343)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1076113536 (LWP 14342)] 0x4000c410 in _dl_fini () from /lib/ld-linux.so.2 (gdb) bt #0 0x4000c410 in _dl_fini () from /lib/ld-linux.so.2 #1 0x4013490f in exit () from /lib/tls/i686/cmov/libc.so.6 #2 0x40069b44 in Tcl_Exit () from /usr/lib/libtcl8.4.so.0 #3 0x4004a3b5 in Tcl_ExitObjCmd () from /usr/lib/libtcl8.4.so.0 #4 0x40044604 in TclEvalObjvInternal () from /usr/lib/libtcl8.4.so.0 #5 0x400451b4 in Tcl_EvalEx () from /usr/lib/libtcl8.4.so.0 #6 0x4004563b in Tcl_Eval () from /usr/lib/libtcl8.4.so.0 #7 0x4008eafe in Tcl_Main () from /usr/lib/libtcl8.4.so.0 #8 0x08048733 in main (argc=134512916, argv=0x8048114) at ../unix/tclAppInit.c:90 (gdb) Disabling TLS (LD_ASSUME_KERNEL=2.4.21) seems to 'fix' it. The problematic change appears to be this: * unix/tclUnixNotfy.c (NotifierThreadProc): Accepted Joe Mistachkin's patch for [Tcl SF Bug 990500], properly closing the notifier thread when its exits. cf. http://sourceforge.net/tracker/?group_id=10894&atid=110894&func=detail&aid=990500 If I revert that patch, I can longer reproduce the segfault, even with 10,000 iterations. See https://bugzilla.ubuntu.com/show_bug.cgi?id=4141 for the original bug report. - login: "dkf"
- mimetype: "text/plain"
- severity changed to: "Severe"
- status changed to: "Closed"