#13447: Make libsingular multivariate polynomial rings collectable
-------------------------------------------------------+--------------------
       Reporter:  nbruin                               |         Owner:  rlm    
                       
           Type:  defect                               |        Status:  
needs_info                    
       Priority:  major                                |     Milestone:  
sage-5.4                      
      Component:  memleak                              |    Resolution:         
                       
       Keywords:                                       |   Work issues:  Input 
from libsingular experts
Report Upstream:  Reported upstream. No feedback yet.  |     Reviewers:         
                       
        Authors:                                       |     Merged in:         
                       
   Dependencies:                                       |      Stopgaps:         
                       
-------------------------------------------------------+--------------------

Comment (by nbruin):

 Replying to [comment:20 SimonKing]:
 > {{{
 > sage -t  -force_lib devel/sage/sage/modular/modsym/ambient.py
 > **********************************************************************
 > File "/scratch/sking/sage-5.4.beta0/devel/sage-
 main/sage/modular/modsym/ambient.py", line 1351:
 >     sage: ModularSymbols(20,2).boundary_space().dimension()
 > Expected:
 >     6
 > Got:
 >     0
 > }}}
 I have seen that error before, with other work-arounds (and I think also
 with `singular-malloc`), so if it's indeed only a lower bound, then sage
 has merely changed. It's not an error. If you're worried you can see where
 that dimension is computed and put a hard ref in the creation of the
 relevant object. If garbage collection is the cause of the observed
 amnesia, a hard ref should "solve" it. In that case you can just change
 the doctest answer.

 > The second error is apparently ignored and only printed to stderr:
 > {{{
 > Exception AttributeError:
 AttributeError('PolynomialRing_field_with_category' object has no
 attribute '_modulus',) in  ignored
 > Exception AttributeError:
 AttributeError('PolynomialRing_field_with_category' object has no
 attribute '_modulus',) in  ignored
 > }}}
 This is a worrisome error because it's fickle. One a linux x86_64 box, get
 this reliably in `sage/rings/polynomial/multi_polynomial_libsingular.pyx`.
 When I let it print the lines it's doctesting I get:
 {{{
 set_random_seed(0L)
 change_warning_output(sys.stdout)
 F = GF(Integer(7)**Integer(2), names=('a',)); (a,) =
 F._first_ngens(1)###line 1913:_sage_    >>> F.<a> = GF(7^2)
 R = F['x, y']; (x, y,) = R._first_ngens(2)###line 1914:_sage_    >>>
 R.<x,y> = F[]
 p = a*x**Integer(2) + y + a**Integer(3); p###line 1915:_sage_    >>> p =
 a*x^2 + y + a^3; p
 q = copy(p)###line 1917:_sage_    >>> q = copy(p)
 p == q###line 1918:_sage_    >>> p == q
 p is q###line 1920:_sage_    >>> p is q
 lst = [p,q];###line 1922:_sage_    >>> lst = [p,q];
 matrix(ZZ, Integer(2), Integer(2), lambda i,j:
 bool(lst[i]==lst[j]))###line 1923:_sage_    >>> matrix(ZZ, 2, 2, lambda
 i,j: bool(lst[i]==lst[j]))
 Exception AttributeError:
 AttributeError('PolynomialRing_field_with_category' object has no
 attribute '_modulus',) in  ignored
 Exception AttributeError:
 AttributeError('PolynomialRing_field_with_category' object has no
 attribute '_modulus',) in  ignored
 matrix(ZZ, Integer(2), Integer(2), lambda i,j: bool(lst[i] is
 lst[j]))###line 1926:_sage_    >>> matrix(ZZ, 2, 2, lambda i,j:
 bool(lst[i] is lst[j]))
 sig_on_count()
 }}}
 so it happens when doctesting line 1923. These are probably errors
 encountered during a dealloc, so it might be happening in a garbage
 collection. It could also be a `WeakValueDict` deletion callback that's
 trying to do a comparison that fails. Googling shows that you've asked
 about that exact error message on `cython-users` on 27 January, 2012, so
 if you solved the bug that led to that question then, perhaps you can also
 solve this one. It could also be a straight memory corruption.

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