Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2003-10-05
01:31 • Ticket [816641ffff] proc f {args} { f bee bop } ; f crashes tcl status still... artifact: 6ec3440c64 user: msofer
2003-10-04
23:14 • Closed ticket [816641ffff]. artifact: eb2b72e1b9 user: msofer
2003-10-03
22:05 • Ticket [816641ffff]: 4 changes artifact: 3bd30e9c4a user: msofer
22:00 • Ticket [816641ffff]: 5 changes artifact: 6be685d5d5 user: msofer
20:56 • Ticket [816641ffff]: 4 changes artifact: 896e746729 user: msofer
17:42 • Ticket [816641ffff]: 4 changes artifact: cd7feeb393 user: nobody
17:04 • Ticket [816641ffff]: 1 change artifact: 50469a7d48 user: dkf
14:34 • Ticket [816641ffff]: 4 changes artifact: e029d864d9 user: mistachkin
00:34 • Ticket [816641ffff]: 1 change artifact: 6ec5a5360f user: hobbs
00:33 • Ticket [816641ffff]: 4 changes artifact: eff36ee1ea user: hobbs
2003-10-02
23:10 • Ticket [816641ffff]: 1 change artifact: 797abeac60 user: davidw
16:09 • New ticket [816641ffff]. artifact: 1160780ebc user: davidw

proc f {args} { f bee bop } ; f crashes tcl

Closed816641ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 23 years ago
Descriptionplain2003-10-02 16:09:11
proc f {args} { f bee bop } ; f

will crash Tcl with the following error:

TclExecuteByteCode: abnormal return at pc 6: stack top
-38780 < entry stack top 1991
TclExecuteByteCode execution failure: end stack top <
start stack top
Aborted (core dumped)

lowering the recursion levels permitted with 'interp
recursionlimit' makes the bug 'go away'.
davidw Ticket [816641ffff]: 1 change [History diff]2003-10-02 23:10:01
hobbsplain2003-10-03 00:33:54
Logged In: YES 
user_id=72656

Note this is only in the head - not 8.4.  Tested on Linux.
hobbs Ticket [816641ffff]: 1 change [History diff]2003-10-03 00:34:26
mistachkinplain2003-10-03 14:34:12
Logged In: YES 
user_id=113501

Note that with my unix stack checking patch (#746378), 
things like this bug would be far less likely to happen, unless I 
am misunderstanding the bug report.
dkf Ticket [816641ffff]: 1 change [History diff]2003-10-03 17:04:59
nobodyplain2003-10-03 17:42:13
Logged In: NO 

I do not think this is a running out of C stack, it is a
tcle valuation stack issue. My latest commit to TEBC seems
to be mishandling the evaluation stack growth mechanism.
How do I know? I happen to have a modified tree with a
different approach to the evaluation stack, and it doesn't bomb.
msoferplain2003-10-03 20:56:28
Logged In: YES 
user_id=148712

Doh - my bad. The catchStackPtr is not being updated when
the stack grows. One symptom is this bug, as catchStackPtr
is used to update eePtr->tosPtr on exit. But the corruption
runs deeper ...
Fix forthcoming.
msoferplain2003-10-03 22:00:15
Logged In: YES 
user_id=148712

Jeff: could you confirm (or not) that the following bombs in
AS's 8.4.4 too? You can then reassign the bug to me.

I added the following test to tests/execute.test:

test execute-8.2 {Stack restoration} {
    # Test for [Bug #816641], correct restoration
    # of the stack top after the stack is grown
     proc f {args} { f bee bop }
     catch f msg
     set msg
 } {too many nested evaluations (infinite loop?)}

and now I get a segfault in 8.4.4 too

% info patch
8.4.4
% package require tcltest
2.2.4
% namespace import ::tcltest::*
% source ../tests/execute.test
Segmentation fault (core dumped)

This could not be reproduced on 8.4.4 by Don Porter.
msoferplain2003-10-03 22:05:53
Logged In: YES 
user_id=148712

can't repro with core-8-4-branch
msoferplain2003-10-04 23:14:08
Logged In: YES 
user_id=148712

Bug fixed in HEAD.
Cannot confirm the segfault in core-8-4-branch, but still
getting a segfault in AS-Tcl8.4.4 on linux: leaving open for
confirmation.
msoferplain2003-10-05 01:31:30
Logged In: YES 
user_id=148712

The segfault in 8.4.4 seems to be something completely
different:
(a) the bug I fixed in HEAD was due to a bug in a
modification to TEBC that was never applied in the 8.4 branch
(b) the stack trace of the 8.4 segfault suggests something
different (although you necer know in mem corruption cases,
do you?):

#0  0x00000000 in ?? ()
#1  0x40082cbc in SetStringFromAny ()
   from /.hda3/.SYSTEM/opt/ActiveTcl-8.4.4.0/lib/libtcl8.4.so
#2  0x400825b8 in Tcl_AppendObjToObj ()
   from /.hda3/.SYSTEM/opt/ActiveTcl-8.4.4.0/lib/libtcl8.4.so
#3  0x40088420 in TclPtrSetVar () from
/.hda3/.SYSTEM/opt/ActiveTcl-8.4.4.0/lib/libtcl8.4.so
#4  0x400881c0 in Tcl_ObjSetVar2 () from
/.hda3/.SYSTEM/opt/ActiveTcl-8.4.4.0/lib/libtcl8.4.so
#5  0x40035558 in Tcl_AddObjErrorInfo ()
   from /.hda3/.SYSTEM/opt/ActiveTcl-8.4.4.0/lib/libtcl8.4.so
#6  0x40033a14 in Tcl_LogCommandInfo ()
   from /.hda3/.SYSTEM/opt/ActiveTcl-8.4.4.0/lib/libtcl8.4.so
#7  0x40058d2e in TclExecuteByteCode ()
   from /.hda3/.SYSTEM/opt/ActiveTcl-8.4.4.0/lib/libtcl8.4.so
#8  0x40053c34 in TclCompEvalObj () from
/.hda3/.SYSTEM/opt/ActiveTcl-8.4.4.0/lib/libtcl8.4.so
#9  0x4007e242 in TclObjInterpProc ()
   from /.hda3/.SYSTEM/opt/ActiveTcl-8.4.4.0/lib/libtcl8.4.so
#10 0x4003368d in TclEvalObjvInternal ()
   from /.hda3/.SYSTEM/opt/ActiveTcl-8.4.4.0/lib/libtcl8.4.so
#11 0x4005476a in TclExecuteByteCode ()
   from /.hda3/.SYSTEM/opt/ActiveTcl-8.4.4.0/lib/libtcl8.4.so
Log in (anonymous is fine) to add a comment.