#17785: crash in matrix.subs
------------------------------------------------+-------------------------
       Reporter:  cnassau                       |        Owner:
           Type:  defect                        |       Status:  new
       Priority:  critical                      |    Milestone:  sage-6.10
      Component:  algebra                       |   Resolution:
       Keywords:  crash, SIGSEGV, substitution  |    Merged in:
        Authors:                                |    Reviewers:
Report Upstream:  N/A                           |  Work issues:
         Branch:                                |       Commit:
   Dependencies:                                |     Stopgaps:
------------------------------------------------+-------------------------
Changes (by vdelecroix):

 * priority:  minor => critical
 * keywords:  crash, substitution => crash, SIGSEGV, substitution
 * milestone:  sage-6.5 => sage-6.10


Old description:

> The following code gives a coredump in Sage-6.5.rc3:
> {{{
> a11,a12,a13,a21,a22,a23,a31,a32,a33 = allvars =
> var("a11,a12,a13,a21,a22,a23,a31,a32,a33")
> P=PolynomialRing(QQ,allvars,order='degrevlex')
> P.inject_variables()
> A=matrix([[a11,a12,a13,],[a21,a22,a23,],[a31,a32,a33]])
> A.subs(a11=a13,a21=-a23,a31=a33,a22=0)
> }}}

New description:

 The substitution code for multipolynomial (using Singular) results in a
 SIGSEV. For example, with `R.<x,y,z> = QQ[]` and any of
 {{{
 x.subs(None,y=x,x=0,z=y)
 x.subs(None,x=0,y=x,z=x)
 x.subs(None,x=0,y=0,z=x)
 x.subs(None,x=0,y=0,z=z)
 }}}
 Though, if we do not mix integer and variable in the substitutions it
 seems to work fine
 {{{
 sage: x.subs(None,x=0,y=0,z=0)
 0
 sage: x.subs(None,x=z,y=x,z=y)
 z
 sage: x.subs(None,x=x,y=y,z=z)
 x
 }}}
 And the following also works
 {{{
 sage: x.subs(None,x=0,y=x,z=0)
 0
 sage: x.subs(None,x=0,y=y,z=0)
 0
 sage: x.subs(None,x=0,y=z,z=0)
 0
 sage: x.subs(None,x=y,y=z,z=0)
 y
 sage: x.subs(None,x=y,y=0,z=0)
 y
 sage: x.subs(None,x=z,y=0,z=0)
 z
 }}}
 -------

 Original report

 The following code gives a coredump in Sage-6.5.rc3:
 {{{
 a11,a12,a13,a21,a22,a23,a31,a32,a33 = allvars =
 var("a11,a12,a13,a21,a22,a23,a31,a32,a33")
 P=PolynomialRing(QQ,allvars,order='degrevlex')
 P.inject_variables()
 A=matrix([[a11,a12,a13,],[a21,a22,a23,],[a31,a32,a33]])
 A.subs(a11=a13,a21=-a23,a31=a33,a22=0)
 }}}

--

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

Reply via email to