# Ticket #1406(closed defect: fixed)

Opened 5 years ago

## [with patch] bug in coercion of multivariate polynomials (possibly libsingular related)

Reported by: Owned by: was mhansen major sage-2.9 basic arithmetic

### Description

Reducing a polynomial to the libsingular polynomials to GF(pn) is buggy as the following examples all illustrate.

```sage: R.<x,y> = QQ[]
sage: S.<xx,yy> = GF(5)[]
sage: S(5*x*y + x + 17*y)
0*xx*yy + xx + 2*yy
sage: R.<x,y> = ZZ[]
sage: S.<xx,yy> = GF(5)[]
sage: R.<x,y> = ZZ[]
sage: S.<xx,yy> = GF(25,'a')[]
sage: S(5*x*y + x + 17*y)
0*xx*yy + xx + 2*yy
sage: type(S(5*x*y + x + 17*y))
<type 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular'>
sage: R.<x,y> = ZZ[]
sage: S.<xx,yy> = Integers(5)[]
sage: S(5*x*y + x + 17*y)
xx + 2*yy
```

## Change History

### comment:1 Changed 5 years ago by mhansen

• Owner changed from somebody to mhansen
• Status changed from new to assigned

I have a fix for this, but it causes a segfault in the testing of multi_polynomial_ideal.py .

--Mike

### comment:2 Changed 5 years ago by mhansen

• Summary changed from bug in coercion of multivariate polynomials (possibly libsingular related) to [with patch] bug in coercion of multivariate polynomials (possibly libsingular related)

### Changed 5 years ago by was

This is a -- I think -- better version of the 1406.patch that mhansen attached -- use it instead.

### comment:3 Changed 5 years ago by was

Bonus -- my patch doesn't cause segfaults in multi_polynomial_ideal.py... I think.

### comment:4 Changed 5 years ago by mhansen

Actually, it turns out that that segfault was there all along (with or without the patch). See #1409 .

### comment:5 Changed 5 years ago by mabshoff

Ok, looks good to me, merging William's patch.

Cheers,

Michael

### comment:6 Changed 5 years ago by mabshoff

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

Merged in 2.9.alpha1.

Note: See TracTickets for help on using tickets.