Boost logo

Boost Users :

From: Michael Peterson (mtp1032_at_[hidden])
Date: 2005-01-14 14:54:16


The following program sustains a segfault and, since the program is so
simple, I have to believe the problem lies in my setup/system/build. I
hope someone can provide me with some advice as to how I might proceed
to further diagnose this problem. To this end, I've provided my system
configuration, the compiler and linker options, the source code of the
offending program, and a gdb stack trace at the point at which the
segfault was sustained.

(1) Here's what uname -a reveals:
linux 2.6.3-7mdk-i686-up-4GB #1 Wed Mar 17 15:17:23 CET 2004 i686
unknown unknown GNU/Linux

(2) The code is compiled using g++ 3.3.2 with the following flags:
-ggdb3 -Wall -Wstrict-prototypes -D__USE_POSIX -D_REENTRANT,

(3) I link the compiled code against libboost_test_exec_monitor.so
(V1.32.0) and libstlport_gcc.so (4.6.2).

(4) Here's the source file -- Note that this is pure BOOST code.

#include <boost/test/test_tools.hpp>

bool test1()
{
    return( true );
}

int test_main( int argc, char * argv[] )
{
    BOOST_CHECK( test1() == true );
    return( 0 );
}

(5) Here is the gdb stack trace taken after the segfault.

(gdb) run
Starting program: /home/michael/sde/pthreads-1.0/src/private/test
[Thread debugging using libthread_db enabled]
[New Thread 1078715360 (LWP 3872)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1078715360 (LWP 3872)]
0x400bcd79 in _STL::locale::locale() () from
/usr/local/lib/stlport/libstlport_gcc.so
(gdb) bt
#0 0x400bcd79 in _STL::locale::locale() () from
/usr/local/lib/stlport/libstlport_gcc.so
#1 0x4008c88d in _STL::ios_base::ios_base() () from
/usr/local/lib/stlport/libstlport_gcc.so
#2 0x0804d83b in basic_ios (this=0x400f05e8) at _ios.c:95
#3 0x4008e831 in _STL::basic_istream<char, _STL::char_traits<char>
>::basic_istream(_STL::basic_streambuf<char, _STL::char_traits<char> >*)
()
   from /usr/local/lib/stlport/libstlport_gcc.so
#4 0x4009e04d in _STL::ios_base::_S_initialize() () from
/usr/local/lib/stlport/libstlport_gcc.so
#5 0x4009de56 in _STL::ios_base::Init::Init() () from
/usr/local/lib/stlport/libstlport_gcc.so
#6 0x40159675 in __static_initialization_and_destruction_0
(__initialize_p=1, __priority=65535) at iostream:75
#7 0x4015972b in
_GLOBAL__I__ZN5boost9unit_test9ut_detail25msvc65_like_log_formatterC2ERK
NS0_13unit_test_logE () at _iterator.h:153
#8 0x40159bb7 in __do_global_ctors_aux () from
/usr/local/lib/boost/libboost_test_exec_monitor.so
#9 0x401275d1 in _init () from
/usr/local/lib/boost/libboost_test_exec_monitor.so
#10 0x4000cdc9 in _dl_init (main_map=Variable "main_map" is not
available.
) at dl-init.c:68
#11 0x40000ca5 in _dl_start_user () at dl-machine.h:400
(gdb)

Thanks, in advance

Michael


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net