[Matrix-SIG] Re: [PSA MEMBERS] Re: [Matrix-SIG] NumPy core dump

M.-A. Lemburg mal@lemburg.com
Mon, 21 Dec 1998 23:15:47 +0100


Charles G Waldman wrote:
> 
> Several weeks ago, I wrote:
> 
>  > Using Numeric version 1.5, from the LLNLPython6 distribution, on top
>  > of Python1.5.2b1, the following piece of code causes a core-dump:
>  >
>  > >>>from Numeric import *
>  > >>>AM = fromfunction(lambda x:sin(x*pi/512))
>  >
>  > I know the code is incorrect (missing second arg. to fromfunction) but
>  > shouldn't this raise an exception rather than dumping core?
> 
> This behavior is still there in today's 1.7 version.  However I think
> it may be due to a compiler bug.  I've been hearing (on the
> xemacs-beta mailing list) of a bug in gcc 2.7.2.3 related to register
> saving.  Using the "-fno-caller-saves" flag is alleged to work around
> this problem.  So, I rebuilt Python1.5.2 and the Numeric extensions
> with the -fno-caller-saves option.  Now I get a most peculiar
> behavior:  no longer is there an immediate core-dump;  I get
> a TypeError, as expected, but not until after I enter another line.
> It doesn't seem to matter if the line is blank or contains
> code, as the following examples show:

I don't know anything about NumPy, but the error you describe
is typical of a situation where C code sets an exception using
PyExc_SetString() without returning NULL to the caller.

-- 
Marc-Andre Lemburg                               Y2000: 375 days left
---------------------------------------------------------------------
          : Python Pages >>> http://starship.skyport.net/~lemburg/  :
           ---------------------------------------------------------