[C++-sig] boost.python changes C++ try/catch behavior?

Niall Douglas s_sourceforge at nedprod.com
Thu Jan 18 23:22:54 CET 2007


On 18 Jan 2007 at 10:46, Stefan Seefeld wrote:

> >> setdlopenflags function belongs to sys module. I think this should
> >> solve your problem.
> > 
> > Yes, it did.  Thanks!  Is there a reason this isn't the default?   
> > i.e. are the times when it wouldn't be appropriate to set those flags?
> 
> Using RTLD_GLOBAL is generally a bad idea in the context of plugins,
> because it may break the integrity of a plugin. If two plugins both
> define and refer to the symbol 'foo', they will, once loaded, only
> see one of the two (since it will 'override' the other).
> 
> Typically symbols should be private to a plugin. However, in some cases
> not being able to share data (such as typeinfo objects) across plugins
> creates a problem, e.g. because, as in your case, an exception thrown
> in one plugin isn't catchable in another.

When oh when will python insist that all plugins are compiled with -
fexceptions=hidden? Or even better, if a plugin was compiled that 
way, it loads with RTLD_GLOBAL and if not, then RTLD_LOCAL? It's very 
easy to test.

Cheers,
Niall






More information about the Cplusplus-sig mailing list