Tcl Source Code

View Ticket
Login
Ticket UUID: 690108
Title: threads: segfault in unixNotfy.test
Type: Bug Created on: 2003-02-20 15:43:53
Submitter: msofer Assigned to: msofer
Subsystem: 49. Threading Severity:
Priority: 6 Last modified: 2003-03-29 05:36:04
Status: Closed Closed by: msofer
Resolution: Works For Me Closed on: 2003-03-28 22:36:04
Version: obsolete: 8.4.1.1
Description:
(Note: this may be a libpthread and/or RedHat bug? High
prio to discard that it's a tcl problem)

System: linux RH7.3 on i386 (up2date'd)
          * glibc-2.2.4-31
          * gcc-2.96-112.7.2

Tcl:     * happens with tcl >= 8.4b1 (although I'm
pretty sure it did not                  
            happen a while ago, suspect RH update)
          * configured as "--enable-threads
--enable-symbols --disable-shared"

Symptom: segfault in unixNotfy.test, apparently at
cleanup (see session below)

Notes: I first suspected the new allocator, but that's
not it. I observe the same behaviour compiling with
threads but -DPURIFY instead of -DUSE_THREAD_ALLOC


Sample session:

[mig@mini unix]$ ./tcltest ../tests/unixNotfy.test 
unixNotfy.test: Total   4       Passed  2       Skipped
2       Failed  0
Number of tests skipped for each constraint:
        2       unixOnly && !testthread
Segmentation fault
[mig@mini unix]$ gdb tcltest core.5814 
GNU gdb Red Hat Linux (5.2-2)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public
License, and you are
welcome to change it and/or distribute copies of it
under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show
warranty" for details.
This GDB was configured as "i386-redhat-linux"...
Core was generated by `./tcltest ../tests/unixNotfy.test'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/i686/libpthread.so.0...done.
Loaded symbols for /lib/i686/libpthread.so.0
Reading symbols from /lib/i686/libm.so.6...done.
Loaded symbols for /lib/i686/libm.so.6
Reading symbols from /lib/i686/libc.so.6...done.
Loaded symbols for /lib/i686/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
#0  __pthread_mutex_unlock (mutex=0x0) at mutex.c:174
174     mutex.c: No such file or directory.
        in mutex.c
(gdb) bt
#0  __pthread_mutex_unlock (mutex=0x0) at mutex.c:174
#1  0x080ee585 in Tcl_MutexUnlock (mutexPtr=0x811c494)
at ./../unix/tclUnixThrd.c:440
#2  0x080640f1 in TclThreadSend (interp=0x81977c8,
id=0x400, script=0x8198970 "set x ok", wait=1)
    at ./../generic/tclThreadTest.c:809
#3  0x080636f5 in Tcl_ThreadObjCmd (dummy=0x0,
interp=0x81977c8, objc=4, objv=0x405c589c) at
./../generic/tclThreadTest.c:354
#4  0x080689e1 in TclEvalObjvInternal
(interp=0x81977c8, objc=4, objv=0x405c589c, 
    command=0x8198912 ' ' <repeats 12 times>,
"testthread send 1024 {set x ok}\n", ' ' <repeats 12
times>, "testthread exit", 
    length=44, flags=0) at ./../generic/tclBasic.c:3081
#5  0x08069603 in Tcl_EvalEx (interp=0x81977c8, 
    script=0x8198908 "after 500\n", ' ' <repeats 12
times>, "testthread send 1024 {set x ok}\n", ' '
<repeats 12 times>, "testthread exit", numBytes=81,
flags=0) at ./../generic/tclBasic.c:3670
#6  0x08069b11 in Tcl_Eval (interp=0x81977c8, 
    string=0x8198908 "after 500\n", ' ' <repeats 12
times>, "testthread send 1024 {set x ok}\n", ' '
<repeats 12 times>, "testthread exit") at
./../generic/tclBasic.c:3868
#7  0x08063a39 in NewTestThread (clientData=0xbfffbcb0)
at ./../generic/tclThreadTest.c:512
#8  0x4002dc3f in pthread_start_thread (arg=0x405c5be0)
at manager.c:284
User Comments:
hobbs added on 2003-02-21 01:07:05:
Logged In: YES 
user_id=72656

I cannot repro this on a couple of Linux platforms.  I suspect 
some machine config specialized problem.

msofer added on 2003-03-29 05:36:04:
Logged In: YES 
user_id=148712

Can't repro any longer, strongly suspect a RH bug that was
since repaired.