id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
10833 Unhandled SIGSEGV on large expand of iterated polynomial katestange AlexGhitza "Verified on 'Sage Version 4.6, Release Date: 2010-10-30' on my laptop and on nt.sagemath.org.
If I do this:
{{{
R. = PolynomialRing(QQ,2)
phi(x) = x^2 + c
def iterkate(n):
pol = x
for i in range(1,n):
pol = phi(pol)
return pol
g = expand(iterkate(7))
}}}
Then I get this on the last command:
{{{
------------------------------------------------------------
Unhandled SIGSEGV: A segmentation fault occurred in Sage.
This probably occurred because a *compiled* component
of Sage has a bug in it (typically accessing invalid memory)
or is not properly wrapped with _sig_on, _sig_off.
You might want to run Sage under gdb with 'sage -gdb' to debug this.
Sage will now terminate (sorry).
------------------------------------------------------------
}}}
But if I do this
{{{
R. = PolynomialRing(QQ,2)
g = expand( (((((x^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c )
}}}
Then it is perfectly happy and g is a degree 64 polynomial (but in both cases it's the same polynomial I'm asking it to expand!). In the first example, it will crash if the ""7"" is anything above about 6. At 6, it is unreliable, and crashes sometimes. 5 and lower seems fine. I wasn't sure how to pare down to a more minimal example, given the circumstances.
It's entirely possible I'm doing something stupid here and interacting with sage in a bad way. If so, it's still a bug, but I'd love to know what I'm doing that sage doesn't like.
Anyway, here's some debug info:
{{{
Program received signal SIGSEGV, Segmentation fault.
0x03b3c3f5 in void std::__unguarded_linear_insert<__gnu_cxx::__normal_iterator > >,
GiNaC::expair, GiNaC::expair_rest_is_less>(__gnu_cxx::__normal_iterator > >, GiNaC::expair, GiNaC::expair_rest_is_less) ()
from /usr/local/lib/sage-4.1.1-linux-Ubuntu_9.04-i686-Linux/local/lib/libpynac-0.2.so.1
Current language: auto
The current source language is ""auto; currently c++"".
}}}" defect closed minor sage-duplicate/invalid/wontfix algebra duplicate expand, polynomial, polynomial ring katestange jpflori burcin N/A