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

obsolete: 8.4.4
closed
5
2003-10-04
2003-10-02
No

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'.

Discussion

  • David N. Welton

    David N. Welton - 2003-10-02
    • priority: 5 --> 8
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2003-10-02

    Logged In: YES
    user_id=72656

    Note this is only in the head - not 8.4. Tested on Linux.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2003-10-02
    • milestone: --> 284128
     
  • Joe Mistachkin

    Joe Mistachkin - 2003-10-03

    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.

     
  • Donal K. Fellows

    • priority: 8 --> 9
     
  • Nobody/Anonymous

    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.

     
  • miguel sofer

    miguel sofer - 2003-10-03

    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.

     
  • miguel sofer

    miguel sofer - 2003-10-03
    • assigned_to: msofer --> hobbs
     
  • miguel sofer

    miguel sofer - 2003-10-03

    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.

     
  • miguel sofer

    miguel sofer - 2003-10-03

    Logged In: YES
    user_id=148712

    can't repro with core-8-4-branch

     
  • miguel sofer

    miguel sofer - 2003-10-04

    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.

     
  • miguel sofer

    miguel sofer - 2003-10-04
    • priority: 9 --> 5
    • milestone: 284128 --> obsolete: 8.4.4
    • status: open --> closed
     
  • miguel sofer

    miguel sofer - 2003-10-04

    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

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks