[SciPy-dev] crash with 'import scipy.linalg' and 'import scipy.io'

Robert Kern robert.kern@gmail....
Thu Mar 8 21:06:58 CST 2007

John Pye wrote:
> Hi Robert
> Thanks for the reply. It sounds like my guess about the global variables
> in numpy was right then. Globals are bad.

Yes. We're not the only ones with the problem, though; the interpreter has the
same problem:


> Embedding python in this case was a necessary evil to do with the legacy
> architecture: the place where the callbacks needed to be made was inside
> a secondary DLL/SO that didn't have access to the SWIG wrapper layer. So
> I needed to fire up embedded python and grab hooks to values (GUI
> objects, for example) in the original interpreter via a global variable
> mechanism. Globals are bad, again, but at least it didn't crash :-)

I'm afraid that I don't see the connection between that description of the
problem and your solution. I'm sure there is one, but the description doesn't
have enough details for me to see it.

> Perhaps the way I did this might be of interest. I used a hash table
> function to register global variables used in one interpreter frame so
> that they could be retrieved in the other frame. If numpy is creating
> some variables that might be required in other frames, perhaps they
> should be registered somewhere, if they can't be removed?

I'm happy to consider something that works and doesn't interfere with use in a
single interpreter.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

More information about the Scipy-dev mailing list