#7794: PolynomialRing_integral_domain ignores Ctrl-C and segfaults
--------------------------+-------------------------------------------------
   Reporter:  SimonKing   |          Owner:  AlexGhitza                       
       Type:  defect      |         Status:  needs_review                     
   Priority:  critical    |      Milestone:  sage-4.7.1                       
  Component:  algebra     |       Keywords:  Polynomial Ring KeyboardInterrupt
Work_issues:              |       Upstream:  N/A                              
   Reviewer:  Simon King  |         Author:                                   
     Merged:              |   Dependencies:                                   
--------------------------+-------------------------------------------------

Comment(by SimonKing):

 Replying to [comment:11 SimonKing]:
 > Perhaps it is safer to keep modify the internal try-except clause
 (namely replace the bare `except:` by `except AttributeError:`) and
 declare the Cython funtion as `cdef inline cparent get_cparent(parent)
 except -1:`.

 On the other hand:

  * In polynomial_zmod_flint, get_cparent is supposed to return unsigned
 int. So, -1 does not make sense.

  * The modulus is positive. So, actually 0 should be a clear sign that
 something went wrong. I wonder if the function is ever called with
 `parent=None` (because this is the only situation in which zero is
 returned).

 I will test whether `parent is None` ever occurs. If not, then we could
 keep 0 as return value on error, but could remove the question mark (which
 should result in a faster code).

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7794#comment:12>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to