NERSCPowering Scientific Discovery Since 1974

Resolved - Segfaults when mixing C/C++ and Fortran under PrgEnv-gnu

February 24, 2011


If a code has C/C++ and Fortran routines, it does I/O in a Fortran code and it is built with the GNU compiler, the built executable can generate a segfault during runtime with the following error message:


[NID 03978] 2011-02-12 11:10:53 Apid 599991: initiated application termination
Application 59991 exit signals: Segmentation fault, Killed
Application 599991 resources: utime ~1s, stime ~0s


This happens with xt-asyncpe/4.7. Cray has provided the following workaround:


% CC -c main.cpp

% ftn -c sub.f

% CC main.o sub.o -u pthread_mutex_trylock -u pthread_mutex_destroy -u pthread_create


% CC -dynamic main.o sub.o



The bug is fixed in xt-asyncpe/4.9 which was released on March 17, 2011 and installed as the default version on March 24, 2011. The workaround doesn't need to be applied any more.