#13447: Make libsingular multivariate polynomial rings collectable
----------------------------------------------------------------+-----------
       Reporter:  nbruin                                        |         
Owner:  rlm                            
           Type:  defect                                        |        
Status:  needs_review                   
       Priority:  major                                         |     
Milestone:  sage-5.4                       
      Component:  memleak                                       |    
Resolution:                                 
       Keywords:                                                |   Work 
issues:  Input from a libsingular expert
Report Upstream:  None of the above - read trac for reasoning.  |     
Reviewers:  Simon King                     
        Authors:  Nils Bruin, Simon King                        |     Merged 
in:                                 
   Dependencies:  #11521                                        |      
Stopgaps:                                 
----------------------------------------------------------------+-----------

Comment (by SimonKing):

 Now I think I understand:

 `currRingHdl = enterid("my_awesome_sage_ring", 0, RING_CMD, &IDROOT, 1)`
 has the purpose to create `currRingHdl` (it is only called if
 `currRingHdl==NULL`), but the value assigned to `currRingHdl.data.uring`
 is ''invalid''. In particular, the attempt to change to
 `currRingHdl.data.uring` results in a segfault. Hence,
 `singular_ring_delete(currRingHdl.data.uring)` would not work.

 Solution: We create `currRingHdl`, but we immediately delete the invalid
 `currRingHdl.data.uring` and replace it by a new reference to `currRing`.
 If there is no `currRing` then I print a warning, but I hope that we will
 never see that warning...

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13447#comment:47>
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