Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Stack space check fails on AIX

Closed1889719fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 18 years ago
Descriptionplain2008-02-08 16:46:21
 I am trying to build/tect/install tcl on an aix 5.2 using gcc 2.9.

/usr2/projets/paltech/amorce/sources/tcl8.5.1/unix/configure --enable-threads --disable-load --disable-shared --disable-langinfo --prefix=/usr2/projets/paltech/amorce/racine 
make 

all this seems to be OK

"make test" fail with the following error

LIBPATH=`pwd`:${LIBPATH}; export LIBPATH; \
        TCL_LIBRARY="/usr2/projets/paltech/amorce/sources/tcl8.5.1/library"; export TCL_LIBRARY; \
        ./tcltest /usr2/projets/paltech/amorce/sources/tcl8.5.1/unix/../tests/all.tcl
application-specific initialization failed: out of stack space (infinite loop?)
out of stack space (infinite loop?)
    while executing
"package require Tcl 8.5"
    (file "/usr2/projets/paltech/amorce/sources/tcl8.5.1/unix/../tests/all.tcl" line 15)


I've tried another build from scratch with --disable-threads => same result

this problem desn't seem to be fixed for this platform
msoferplain2008-02-08 23:55:22
Logged In: YES 
user_id=148712
Originator: NO

WORKAROUND
define CFLAGS="-DTCL_NO_STACK_CHECK=1" at configure time, or edit the makefile to add that definition.

FIX
I'll appreciate contact info, and please log in to sourceforge so that we can communicate via this bug ticket. I do not have AIX anyqhere near me, so I'll need your collaboration to fix this.
[email protected]plain2008-02-10 20:40:03
Logged In: NO 

This might be helpful?
https://computing.llnl.gov/mpi/aix_stack.html
[email protected]plain2008-02-10 20:47:11
Logged In: NO 

Default stack on PowerPC seems to be very low, just 192kB see:
https://computing.llnl.gov/tutorials/pthreads/
[email protected]plain2008-04-02 13:44:50
Logged In: NO 

I have the same problem on my AIX 5.3 and the "workaround" does give the same error.
There is however an Warning message during ./configure and that message is:
Warning: Can't figure out how to do dynamic loading or shared libraries on this system

Only ./configure (without --enable-threads --disable-load --disable-shared --disable-langinfo works)
The error refers to the file /mqm/tcl8.5.1/unix/../tests/all.tcl and line 15
line 15 says: package require Tcl 8.5

does this mean that tcl 8.5.1 is an upgrade installation and not an initial installation ?
msoferplain2008-04-02 19:48:24
Logged In: YES 
user_id=148712
Originator: NO

192kB stack? That is very low, Please try to increase the stack size.
msofer Pending ticket [1889719fff]. [History diff]2008-06-28 20:45:41
cnassauplain2008-07-02 13:25:25
Logged In: YES 
user_id=902560
Originator: NO

We've been seeing the same failure on various AIXes, most recently on a machine where "ulimit -s" reported "hard" which allegedly means a full 4GB stack. Tcl worked after *decreasing* the stack size with "ulimit -s 32768".

To debug this I've added some "fprintf"'s to 
GetStackSize and TclpGetCStackParams which log the return values. The following failure happens on AIX 5.1 with Tcl 8.5.3, built using xlC_r:

[cnassau] bluebull(AIX[5.1.0.0]):unix/$ make install
Installing libtcl8.5.so to /space/cnassau/tcl/lib/
Installing libtcl8.5.exp to /space/cnassau/tcl/lib/
Installing tclsh as /space/cnassau/tcl/bin/tclsh8.5
Installing tclConfig.sh to /space/cnassau/tcl/lib/
Installing libtclstub8.5.a to /space/cnassau/tcl/lib/
Installing time zone data
GetStackSize: stacksize = 7fff7ffe, rawStacksize = 7ffffffe
TclpGetCStackParams: outerVarPtr = 2ff22410, stackBound = aff2a412, stackGrowsDown =1
application-specific initialization failed: out of stack space (infinite loop?)
out of stack space (infinite loop?)
    while executing
"proc copyDir { d1 d2 } {

    puts [format {%*sCreating %s} [expr { 4 * [info level] }] {} \
              [file tail $d2]]

    file delete -force -- $d2
  ..."
    (file "/home/cnassau/src/tcl8.5.3/unix/../tools/installData.tcl" line 23)
make: *** [install-tzdata] Error 1

I'm not sure if I'm reading this correctly but it seems the allowable stack region consists of [0, 2ff22410] and [aff2a412, ffffffff]. Could this be a problem for the stack check?
msoferplain2008-07-02 18:05:42
Logged In: YES 
user_id=148712
Originator: NO

I still recommend the workaround in the first post below: disable stack checking! That is, compile with -DTCL_NO_STACK_CHECK=1.

What your numbers mean: whenever outerVarPtr<stackBound Tcl thinks you blew the stack (because stackGrowsDown=1, otherwise it'de be >)

What the result probably means is: AIX is not satisfying the assumptions for that code, so that either 
 (a) the whole approach fails
 (b) stackBound and/or stackGrowsDown are not set properly to begin with

The whole stack checking will be eliminated before 8.6.1: it is ugly, hacky, not-really-portable as you're finding out. It cannot be done both correct and portable. And it will not be as necessary due to other changes that will be coming in.
sf-robotplain2008-07-17 09:20:48
Logged In: YES 
user_id=1312539
Originator: NO

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
Log in (anonymous is fine) to add a comment.