Ticket #715: trac_715_osx64-dealloc.patch

File trac_715_osx64-dealloc.patch, 1.2 KB (added by nbruin, 7 years ago)

Fix segfault on bsd

  • sage/rings/polynomial/multi_polynomial_libsingular.pyx

    # HG changeset patch
    # User Nils Bruin <nbruin@sfu.ca>
    # Date 1347325114 25200
    # Node ID d69708ed3428f8f52b6d8bca8a6b09c414269161
    # Parent  700061226df5b343889aa4744f2376d351523dc0
    #715: On OSX (64 bit) there is a rare omAlloc corruption upon deallocating libsingular rings.
    This patch reintroduces a permanent store for them (as the coercion framework used to provide).
    diff --git a/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/sage/rings/polynomial/multi_polynomial_libsingular.pyx
    a b from sage.misc.sage_eval import sage_eva 
    243243import sage.libs.pari.gen
    244244import polynomial_element
    246247cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
    248249    def __cinit__(self):
    cdef class MPolynomialRing_libsingular(M 
    364365        from sage.rings.polynomial.polynomial_element import PolynomialBaseringInjection
    365366        base_inject = PolynomialBaseringInjection(base_ring, self)
    366367        self.register_coercion(base_inject)
     368        #permanently store a reference to this ring until deallocation works reliably
     369        permstore.append(self)
    368371    def __dealloc__(self):
    369372        r"""