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

Stefan Seefeld seefeld at sympatico.ca
Thu Jan 18 16:46:54 CET 2007


Mark Ivey wrote:
> On Jan 17, 2007, at 9:26 PM, Roman Yakovenko 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.

(By the way, on IRC you mentioned the throw and the catch appear within
the same function, which let me to believe it had to be some other problem.)

HTH,
		Stefan

-- 

      ...ich hab' noch einen Koffer in Berlin...



More information about the Cplusplus-sig mailing list