Opened 6 years ago
Closed 5 years ago
#17785 closed defect (fixed)
crash in multipolynomial substitutions
Reported by:  cnassau  Owned by:  

Priority:  critical  Milestone:  sage6.10 
Component:  algebra  Keywords:  crash, SIGSEGV, substitution 
Cc:  Merged in:  
Authors:  Vincent Delecroix  Reviewers:  Volker Braun 
Report Upstream:  N/A  Work issues:  
Branch:  f1d8e84 (Commits, GitHub, GitLab)  Commit:  f1d8e8486b815f134eda82bc726bd97964d5c0df 
Dependencies:  Stopgaps: 
Description (last modified by )
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 Sage6.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)
Change History (7)
comment:1 Changed 6 years ago by
comment:2 Changed 5 years ago by
Simpler examples with three variables R.<x,y,z> = QQ[]
sage: x.subs(None,y=x,x=0,z=y) sage: x.subs(None,x=0,y=x,z=x) sage: x.subs(None,x=0,y=0,z=x)
comment:3 Changed 5 years ago by
 Description modified (diff)
 Keywords SIGSEGV added
 Milestone changed from sage6.5 to sage6.10
 Priority changed from minor to critical
comment:4 Changed 5 years ago by
 Summary changed from crash in matrix.subs to crash in multipolynomial substitutions
comment:5 Changed 5 years ago by
 Branch set to u/vdelecroix/17785
 Commit set to f1d8e8486b815f134eda82bc726bd97964d5c0df
 Status changed from new to needs_review
New commits:
f1d8e84  Trac 17785: fix segmentation fault for subs

comment:6 Changed 5 years ago by
 Reviewers set to Volker Braun
 Status changed from needs_review to positive_review
comment:7 Changed 5 years ago by
 Branch changed from u/vdelecroix/17785 to f1d8e8486b815f134eda82bc726bd97964d5c0df
 Resolution set to fixed
 Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
Hello,
This is actually unrelated to matrices
(and as a sided remark, it is useless to declare the variables with
var
; the commandvar
creates variables in the symbolic ring which have nothing to do with the variables of the polynomial ring)Vincent