Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2010-08-05
03:16 • Closed ticket [2935978fff]: Segfault on AIX 5 using tcl 8.5.8 plus 6 other c... artifact: 9d6d866aa8 user: hobbs
2010-01-23
03:50 • Ticket [2935978fff]: 4 changes artifact: ef745183f1 user: wealthychef
2010-01-22
14:38 • Ticket [2935978fff]: 4 changes artifact: 74f78cb872 user: ferrieux
08:41 • Ticket [2935978fff]: 4 changes artifact: 34f9e4687c user: hobbs
07:20 • Ticket [2935978fff]: 4 changes artifact: 12663e6c89 user: wealthychef
05:20 • Ticket [2935978fff]: 5 changes artifact: 1a0e4ebbbc user: hobbs
05:14 • Ticket [2935978fff]: 1 change artifact: f957eb019c user: ferrieux
2010-01-21
14:32 • Ticket [2935978fff]: 4 changes artifact: 2286be8e40 user: ferrieux
09:12 • Ticket [2935978fff]: 2 changes artifact: 4993b35b84 user: dgp
09:12 • Ticket [2935978fff]: 5 changes artifact: f448fd3727 user: dgp
00:45 • New ticket [2935978fff]. artifact: 2bad3f876a user: wealthychef

Segfault on AIX 5 using tcl 8.5.8

Closed / Invalid2935978fffffffffffffffffffffffffffffffffCreated 17 years agoUpdated 16 years ago
Descriptionplain2010-01-21 00:45:16
I tried to build Tcl on our AIX cluster and get a segfault.   

        xlc -g -g -qlanglvl=extended -qcpluscmt -DTCL_NO_STACK_CHECK=1 -g -qlanglvl=extended -qcpluscmt -DTCL_NO_STACK_CHECK=1    tclTestInit.o tclTest.o tclTestObj.o tclTestProcBodyObj.o  tclThreadTest.o tclUnixTest.o -L/usr/global/tools/vmd/1.8.7/aix_5_64_fed/src/tcl8.5.6/unix -ltcl8.5 -ldl  -lc -lm -lbsd   -L/usr/global/tools/vmd/1.8.7/aix_5_64_fed/src/tcl8.5.6/unix -o tcltest
        LIBPATH="`pwd`:${LIBPATH}"; export LIBPATH;  TCL_LIBRARY="/usr/global/tools/vmd/1.8.7/aix_5_64_fed/src/tcl8.5.6/library"; export TCL_LIBRARY;  ./tcltest /usr/global/tools/vmd/1.8.7/aix_5_64_fed/src/tcl8.5.6/unix/../tests/all.tcl 
make: The signal code from the last command is 11.


Stack Trace: 
tack Trace
C    TclExecuteByteCode, FP=fffffffffff45b0
C    TclObjInterpProcCore, FP=fffffffffff7000
C    TclObjInterpProc, FP=fffffffffff71b0
C    TclEvalObjvInternal, FP=fffffffffff7230
C    TclExecuteByteCode, FP=fffffffffff74a0
C    TclObjInterpProcCore, FP=fffffffffff9ef0
C    TclObjInterpProc, FP=fffffffffffa0a0
C    TclEvalObjvInternal, FP=fffffffffffa120
C    TclExecuteByteCode, FP=fffffffffffa390
C    TclObjInterpProcCore, FP=fffffffffffcde0
C    TclObjInterpProc, FP=fffffffffffcf90
C    TclEvalObjvInternal, FP=fffffffffffd010
C    TclEvalObjvInternal, FP=fffffffffffd280
C    TclEvalEx,        FP=fffffffffffd4f0
C    Tcl_EvalEx,       FP=fffffffffffd720
C    PkgRequireCore,   FP=fffffffffffd790
C    Tcl_PkgRequireProc, FP=fffffffffffd9d0
C    Tcl_PackageObjCmd, FP=fffffffffffda50
C    TclEvalObjvInternal, FP=fffffffffffdc80
C    TclEvalEx,        FP=fffffffffffdef0
C    Tcl_EvalEx,       FP=fffffffffffe120
C    Tcl_FSEvalFileEx, FP=fffffffffffe190
C    Tcl_Main,         FP=fffffffffffe360
C    main,             FP=fffffffffffe700
    .__start,         FP=fffffffffffe770


source view in TclEvalObjvInternal():  

3682      cmdPtr->refCount++;
3683      iPtr->cmdCount++;
3684      if (code == TCL_OK && traceCode == TCL_OK
3685              && !TclLimitExceeded(iPtr->limit)) {
3686          if (TCL_DTRACE_CMD_ENTRY_ENABLED()) {
3687              TCL_DTRACE_CMD_ENTRY(TclGetString(objv[0]), objc - 1,
3688                      (Tcl_Obj **)(objv + 1));
3689          }
 =>          code = (*cmdPtr->objProc)(cmdPtr->objClientData, interp, objc, objv);
3691          if (TCL_DTRACE_CMD_RETURN_ENABLED()) {
3692              TCL_DTRACE_CMD_RETURN(TclGetString(objv[0]), code);
3693          }
3694      }
3695
dgpplain2010-01-21 09:12:33
From a quick look, I don't know what's wrong,
but it is certainly not a problem in the tcltest package.

