Ticket #7152 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

Segmentation fault with monomials()

Reported by: mraum Owned by: tbd
Priority: major Milestone: sage-4.3.1
Component: algebra Keywords: monomials, singular
Cc: MRaum@…, malb, wjp Work issues:
Report Upstream: N/A Reviewers: Willem Jan Palenstijn
Authors: Burcin Erocal Merged in: sage-4.3.1.rc1
Dependencies: Stopgaps:

Description

Using implicite coercion and then calling monomials might cause a segmentation fault. This is a side effect.

K.<rho> = NumberField(x**2 + 1)
R.<x,y> = QQ[]
p = rho*x
q = x
p.monomials()
 ...
q.monomials()
 ...
p.monomials()
 Segmentation Fault

Going back to line 5 you can avoid this by

p.parent()(p).monomials()
 ...
q.parent()(q).monomials()
 ...
p.parent()(p).monomials()
 ...

This might be used as a workaround.

If no implicite coercion is involved, everything works fine, i.e. use

R.<x,y> = K[]

This is most probably related to #6160.

Attachments

trac_7152-monomials_cring.patch Download (1.3 KB) - added by burcin 3 years ago.
set current ring for singular in monomials() method

Change History

comment:1 Changed 3 years ago by burcin

  • Cc malb, wjp added
  • Keywords singular added; multivariate polynomial ring, coercion removed
  • Report Upstream set to N/A
  • Status changed from new to needs_review
  • Authors set to Burcin Erocal

This segfaults because the monomials() method doesn't set the current ring. attachment:trac_7152-monomials_cring.patch Download contains the fix.

Changed 3 years ago by burcin

set current ring for singular in monomials() method

comment:2 Changed 3 years ago by wjp

  • Status changed from needs_review to positive_review

Looks good.

comment:3 Changed 3 years ago by rlm

  • Status changed from positive_review to closed
  • Reviewers set to Willem Jan Palenstijn
  • Resolution set to fixed
  • Merged in set to sage-4.3.1.rc1
Note: See TracTickets for help on using tickets.