Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2309: Lack of g++ symbol visibility support in Boost.Thread
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-02-09 21:08:34
#2309: Lack of g++ symbol visibility support in Boost.Thread
------------------------------------------------------------------+---------
Reporter: rbock@⦠| Owner: anthonyw
Type: Bugs | Status: new
Milestone: Boost 1.43.0 | Component: thread
Version: Boost 1.36.0 | Severity: Problem
Keywords: visibility catch exception thread thread_interrupted |
------------------------------------------------------------------+---------
Changes (by Scott Bailey <Bailey@â¦>):
* cc: Bailey@⦠(added)
* keywords: visibility catch exception => visibility catch exception
thread thread_interrupted
* milestone: Boost 1.37.0 => Boost 1.43.0
Comment:
== Description ==
thread_interrupted can't be caught when crossing shared object's
boundaries when visibility is hidden.
== Found In ==
Boost v1.40, v1.41, and 1.42
== Recreating ==
Here is the setup:
`MyCommon.so`
- this lib contains some basic classes, one of which (`baseTRx`) has a
`boost::thread`.
- this lib includes `boost_system` and `boost_thread` using the --whole-
archive flag (linux) and equivalent for darwin and win
-- this was done to minimize the number of files the customer would
receive, among other reasons...
`MyTRx.so`
- this lib contains a class derived from `baseTRx` (`myTRx`).
- links to `MyCommon`
`MyEXE`
- this contains `main()`.
- links to `MyCommon`
- loads `MyTRx` at run time.
- creates an instance of `myTRx`.
- signals `MyEXE` (via `interupt()`) when its time to cleanly shut down
Using GCC 4.2 w/ '''-fvisibility=hidden''', '''thread_interrupted isn't
being caught''' in `myTRx` since it's being thrown from a different so
with ''hidden visibility''.
== Possible Fixes ==
These are the options as I see them:
- push, then set visibility to default in the BOOST_ABI_PREFIX. Then pop
in the BOOST_ABI_SUFFIX.
- add class decorators to modify visibility of exceptions
I provided a patch ([attachment:thread_interrupted.patch]) for the second
option. I am using this patch in a production environment.
== Similar/possibly Related Defects ==
This is similar to the following defects:
- #2114 Patch for export symbols from shared library
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/2309#comment:3> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:02 UTC