Boost logo

Threads-Devel :

Subject: Re: [Threads-devel] statically linked example on Linux segfaults when exception is thrown
From: Neetu Garg (garg_neetu_at_[hidden])
Date: 2010-03-23 13:11:22


Thanks Anthony for prompt reply.

Yes it works fine if I link dynamically.

Here are compile and link command for dynamic linking and I did get the exception.

#g++ -c -pthread -I. -I/usr/local/include/boost-1_38 -I/usr/include testThreadException.cpp -o testThreadException.o

# g++ -pthread testThreadException.o -L/usr/local/lib -lboost_thread-gcc41-mt -L/usr/lib -lpthread -o testThreadException

I got output:
exception
DONE

Problem is only when I add "-static" option to link statically.

Regards,
NG

----- Original Message ----
From: Anthony Williams <anthony_at_[hidden]>
To: threads-devel_at_[hidden]
Sent: Tue, March 23, 2010 10:03:56 AM
Subject: Re: [Threads-devel] statically linked example on Linux segfaults when exception is thrown

On 23/03/10 16:58, Neetu Garg wrote:
> Thanks Anthony,
>
> I added "-pthread" while compilation as well as while linking, I am still getting segfaults.
>
> # g++ -c -pthread -I. -I/usr/local/include/boost-1_38 -I/usr/include testThreadException.cpp -o testThreadException.o
> # g++ -pthread testThreadException.o -static -L/u/test/lib -lboost_thread-gcc41-mt -lpthread -o testThreadException
>

That is strange. It may be something to do with the C++ runtime. Does it
work with dynamic linking?

Anthony

-- 
Author of C++ Concurrency in Action    http://www.stdthread.co.uk/book/
just::thread C++0x thread library            http://www.stdthread.co.uk
Just Software Solutions Ltd      http://www.justsoftwaresolutions.co.uk
15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976
_______________________________________________
threads-devel mailing list
threads-devel_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/threads-devel
      

Threads-Devel list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk