Hi,
when trying to compile the attached program with mpiCC I get a
segmentation fault on executing. I compile it with
OMPI_CXX=g++48 mpicxx -g test.cpp
Output on running the compiled program:
~> ./a.out
zsh: segmentation fault (core dumped) ./a.out
I have no idea what's wrong with it. The code seems fine (to me) and
compiling c code or using clang works without problems. Any input on
that?
Attached is the code that crashes and the backtrace of the crash.
Regards,
Gideon Lang
#include <mpi.h>
int main(int argc, char** argv)
{
int size, rank;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Finalize();
return 0;
}
#0 0x0000000000000000 in ?? ()
#1 0x0000000800d6f8af in __cxxabiv1::__dynamic_cast (src_ptr=0x80101b1c0
<(anonymous namespace)::ctype_c>, src_type=0x800ffffb0 <typeinfo for
std::locale::facet>, dst_type=0x800fffd40 <typeinfo for std::ctype<char>>,
src2dst=0) at ../../.././../gcc-4.8.3/libstdc++-v3/libsupc++/dyncast.cc:60
#2 0x0000000800d9b3c0 in std::has_facet<std::ctype<char> > (__loc=...) at
/usr/ports/lang/gcc/work/build/x86_64-portbld-freebsd10.1/libstdc++-v3/include/bits/locale_classes.tcc:110
#3 0x0000000800d90364 in std::basic_ios<char, std::char_traits<char>
>::_M_cache_locale (this=this@entry=0x801019ea8 <std::cout+8>, __loc=...)
at
/usr/ports/lang/gcc/work/build/x86_64-portbld-freebsd10.1/libstdc++-v3/include/bits/basic_ios.tcc:159
#4 0x0000000800d904b0 in std::basic_ios<char, std::char_traits<char> >::init
(this=this@entry=0x801019ea8 <std::cout+8>, __sb=0x801019780
<__gnu_internal::buf_cout_sync>)
at
/usr/ports/lang/gcc/work/build/x86_64-portbld-freebsd10.1/libstdc++-v3/include/bits/basic_ios.tcc:132
#5 0x0000000800d82b51 in basic_ostream (__sb=<optimized out>, this=<optimized
out>, __in_chrg=<optimized out>, __vtt_parm=<optimized out>)
at
/usr/ports/lang/gcc/work/build/x86_64-portbld-freebsd10.1/libstdc++-v3/include/ostream:85
#6 std::ios_base::Init::Init (this=<optimized out>) at
../../../.././../gcc-4.8.3/libstdc++-v3/src/c++98/ios_init.cc:91
#7 0x0000000000408271 in __static_initialization_and_destruction_0
(__initialize_p=1, __priority=65535) at
/usr/local/lib/gcc48/include/c++/iostream:74
#8 0x000000000040829a in _GLOBAL__sub_I_main () at test.cpp:11
#9 0x00000008006137a0 in ?? () from /libexec/ld-elf.so.1
#10 0x0000000800612d17 in ?? () from /libexec/ld-elf.so.1
#11 0x0000000800611129 in ?? () from /libexec/ld-elf.so.1
#12 0x0000000000000000 in ?? ()