Saturday, 15 September 2012

c++ - Segmentation fault outside of main -



c++ - Segmentation fault outside of main -

i'm working on large, mixed c++/fortran project. currently, executable segfaults on startup, before reaching main, afaict. in fact before loading shared libraries.

some output:

$ ./myprog segmentation fault (core dumped) $ gdb ./myprog core gnu gdb (ubuntu 7.7-0ubuntu3) 7.7 copyright (c) 2014 free software foundation, inc. license gplv3+: gnu gpl version 3 or later <http://gnu.org/licenses/gpl.html> free software: free alter , redistribute it. there no warranty, extent permitted law. type "show copying" , "show warranty" details. gdb configured "x86_64-linux-gnu". type "show configuration" configuration details. bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. find gdb manual , other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. help, type "help". type "apropos word" search commands related "word"... reading symbols ./myprog...done. [new lwp 9194] bt core generated `./myprog'. programme terminated signal sigsegv, segmentation fault. #0 0x0000000000000001 in ?? () (gdb) bt #0 0x0000000000000001 in ?? () #1 0x00007fff08fa02ca in ?? () #2 0x0000000000000000 in ?? ()

also:

$ ld_debug=all ./myprog segmentation fault (core dumped) $ ldd ./myprog linux-vdso.so.1 => (0x00007fffd81fe000) libxerces-c-3.1.so => /usr/lib/x86_64-linux-gnu/libxerces-c-3.1.so (0x00007f774738e000) libxml-security-c.so.17 => /usr/lib/x86_64-linux-gnu/libxml-security-c.so.17 (0x00007f7747083000) libblas.so.3 => /usr/lib/libblas.so.3 (0x00007f7746ab6000) liblapack.so.3 => /usr/lib/liblapack.so.3 (0x00007f774631a000) libboost_serialization.so.1.54.0 => /usr/lib/x86_64-linux-gnu/libboost_serialization.so.1.54.0 (0x00007f77460af000) libboost_filesystem.so.1.54.0 => /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.54.0 (0x00007f7745e98000) libboost_system.so.1.54.0 => /usr/lib/x86_64-linux-gnu/libboost_system.so.1.54.0 (0x00007f7745c94000) libhdf5_cpp.so.7 => /usr/lib/x86_64-linux-gnu/libhdf5_cpp.so.7 (0x00007f7745a43000) libhdf5.so.7 => /usr/lib/x86_64-linux-gnu/libhdf5.so.7 (0x00007f77455a6000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7745388000) libgfortran.so.3 => /usr/lib/x86_64-linux-gnu/libgfortran.so.3 (0x00007f774506f000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7744e6a000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f7744b5f000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7744859000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f7744641000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f774427b000) libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f7743ea1000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f7743c87000) /lib64/ld-linux-x86-64.so.2 (0x00007f7756ed5000) libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x00007f7743a49000)

as can see, depends on fair number of libraries crashes before ld gets load of them. i'm not sure next. suggestions?

this caused compiling object files -fpic , executable -shared.

c++ linker segmentation-fault fortran

No comments:

Post a Comment