Opened 7 years ago

Closed 7 years ago

#1211 closed defect (fixed)

[with patch, with positive review] NTL crash in polynomial remainder over ZZ

Reported by: ncalexan Owned by: dmharvey
Priority: critical Milestone: sage-2.8.15
Component: commutative algebra Keywords: ntl polynomial remainder ZZ crash segfault
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

sage: x = ZZ['x'].0
sage: x^2 % (2*x - 1)
DivRem: quotient not defined over ZZ
/Users/ncalexan/sage/local/bin/sage-sage: line 218: 28251 Abort trap              sage-ipython -c "$SAGE_STARTUP_COMMAND;" "$@"

Process SAGE exited abnormally with code 134

Mac OS X 10.4 Intel Core2Duo, Darwin mero.local 8.10.1 Darwin Kernel Version 8.10.1: Wed May 23 16:33:00 PDT 2007; root:xnu-792.22.5~1/RELEASE_I386 i386 i386

Attachments (1)

1211.hg (3.2 KB) - added by dmharvey 7 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 7 years ago by dmharvey

  • Owner changed from malb to dmharvey
  • Status changed from new to assigned

comment:2 Changed 7 years ago by dmharvey

I'm about to attach a patch that fixes this (and also fixes division by zero crash too).

sage: R.<x> = PolynomialRing(ZZ)
sage: x^2 % (2*x - 1)
---------------------------------------------------------------------------
<type 'exceptions.ArithmeticError'>       Traceback (most recent call last)

/Users/david/sage-2.8.14/<ipython console> in <module>()

/Users/david/sage-2.8.14/polynomial_element.pyx in sage.rings.polynomial.polynomial_element.Polynomial.__mod__()

/Users/david/sage-2.8.14/polynomial_integer_dense_ntl.pyx in sage.rings.polynomial.polynomial_integer_dense_ntl.Polynomial_integer_dense_ntl.quo_rem()

<type 'exceptions.ArithmeticError'>: division not exact in Z[x] (consider coercing to Q[x] first)
sage: x^2 % 0
---------------------------------------------------------------------------
<type 'exceptions.ArithmeticError'>       Traceback (most recent call last)

/Users/david/sage-2.8.14/<ipython console> in <module>()

/Users/david/sage-2.8.14/polynomial_element.pyx in sage.rings.polynomial.polynomial_element.Polynomial.__mod__()

/Users/david/sage-2.8.14/polynomial_integer_dense_ntl.pyx in sage.rings.polynomial.polynomial_integer_dense_ntl.Polynomial_integer_dense_ntl.quo_rem()

<type 'exceptions.ArithmeticError'>: division by zero polynomial
sage: (2*x^2) % (2*x)
0

Changed 7 years ago by dmharvey

comment:3 Changed 7 years ago by dmharvey

  • Summary changed from NTL crash in polynomial remainder over ZZ to [with patch] NTL crash in polynomial remainder over ZZ

comment:4 Changed 7 years ago by mabshoff

  • Milestone changed from sage-2.10 to sage-2.8.15

comment:5 Changed 7 years ago by cwitty

  • Summary changed from [with patch] NTL crash in polynomial remainder over ZZ to [with patch, with positive review] NTL crash in polynomial remainder over ZZ

Looks good, and all doctests still pass in sage/rings/polynomial/.

comment:6 Changed 7 years ago by mabshoff

  • Resolution set to fixed
  • Status changed from assigned to closed

Merged in 2.8.15.alpha2.

Note: See TracTickets for help on using tickets.