[Numpy-discussion] bus error in embedded numpy
Fri Nov 13 12:24:34 CST 2009
On Fri, Nov 13, 2009 at 6:13 PM, Robert Kern <firstname.lastname@example.org> wrote:
> On Fri, Nov 13, 2009 at 12:05, Travis Oliphant <email@example.com> wrote:
>> I wonder if this is related to the fact that you can't "unload" a
>> dynamically linked module (like NumPy has). So, when you call
>> Py_Finalize you are not really "finalizing" your usage of Python
>> extension modules.
>> I'm not sure though.
> Right. We do some global things when numpy is imported. Since there is
> no unload step for extension modules, we can't undo them. The second
> time the interpreter starts up, it doesn't know that numpy has already
> been loaded and that numpy shouldn't try to do those global things
Thanks for the quick responses...
I'm sure you're right - in fact it looks like there was a similar issue here:
I had assumed when matlab unloads the mex function it would also
unload python - but it looks like other dynamic libs pulled in from
the mex function (in this case python and in turn numpy) aren't
I wonder if it would be possible to link python statically to my mex
function, so it really is unloaded when the mex function is... but I'm
getting a bit out of my depth with linker options, and I guess numpy
is always loaded dynamically anyway and will stick around.
Easy enough to work around it anyway - but just wanted to check what
was going on.
More information about the NumPy-Discussion