[Python-Dev] Problems with Python's default dlopen flags

Gordon McMillan gmcm@hypernet.com
Sun, 5 May 2002 15:33:16 -0400


On 5 May 2002 at 13:07, Tim Peters wrote:

> [David Abrahams, presumably quoting Ralf W.
> Grosse-Kunstleve] >

[stuff about exceptions on Linux...]

> Whoa -- this shows all the signs of a wild store
> and consequent memory corruption.  If it were truly
> a problem with resolving symbols, it would fail
> every time.  Instead it sometimes works, sometimes
> doesn't, and all depending on "stuff that shouldn't
> matter". 

There is some strangeness to exceptions, Linux, gcc
and linking. In scxx (my minimalist C++ / Python
interface), there's no separate .so involved - the
scxx code is compiled in with the extension. There
are no statics involved, so C linkage works (you don't
need a relinked Python). At a certain gcc release, 
exceptions thrown and caught at the top level stopped
working (abort). "eric" of scipy fame had a 
similar (but not identical) experience.

I think scipy's fix was to require Python be built and
linked by g++. Mine was to stop doing that (throwing
and catching at the same level).

So we all have gcc and C++ exceptions and linkage in
common. Leg 4 of the elephant is out there someplace.

-- Gordon
http://www.mcmillan-inc.com/