[Insight-developers] SGI Execution Problems

Bill Hoffman bill.hoffman@kitware.com
Mon, 17 Feb 2003 10:08:24 -0500


Actually, if the -D_PTHREADS is removed from the ITK, build this should work.
The SGI stream library is thread safe, but if you compile with -D_PTHREADS as
we do with ITK right now.   The iostream library was not compiled with that
option, so it crashes because object sizes change.    We are looking into
removing the -D_PTHREADS option from the SGI and removing the iostream library
from ITK.

-Bill



At 11:20 PM 2/14/2003 -0500, Lorensen, William E (Research) wrote:
>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
>===================================================================
>
>_______________________________________________
>Insight-developers mailing list
>Insight-developers@public.kitware.com
>http://public.kitware.com/mailman/listinfo/insight-developers