#14894: Fix PARI error handling (needed for future upgrade to PARI 2.6)
--------------------------------------+------------------------------
Reporter: vbraun | Owner: jdemeyer
Type: defect | Status: needs_work
Priority: major | Milestone: sage-5.12
Component: packages: standard | Resolution:
Keywords: pari error signal | Merged in:
Authors: Peter Bruin | Reviewers: Jeroen Demeyer
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: #12142, #14873 | Stopgaps:
--------------------------------------+------------------------------
Comment (by pbruin):
Actually, in `[PARI source]/language/init.c` (and in the header file
`paricom.h`) there is a declaration
{{{
int (*cb_pari_handle_exception)(long);
}}}
if this is non-zero, `pari_err()` calls it (with an error code as
argument) when no saved environment is present to do a `longjmp()` to. I
could imagine setting this to a Cython function that converts a PARI error
into an appropriate Python exception, and raising that exception.
It appears that the function to which `cb_pari_handle_exception` points
should return non-zero if and only if the error was handled succesfully;
if it was, `pari_err()` simply returns. However, functions calling
`pari_err()` normally expect that function not to return, so as things
stand now, a suitable `setjmp()/longjmp()` would still seem to be
necessary.
--
Ticket URL: <http://trac.sagemath.org/ticket/14894#comment:34>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.