Passing the buck wildly...  If, as I suspect, none of
the usual maintainers have an AIX system to work on,
we may need you to either diagnose in more detail on
your own, or interact with someone who can give you
things to try on your AIX system.
dgp Ticket [2935978fff]: 2 changes [History diff]2010-01-21 09:12:34
ferrieuxplain2010-01-21 14:32:17
Ouch. No AIX here indeed.
A few random shots in the dark:

- the title mentions 8.5.8, the directories are named 8.5.6. Typo ?

- the linker line above seems to have every option repeated. Is it the Makefile generated by ./configure, or is it homegrown ?

- it seems to be a threaded debug build, while ISTR xlc has certain needs regarding threading (options, order of headers). Can you check these requirements are met ?

- can you try gcc ?
ferrieux Ticket [2935978fff]: 1 change [History diff]2010-01-22 05:14:03
hobbsplain2010-01-22 05:20:49
Why are you using non-TEA compiler options?  Have you had any issues when working with pure core configure?  I know that works.
wealthychefplain2010-01-22 07:20:51
@dgp:  No worries, I'm willing to work with you guys to find a solution.  

@ferrieux:  Sorry, my bad, I have tried with 8.5.8 and wanted to try 8.5.6 as the maintainer of the VMD software package told me it had worked for him on AIX 6.  I'm 95% sure it's the exact same line segfaulting in 8.5.8, but I'm rebuilding right now to confirm this.  
The repeated options are probably because I set CFLAGS, CPPFLAGS, and CXXFLAGS to be all the same.  Force of habit.  The configure script was hacked in this particular instance to add the  DTCL_NO_STACK_CHECK thing, but it segfaults with or without that hack.  The hack does not change the logic, it simply adds that flag.  
What requirements are you talking about WRT xlc threading options?  I didn't follow that part.  Can you be more specific? 
I'll try gcc, although that might be murky territory.  As long as it works, I don't care!  I just  

@hobbs:  I don't know what TEA is.  If you're talking about DTCL_NO_STACK_CHECK, I added it to try to fix the problem, but it has no effect.  What is pure core configure?  Do you mean just configure without any options?  The options I'm using are: 
    export CC=xlc
    export CXX=xlC
    export LD=xlC
    # John Stone suggests -DTCL_NO_STACK_CHECK=1
    export CPPFLAGS="-g -qlanglvl=extended -qcpluscmt -DTCL_NO_STACK_CHECK=1"
    export CFLAGS="$CPPFLAGS"
    export CXXFLAGS="$CPPFLAGS"
    export SHLIB_SUFFIX=".a"
    export LD_FLAGS="-bmaxdata:0x80000000" # ala John Stone

    TCL_CONFIG_OPTIONS="--disable-shared --disable-threads"
   ./configure ${TCL_CONFIG_OPTIONS} --prefix=/usr/global/tools/vmd/1.8.7/$SYS_TYPE/
    sedfiles 's/-O/-g/' Makefile
hobbsplain2010-01-22 08:41:40
TEA is the Tcl Extension Architecture and in this case refers to the tcl.m4 and configure magic all built to support each arch.  I have 8.5 threaded working without any problems, and that is done only with CC=xlc_r and /usr/vac/bin on the path.

With that and following the standard instructions (./configure; make test), it should work.  This means none of the other flags you are using.
ferrieuxplain2010-01-22 14:38:41
Ah, "xlc_r", right, thanks Jeff. That's what I was half-remembering :-}
The "_r" means "reentrant", though I have no idea why the compiler must be so different do deserve a specific executable in that case.

Richard, simple advice: if you observe a bug that is unchanged by various tweaks, by all means post the bug report _without_ the tweaks ! Clearly they bring no light to the investigation, but are a direct source of red herrings ;-)

So, can you clarify what in your case differs from "./configure" out of necessity ?
wealthychefplain2010-01-23 03:50:56
OK, sorry, sorry, I screwed up.  It looks like one of the clever options I was passing was the problem the whole time.  I compile as follows and all is well now: 

    export CC=xlc
    export CXX=xlC
    export SHLIB_SUFFIX=".a"
    TCL_CONFIG_OPTIONS="--disable-shared"
      ./configure ${TCL_CONFIG_OPTIONS} --prefix=/usr/global/tools/vmd/1.8.7/$SYS_TYPE/
    sedfiles 's/-O/-g/' Makefile
    gmake || errexit "tcl build failed"
    gmake test || errexit "tcl make test failed"
    gmake install || errexit "tcl install failed"

Thanks for the help.  VMD is now working for me, which it was not before. 
The reason for the --disable-shared and SHLIB_SUFFIX thing is that xlC does not recognize the .so suffix on AIX.  
By the way, I agree, why would anyone compile without reentrant ability anyhow?  Why even make an xlc without the _r?
hobbsplain2010-08-05 03:16:14
allow_comments - 1
Log in (anonymous is fine) to add a comment.