The bug is in multiplication algorithm:
in sage/rings/polynomial/polynomial_real_mpfr_dense.pyx
in function that does ring multiplication:
cpdef RingElement _mul_(left, RingElement _right):
   there is line 431:
cdef PolynomialRealDense f = left._new(left._degree + right._degree)
that is creates a polynomial of degee -2 (!!!) if both elements we
multiply are 0, and so have degrees -1.
I have created a trac ticket:
#8211

The patch I uploaded there apparently fixes the problem.
Best,
Dima


On Feb 7, 6:49 pm, Kiran Kedlaya <ksk...@gmail.com> wrote:
> The following input segfaults sage 4.3.2 on sage.math, as well as sage
> 4.3 on various other machines.
>
> P.<x> = PolynomialRing(RealField())
> print sum(P(0)*P(0) for k in range(1))
>
> This example seems quite fragile; for instance, the segfault goes away
> if you change RealField to RationalField, RealDoubleField, or Complex
> Field.
>
> Kiran

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to