Bus error after bad syntax
Closed / Duplicate916795ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 23 years ago
Descriptionplain2004-03-15 18:35:49
Roy Terry reports on clt that the attached script crashes Tcl 8.4.6 (but not 8.5a1). Confirmed on Solaris 9.
dgpplain2004-03-16 01:35:49
File Added - 80171: crash84.tcl
dgpplain2004-03-16 02:09:07
Logged In: YES
user_id=80530
Stack trace on Linux/Alpha:
Program received signal SIGSEGV, Segmentation fault.
0x12008aed4 in TclExecuteByteCode (interp=0x12021ca60,
codePtr=0x12024e9f0)
at ./../generic/tclExecute.c:3988
3988 catchStackPtr[++catchTop] = stackTop;
(gdb) bt
#0 0x12008aed4 in TclExecuteByteCode (interp=0x12021ca60,
codePtr=0x12024e9f0)
at ./../generic/tclExecute.c:3988
#1 0x12007ef94 in TclCompEvalObj (interp=0x12021ca60,
objPtr=0x12024a1d0)
at ./../generic/tclExecute.c:982
#2 0x120019980 in TclObjInterpProc (clientData=0x12024e220,
interp=0x12021ca60, objc=3, objv=0x11fffef50)
at ./../generic/tclProc.c:1082
#3 0x1200367f8 in TclEvalObjvInternal (interp=0x12021ca60,
objc=3,
objv=0x11fffef50, command=0x12024d97c "avSubsCalc 1
0\n", length=15,
flags=0) at ./../generic/tclBasic.c:3087
#4 0x1200378b4 in Tcl_EvalEx (interp=0x12021ca60,
script=0x12024d7f0 "set cam(sv,1,east) {{3 5} {4
8}}\nset cam(sv,1,order) {
2 3 5}\nset cam(sv,1,west) {2 10}\nset cam(sv,2,order)
4\nset cam(sv,2,west) {
4 5}\nset cam(sv,dirs) {east west}\nproc avSubsCalc {cnum
t0 {dir \""...,
numBytes=411, flags=0) at ./../generic/tclBasic.c:3682
#5 0x1200b26a8 in Tcl_FSEvalFile (interp=0x12021ca60,
pathPtr=0x12021a700)
at ./../generic/tclIOUtil.c:1749
#6 0x120010228 in Tcl_Main (argc=1, argv=0x11ffff3f0,
appInitProc=0x12000fba0 <Tcl_AppInit>) at
./../generic/tclMain.c:292
#7 0x12000fb7c in main (argc=2, argv=0x11ffff3e8) at
./../unix/tclAppInit.c:90
msoferplain2004-03-16 02:50:14
Logged In: YES user_id=148712 Confirmed segfault on linux for 8.4.5; neither 8-4-branch nor 8.5a1 show the problem.
dgpplain2004-03-16 02:59:36
Logged In: YES
user_id=80530
With tcl_traceCompile enabled, I see:
Command 6: "catch {set dlist $cam(sv,$cnum,$d} "
(64) beginCatch4 2
(69) push1 7 # "catch"
(71) push1 8 # "set dlist $cam(sv,$cnum,$d"
(73) invokeStk1 2
(75) tryCvtToNumeric
(76) jumpFalse1 5 # pc 81
That looks like the attempt to compile
[catch] first produced a beginCatch4 opcode,
but then the compiler changed its mind and
dropped back to direct string evaluation
of the [catch] command (invokeStk), but
didnt clear away the beginCatch4 opcode?
dgpplain2004-03-16 03:13:36
Logged In: YES user_id=80530 Looks like this is a duplicate of Tcl Bug 705496, and looks like this was fixed only on HEAD, and not backported to 8-4-branch. D'oh! Leaving this open until the backport, FWIW.
msoferplain2004-03-16 03:51:10
Logged In: YES user_id=148712 Fix for 705496 now backported to 8-4-branch. Tcl8.4.6 (last of the 8.4.x?) does not contain this fix, too late for that.
msofer Ticket [916795ffff]: 2 changes
[History diff]2004-03-16 03:51:11
Log in (anonymous is fine) to add a comment.
Attachments:
- crash84.tcl [download] added by dgp on 2004-03-16 01:35:49. [details]