Segfault (objPtr->typePtr->updateStringProc == NULL)
Closed / Invalida13778c49ecc068082577d48a5f05182383e5e8eCreated 12 years agoUpdated 42 days ago
Descriptionplain2014-08-08 15:54:19
Tested in W7, MinGW build x64, latest git trunk.
gdb gives the following backtrace:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 5392.0x1bf4]
0x0000000067559eea in Tcl_GetString (objPtr=0xc9bdcef)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclObj.c:1609
1609 if (objPtr->typePtr->updateStringProc == NULL) {
(gdb) bt
#0 0x0000000067559eea in Tcl_GetString (objPtr=0xc9bdcef)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclObj.c:1609
#1 0x000000006743a420 in Tcl_LsortObjCmd (clientData=0x0, interp=0xb8d8a00, objc=3,
objv=0xb8ba750) at d:/CM.git/tcltk86/dcompile/tcl/generic/tclCmdIL.c:3981
#2 0x000000006741c832 in Dispatch (data=0x12cc6ca8, interp=0xb8d8a00, result=0)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:4357
#3 0x000000006741c8c1 in TclNRRunCallbacks (interp=0xb8d8a00, result=0, rootPtr=0x12cc6d60)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:4390
#4 0x000000006741c059 in Tcl_EvalObjv (interp=0xb8d8a00, objc=3, objv=0xb8ba750, flags=2097168)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:4121
#5 0x000000006741e7d5 in TclEvalEx (interp=0xb8d8a00,
script=0x12d08023 "lsort -unique [concat $args [tsv::get objlockLockedObjs [thread::id]] [tsv::g
et objlockPendingObjs [thread::id]]]]\n foreach obj [tsv::get objlockLockedObjs [thread::id]]
{\n", ' ' <repeats 12 times>, "thread::s"..., numBytes=113, flags=0, line=2, clNextOuter=0x0,
outerScript=0x12d07ff0 "\n tsv::set objlockPendingObjs [thread::id] [lsort -unique [conca
t $args [tsv::get objlockLockedObjs [thread::id]] [tsv::get objlockPendingObjs [thread::id]]]]\n
foreach obj [tsv::get objl"...) at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:5259
#6 0x0000000067560992 in TclSubstTokens (interp=0xb8d8a00, tokenPtr=0xb8ba188, count=1,
tokensLeftPtr=0x0, line=2, clNextOuter=0x0,
outerScript=0x12d07ff0 "\n tsv::set objlockPendingObjs [thread::id] [lsort -unique [conca
t $args [tsv::get objlockLockedObjs [thread::id]] [tsv::get objlockPendingObjs [thread::id]]]]\n
foreach obj [tsv::get objl"...) at d:/CM.git/tcltk86/dcompile/tcl/generic/tclParse.c:2247
#7 0x000000006741e1e2 in TclEvalEx (interp=0xb8d8a00,
script=0x12d07ff0 "\n tsv::set objlockPendingObjs [thread::id] [lsort -unique [concat $ar
gs [tsv::get objlockLockedObjs [thread::id]] [tsv::get objlockPendingObjs [thread::id]]]]\n f
oreach obj [tsv::get objl"..., numBytes=388, flags=262144, line=2, clNextOuter=0x0,
outerScript=0x12d07ff0 "\n tsv::set objlockPendingObjs [thread::id] [lsort -unique [conca
t $args [tsv::get objlockLockedObjs [thread::id]] [tsv::get objlockPendingObjs [thread::id]]]]\n
foreach obj [tsv::get objl"...) at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:5146
#8 0x000000006741db79 in Tcl_EvalEx (interp=0xb8d8a00,
script=0x12d07ff0 "\n tsv::set objlockPendingObjs [thread::id] [lsort -unique [concat $ar
gs [tsv::get objlockLockedObjs [thread::id]] [tsv::get objlockPendingObjs [thread::id]]]]\n f
oreach obj [tsv::get objl"..., numBytes=388, flags=262144)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:4924
#9 0x000000006741f842 in TclNREvalObjEx (interp=0xb8d8a00, objPtr=0x12cc6d30, flags=262144,
invoker=0x0, word=0) at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:6120
#10 0x000000006741f3cd in TclEvalObjEx (interp=0xb8d8a00, objPtr=0x6750a16800, flags=262144,
invoker=0x0, word=0) at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:5955
#11 0x000000006741f376 in Tcl_EvalObjEx (interp=0xb8d8a00, objPtr=0x6750a16800, flags=262144)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:5937
#12 0x000000006718a1d6 in SvLockObjCmd (dummy=0x0, interp=0xb8d8a00, objc=3, objv=0xb8ba058)
at ./generic/threadSvCmd.c:2040
#13 0x000000006741c832 in Dispatch (data=0x12cc6108, interp=0xb8d8a00, result=0)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:4357
#14 0x000000006741c8c1 in TclNRRunCallbacks (interp=0xb8d8a00, result=0, rootPtr=0x11b35b20)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:4390
#15 0x000000006741f3e5 in TclEvalObjEx (interp=0xb8d8a00, objPtr=0x6750a16800, flags=131072,
invoker=0x0, word=0) at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:5956
#16 0x000000006741f376 in Tcl_EvalObjEx (interp=0xb8d8a00, objPtr=0x6750a16800, flags=131072)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:5937
#17 0x00000000619d5c68 in ButtonInvokeCommand (recordPtr=0x11660510, interp=0xb8d8a00, objc=2,
objv=0xb8b9200) at ./../generic/ttk/ttkButton.c:353
#18 0x00000000619f581f in Ttk_InvokeEnsemble (ensemble=0x61a41fe0 <ButtonCommands>, cmdIndex=1,
clientData=0x11660510, interp=0xb8d8a00, objc=2, objv=0xb8b9200)
at ./../generic/ttk/ttkTheme.c:1693
#19 0x00000000619fdce6 in WidgetInstanceObjCmd (clientData=0x11660510, interp=0xb8d8a00, objc=2,
objv=0xb8b9200) at ./../generic/ttk/ttkWidget.c:161
#20 0x000000006741c832 in Dispatch (data=0xbb476b8, interp=0xb8d8a00, result=0)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:4357
The bug is reproducable ... still I was unsuccessful to write a little tcl demo for that.
msoferplain2014-08-08 16:56:31
Not enough info to do anything about this: what we do know is that an improperly maintained Tcl_Obj has been encountered. A diagnose should determine how we came to this situation: what type of obj it is, if the problem is due to mem corruption, etc, etc. Note the premonitory comment just above the segfaulting line in tclObj.c: /* * Note we do not check for objPtr->typePtr == NULL. An invariant of * a properly maintained Tcl_Obj is that at least one of objPtr->bytes * and objPtr->typePtr must not be NULL. If broken extensions fail to * maintain that invariant, we can crash here. */
akuplain2014-08-08 17:23:46
An important thing missing here is the Tcl script which was used to induce the error.
ferrieuxplain2014-08-08 17:27:51
Try to locate the NULL-bytes/NULL-type object in the list that is being lsorted (that should be doable under gdb). Then, depending on the lifecycle of this list and its elements, try to sample both fields of the same object at earlier times. If you can find such an earlier point where the object is still on the sunny side, then simply use gdb's "watch" on the (yet non null) field's, and hit "continue". If not, try to identify the code that creates it, and break into it.
dkfwiki2016-08-20 17:02:12
Without a way to reproduce the failure, we cannot make progress.
serhiy.storchakawiki2026-10-12 19:26:08
No reproducer since 2014; closing. The invalid object pointer (0xc9bdcef is not even aligned) points to memory corruption, not to a problem in lsort. Please reopen with a script that reproduces it with a current Tcl and Thread version.
serhiy.storchaka Ticket [a13778c49e]: 3 changes
[History diff]2026-10-22 17:19:25
Log in (anonymous is fine) to add a comment.