#17090: Fix issues with #16803
-------------------------------------+-------------------------------------
Reporter: jdemeyer | Owner:
Type: defect | Status: new
Priority: blocker | Milestone: sage-6.4
Component: linear algebra | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/jdemeyer/ticket/17090 | 7b38491f4e99b814b6c238d6c96d7cb263b77e77
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Description changed by jdemeyer:
Old description:
> The code from #16803 is missing `fmpz_init()`/`fmpz_clear()` in `_lmul_`
> (and perhaps other places too). This can cause random segfaults and
> memory leaks, as witnessed for example in #16938.
>
> The code in question:
> {{{
> cpdef ModuleElement _lmul_(self, RingElement right):
> """
> EXAMPLES::
>
> sage: a = matrix(QQ,2,range(6))
> sage: (3/4) * a
> [ 0 3/4 3/2]
> [ 9/4 3 15/4]
> """
> cdef Py_ssize_t i
> cdef Integer _x
> cdef fmpz_t z
> _x = Integer(right)
> cdef Matrix_integer_dense M
> M = self._new_uninitialized_matrix(self._nrows,self._ncols)
> sig_on()
> fmpz_set_mpz(z,_x.value)
> fmpz_mat_scalar_mul_fmpz(M._matrix,self._matrix,z)
> sig_off()
> M._initialized = True
> return M
> }}}
New description:
Various fixes/improvements/clean-ups after #16803.
--
--
Ticket URL: <http://trac.sagemath.org/ticket/17090#comment:19>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.