platform: sparc solaris 9
tcl/tk: 8.5.4
A developer emailed me today, asking why their tcl application was core dumping. I stopped by, and here is what I found.
The application - assignee_edit - a purely tcl script - began:
#! /vol/tclsrcsol/tcl85test/bin/wish8.5 -f
:tk and tcl code
The core file says:
dbx /vol/tclsrcsol/tcl85test/bin/wish8.5 core
For information about new features see `help changes'
To remove this message, put `dbxenv suppress_startup_message 7.0' in your .dbxrc
Reading wish8.5
dbx: core object name "assignee_edit" doesn't match object name "wish8.5"
core file ignored.
Use -f to force loading of corefile
:
:
So, I typed:
$ dbx -f /vol/tclsrcsol/tcl85test/bin/wish8.5 core
For information about new features see `help changes'
To remove this message, put `dbxenv suppress_startup_message 7.0' in your .dbxrc
Reading wish8.5 core file
header read successfully
Reading ld.so.1
Reading libtk8.5.so
Reading libtcl8.5.so
Reading libX11.so.4
Reading libXext.so.0
Reading libdl.so.1
Reading libsocket.so.1
Reading libnsl.so.1
Reading libm.so.1
Reading libc.so.1
Reading libmp.so.2
Reading libc_psr.so.1
Reading libtclx8.4.so
Reading libOratcl4.4.so
Reading libclntsh.so.9.0
Reading libwtc9.so
Reading libgen.so.1
Reading libsched.so.1
Reading libaio.so.1
Reading librt.so.1
Reading libmd5.so.1
Reading libmd5_psr.so.1
program terminated by signal SEGV (no mapping at the fault address)
Current function is Tcl_NextHashEntry
587 if (searchPtr->nextIndex >= tablePtr->numBuckets) {
(dbx) where
=>[1] Tcl_NextHashEntry(searchPtr = 0xffbfdc68), line 587 in "tclHash.c"
[2] Tcl_FirstHashEntry(tablePtr = (nil), searchPtr = 0xffbfdc68), line 553 in "tclHash.c"
[3] Oratcl_Clean(clientData = 0x6a478), line 217 in "oratcl.c"
[4] Oratcl_Exit(clientData = 0x6a478), line 274 in "oratcl.c"
[5] Tcl_Finalize(), line 949 in "tclEvent.c"
[6] Tcl_Exit(status = 0), line 828 in "tclEvent.c"
[7] Tk_MainEx(argc = -1, argv = 0xffbfe0f0, appInitProc = 0x114c8 = &Tcl_AppInit(Tcl_Interp *interp), interp = 0x2abc0), line 325 in "tkMain.c"
[8] main(argc = 3, argv = 0xffbfe0e4), line 68 in "tkAppInit.c"
Now, looking at the stack trace, one might think "hmm, probably an Oratcl error".
Here's the kicker.
For grins, I changed the script to read:
#! /vol/tclsrcsol/tcl85test/bin/tclsh8.5
package require Tk
and now the program does not generate the core dump.
Also, I have written the script:
#! /vol/tclsrcsol/tcl85test/bin/wish8.5 -f
pack [button .quit -text Quit -command exit}
and it runs without a core dump, so it doesn't seem like the length of the magic line is the issue.
A finalization crash only in exit
from Tk_Main sounds related to issues
GPS has been examining.