[Numpy-discussion] Recovering from a STOP ?

Pauli Virtanen pav at iki.fi
Wed Mar 14 12:25:31 EDT 2012


14.03.2012 14:28, Pierre GM kirjoitti:
[clip]
> Alas, the RuntimeError doesn't look like it's passed back to the interpreter,
> which still crashes. (Adding a Py_Exit(-1) at the end of pyraise_runtime at
> least let the interpreter do some extra cleaning after the fortran code stopped,
> but still...)
> 
> Note that ENDRUN is never supposed to be called directly by the user (so no
> point to define a callback function via f2py, right ?).

The crash maybe occurs because if the code is not stopped, it writes out
of bounds or something?

You can try to use longjmp in ENDRUN to jump back to the beginning, and
return an error code. YMMV, this probably plays all hell with cleanup etc.

Or, maybe the whole Fortran stuff can be run in a separate process, so
that crashing doesn't matter.

	Pauli




More information about the NumPy-Discussion mailing list