Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 5d801afee08985461c4b2009df732eb5a535d28b
Ticket: 3166410fffffffffffffffffffffffffffffffff
"out of stack space" on AIX
User & Date: starwalker2000 on 2011-01-27 07:39:43
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    I've got "out of stack space" error on AIX when running 32bits-tclsh. No such error of 64bits-tclsh.
    I've traced the code of tcl, I found following problem:
    
    [1] stopped in TclpGetCStackParams at line 1095 in file "/tellin/hjw/tcl8.5.9/unix/../unix/tclUnixInit.c" ($t1)
     1095               tsdPtr->stackBound = (int *) ((char *)tsdPtr->outerVarPtr -
    (dbx) n
    stopped in TclpGetCStackParams at line 1097 in file "/tellin/hjw/tcl8.5.9/unix/../unix/tclUnixInit.c" ($t1)
     1097           } else {
    (dbx) p tsdPtr->outerVarPtr
    0x2ff22460
    (dbx) p stackSize
    2147450878
    (dbx) print tsdPtr->stackBound
    0xaff2a462
    
    According to the message above, the stackSize is a very great value, almost 2G, and tsdPtr->stackBound is a overflowed number. This cause following code returns false:
    #define CheckCStack(iPtr, localIntPtr) \
       ((localIntPtr) > (iPtr)->stackBound)
    (dbx) p &localInt
    0x2ff221a0
    (dbx) p iPtr->stackBound
    0xaff2a462
    
    For 64bits-tclsh, the situation is as follows:
    [1] stopped in TclpGetCStackParams at line 1095 in file "/tellin/hjw/tcl8.5.9-64/unix/../unix/tclUnixInit.c" ($t1)
     1095               tsdPtr->stackBound = (int *) ((char *)tsdPtr->outerVarPtr -
    (dbx) n
    stopped in TclpGetCStackParams at line 1097 in file "/tellin/hjw/tcl8.5.9-64/unix/../unix/tclUnixInit.c" ($t1)
     1097           } else {
    (dbx) print tsdPtr->outerVarPtr
    0x0ffffffffffff140
    (dbx) print stackSize
    4294934528
    (dbx) print tsdPtr->stackBound
    0x0fffffff00007140
    
    The stackSize is amost 4G, but tsdPtr->stackBound is not overflowed. So the CheckCStack returns true.
    
  4. foundin changed to: "obsolete: 8.5.9"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "starwalker2000"
  10. subsystem changed to: "None"
  11. title changed to: ""out of stack space" on AIX"
  12. type changed to: "Bug"