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

Tim Peters tim.one@comcast.net
Sun, 05 May 2002 13:07:21 -0400


[David Abrahams, presumably quoting Ralf W. Grosse-Kunstleve]
> ...
> The exact some source works with Compaq cxx on Alpha (and also Visual
> C++ 6 & 7, Win32 CodeWarrior 7.0). I put in print statements and
> compared the output from the Linux machine with the output from the
> Alpha. This shows that under Linux the identity of the exception is
> somehow lost:  Alpha comes back where it says "SHOULD COME BACK HERE",
> Linux comes back where it says "BUT COMES BACK HERE".  This is after
> many successful passes through "SHOULD COME BACK HERE".
>
> The problem is very elusive. Most of the time the exception handling
> works correctly. For example, if we change small details about the order
> in which exceptions are thrown gcc works just fine
> (execution flow still passes repeatedly through "SHOULD COME BACK
> HERE"). Also, changing the dlopen flags used when loading extension
> modules to include RTLD_GLOBAL makes the problem disappear.

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".  Try efence?