Problems with boost.thread

I have some problems with boost.thread (version 1_34) under gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-52). The library ( all the boost distribution) compiles fine and a bjam on the ./libs/thread/test directory also report a successful test execution. However when i try to explicitly link one of the example (tread_group with the boost tread library using the following command line: g++ -I/opt/six/boost_1_33_1 -I/opt/six/boost_1_34/include/boost-1_34 -pthread -o mytest thread_group.cpp libboost_thread-gcc32-mt-d-1_34.so.1.34.0 i get a segmentation fault.
From a core dump i can see the following stacktrace:
0 0x008e78fb in boost::function0<void, std::allocator<boost::function_base> >::assign_to_own (this=0xb75e5420, f=@0xbfffacb0) at ../../../boost/function/function_template.hpp:647 647 f.vtable->manager(f.functor, this->functor, (gdb) backtrace #0 0x008e78fb in boost::function0<void, std::allocator<boost::function_base> >::assign_to_own (this=0xb75e5420, f=@0xbfffacb0) at ../../../boost/function/function_template.hpp:647 #1 0x008e748f in function0 (this=0xb75e5420, f=@0xbfffacb0) at ../../../boost/function/function_template.hpp:527 #2 0x008e6748 in thread_proxy (param=0xbfffac20) at ../../../libs/thread/src/thread.cpp:106 #3 0x0040f371 in start_thread () from /lib/tls/libpthread.so.0 #4 0x001d8ffe in clone () from /lib/tls/libc.so.6 Where is the problem?? Thanks in advance, Luca Regini

On Fri, 8 Jun 2007 14:23:38 +0200 "luca regini" <luca.regini@gmail.com> wrote:
I have some problems with boost.thread (version 1_34) under gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-52). The library ( all the boost distribution) compiles fine and a bjam on the ./libs/thread/test directory also report a successful test execution.
However when i try to explicitly link one of the example (tread_group with the boost tread library using the following command line:
g++ -I/opt/six/boost_1_33_1 -I/opt/six/boost_1_34/include/boost-1_34 -pthread -o mytest thread_group.cpp libboost_thread-gcc32-mt-d-1_34.so.1.34.0
i get a segmentation fault.
Why do you put two -I options? One with boost 1.33.1 and the other with boost 1.34? Maybe that is the problem... Try: g++ -I/opt/six/boost_1_34/include/boost-1_34 \ -o mytest thread_group.cpp \ libboost_thread-gcc32-mt-d-1_34.so.1.34.0 \ -pthread HTH, Raul.

Thank you very much, that was the problem an indeed a very stupid one. I was so concentrating on debugging the source code that i didn't notice that i was including headers from two different boost versions. I apologize and thanks to all the mailing list. Cheers, Luca On 6/10/07, raulh39@ya.com <raulh39@ya.com> wrote:
On Fri, 8 Jun 2007 14:23:38 +0200 "luca regini" <luca.regini@gmail.com> wrote:
I have some problems with boost.thread (version 1_34) under gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-52). The library ( all the boost distribution) compiles fine and a bjam on the ./libs/thread/test directory also report a successful test execution.
However when i try to explicitly link one of the example (tread_group with the boost tread library using the following command line:
g++ -I/opt/six/boost_1_33_1 -I/opt/six/boost_1_34/include/boost-1_34 -pthread -o mytest thread_group.cpp libboost_thread-gcc32-mt-d-1_34.so.1.34.0
i get a segmentation fault.
Why do you put two -I options? One with boost 1.33.1 and the other with boost 1.34?
Maybe that is the problem...
Try: g++ -I/opt/six/boost_1_34/include/boost-1_34 \ -o mytest thread_group.cpp \ libboost_thread-gcc32-mt-d-1_34.so.1.34.0 \ -pthread
HTH, Raul. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
luca regini
-
raulh39@ya.com