Boost logo

Boost Users :

Subject: Re: [Boost-users] Asio example 5 sagmentation fault
From: Anthony Foiani (tkil_at_[hidden])
Date: 2011-09-04 01:31:34


Alessandro Candini <candini_at_[hidden]> writes:

> I'm really interested in exemple 5 of boost asio:
>
> http://www.boost.org/doc/libs/1_47_0/doc/html/boost_asio/tutorial/tuttimer5/src.html
>
> I've tried it with boost-1.47.0. I can compile without warnings using:
>
> g++ -Wall -pedantic -lboost_thread -lboost_system -o timer5 timer5.cpp
>
> but when I launch the executable it gives me a Segmentation fault.
>
> Commenting the code I found that the segmentation fault raise at the
> 3rd line of main:
>
> boost::thread t(boost::bind(&boost::asio::io_service::run, &io));
>
> I'm trying on the following machine:
> Linux office-007 2.6.38-11-generic #48-Ubuntu SMP Fri Jul 29 19:02:55
> UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

Just in case people find this thread via searching...

Alessandro found and solved his problem. Using 'ldd', he discovered
that the executable had been linked to a shared object from an older
version of Boost, which created an incompatibility at runtime.

Completely removing the old version then relinking the executable
fixed the issue.

Regards,
Tony


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