I'm trying to compile and run a very simple unit test using the boost
test library on Windows with MinGW, and I'm running into a segfault
problem. I searched around the issue, and it seems I've found references
to such an issue from 2003:
http://lists.boost.org/Archives/boost/2003/09/52920.php
and there Jeff Garland says it's been fixed already. has it?
I'm thinking it's the same issue based on this ticket:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11838
which points to the boost mailing list archive entry above.
the test code is simply:
#include
using namespace boost::unit_test;
void test() {
BOOST_CHECK(true);
}
test_suite *
init_unit_test_suite(int, char **) {
test_suite *ts = BOOST_TEST_SUITE("Test");
ts->add(BOOST_TEST_CASE(&test));
framework::master_test_suite().add(ts);
return 0;
}
compiled with the following Makefile:
CFLAGS=-I${INCLUDE_DIR}
LDFLAGS=-enable-stdcall-fixup -Wl,-enable-auto-import
-Wl,-enable-runtime-pseudo-reloc -mthreads -Wl,-subsystem,windows
-L${LIB_DIR}
test: test.o
g++ ${LDFLAGS} test.o -lboost_unit_test_framework-mt
-lboost_test_exec_monitor-mt -o test
test.o: test.cpp
g++ ${CFLAGS} -c -o test.o test.cpp
and gdb says:
Program received signal SIGSEGV, Segmentation fault.
0x00418e7c in global constructors keyed to
_ZN5boost9unit_test64_GLOBAL__N_libs_
test_src_unit_test_monitor.cpp_3F6EE7DC_ED9224E217unit_test_monitorE ()
(gdb) bt
#0 0x00418e7c in global constructors keyed to
_ZN5boost9unit_test64_GLOBAL__N_l
ibs_test_src_unit_test_monitor.cpp_3F6EE7DC_ED9224E217unit_test_monitorE ()
#1 0x004273f7 in __main ()
#2 0x00401c78 in main ()
this is on a Windows XP box, with gcc 3.4.2 MinGW, using boost 1.35.0
am I doing something wrong?
Akos