[Insight-developers] SGI Execution Problems

Lorensen, William E (Research) lorensen@crd.ge.com
Fri, 14 Feb 2003 23:20:22 -0500


This is a known problem for sgi's with multiple cpu's. It's because SGI streams are not thread safe.
In your CMakeCache.txt file, set
ITK_USE_SYSTEM_STDLIB:BOOL=OFF

-----Original Message-----
From: Hans Johnson [mailto:hjohnson@mail.psychiatry.uiowa.edu]
Sent: Friday, February 14, 2003 7:17 PM
To: insight-developers@public.kitware.com
Subject: [Insight-developers] SGI Execution Problems


ITK Build Experts,

I am attempting to build and test Insight on an SGI (IRIX 6.5.13m) for 
nightly regression testing.  All of the test executables are causing 
segmentation faults and failing.  I have it compiling without errors, 
but when the executables are run, they seg fault on std::cout commands.

The following is an example from the itkModifiedTimeTest.cxx test:
line 32   std::cout<<"BB time before modification: "<< bbBeforeTime 
<<std::endl;

causes a segmentation fault:
Here is the stack trace:
std::basic_ios<char,std::char_traits<char> >::rdbuf,
FP=7fff2bd0
std::basic_ostream<char,std::char_traits<char> >::sentry::sentry, 
        FP=7fff2c30
std::basic_ostream<char,std::char_traits<char> >::_M_put_nowiden, 
        FP=7fff2d10
std::operator<<,     FP=7fff2d30
itkModifiedTimeTest, FP=7fff2e20
main,                FP=7fff2ec0
      __start,        FP=7fff2ed0

In addition, I have added the CMakeCache.txt file so that you can see 
the compiler options used.

I have used these C++ compiler flags for the last 3 years with other 
projects, and they have never displayed this behavior.  In addition, I 
have done this test on two separate computers.  Any help would be 
greatly appreciated.


=======================================================================
Distilled test:
cat xx.cxx
#include <iostream>
int main(int , char **)
{
   std::cout << "Hello World" << std::endl;
   return 0;
}

Used gmake -n to determine compile time options used for ITK and 
transferred to a compile script:

1) TEST 0
cat newtest.sh
CC -L/home/scratch/hjohnson/Testing/SGI/DEBUG/lib -L/usr/freeware/lib32 
-n32 -g -DUDEBUG -xansi -LANG:std -LANG:ansi-for-init-scope=ON -fullwarn 
-woff 1110,1424,1468,1375,1209 -LANG:std -D_PTHREADS xx.cxx -o xx.exe 
-lpthread -lm -lVXLNumerics -lm -lITKCommon -lm -lVXLNumerics -lpthread 
-lm -Wl,-rpath,/home/scratch/hjohnson/Testing/SGI/DEBUG/lib
RESULT: ./xx.exe
Segmentation fault (core dumped)
2) TEST 1
CC  -n32 -g -DUDEBUG -xansi -LANG:std -LANG:ansi-for-init-scope=ON 
-fullwarn -woff 1110,1424,1468,1375,1209 -LANG:std -D_PTHREADS xx.cxx -o 
xx.exe -Wl,-rpath,/home/scratch/hjohnson/Testing/SGI/DEBUG/lib
RESULT: ./xx.exe
Hello World
Bus error (core dumped)
3) TEST 2
CC  -n32 -g -DUDEBUG -xansi -LANG:std -LANG:ansi-for-init-scope=ON 
-fullwarn -woff 1110,1424,1468,1375,1209 xx.cxx -o xx.exe 
-Wl,-rpath,/home/scratch/hjohnson/Testing/SGI/DEBUG/lib
RESULT: ./xx.exe
Hello World
========================================================================

It looks like the -D_PTHREADS is causing the problems, but I don't know 
where it was set.


Thanks,
Hans

===================================================================
Hans J. Johnson                              W294 GH
hans-johnson@uiowa.edu                       Dept. of Psychiatry
http://www.psychiatry.uiowa.edu/~hjohnson    The University of Iowa
(319) 353-8587                               Iowa City, IA 52242
===================================================================