#5839: [with patch, needs review] MPolynomialRing_libsingular __dealloc__ is
buggy, can lead to crash
---------------------------------+------------------------------------------
 Reporter:  cwitty               |       Owner:  cwitty    
     Type:  defect               |      Status:  new       
 Priority:  critical             |   Milestone:  sage-3.4.1
Component:  commutative algebra  |    Keywords:            
---------------------------------+------------------------------------------
 In {{{__dealloc__}}}, if currRing is NULL on entry, then currRing will be
 the ring we just deleted on exit.  The patch fixes this bug, so that
 currRing never points to freed memory.

 It took me quite a while to come up with a small reproducible test case
 for the problem; here it is.  (This test case is also in the patch, as a
 doctest.)
 {{{
 import gc
 from sage.rings.polynomial.multi_polynomial_libsingular import
 MPolynomialRing_libsingular
 R1 = MPolynomialRing_libsingular(GF(5), 2, ('x', 'y'),
 TermOrder('degrevlex', 2))
 R2 = MPolynomialRing_libsingular(GF(11), 2, ('x', 'y'),
 TermOrder('degrevlex', 2))
 R3 = MPolynomialRing_libsingular(GF(13), 2, ('x', 'y'),
 TermOrder('degrevlex', 2))
 gc.collect()
 foo = R1.gen(0)
 del foo
 del R1
 gc.collect()
 del R2
 gc.collect()
 del R3
 gc.collect()
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5839>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel

--~--~---------~--~----~------------~-------~--~----~
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