Ticket #1136 (closed defect: fixed)
[with patch] libsingular tends to segfault with polynomials over Q
| Reported by: | moretti | Owned by: | malb |
|---|---|---|---|
| Priority: | major | Milestone: | sage-2.8.13 |
| Component: | commutative algebra | Keywords: | singular |
| Cc: | Author(s): | ||
| Report Upstream: | Reviewer(s): | ||
| Merged in: | Work issues: |
Description
After you've applied the attached patch (which does not change or add any extension code, just pure python), running the following code will occasionally result in a segfault. I have traced this to libsingular trying to free() an invalid memory address.
Here's the code to run, once you've applied the patch:
def test(n):
R.<x,y,z> = QQ[]
P = (0, 0, 1)
for i in range(n):
c = [QQ.random_element(10,10) for i in xrange(9)]
f = c[0]*x^3 + c[1]*x^2*y + c[2]*x*y^2 + c[3]*y^3 + c[4]*x*y*z + c[5]*x^2*z + c[6]*x*z^2 + c[7]*y*z^2 + c[8]*y^2*z
print "trying %s" % f
E = EllipticCurve_from_cubic(f, P, algorithm="sage")
print "sage: %s" % E
sage: test(100)
This is on an ubuntu x64, running on an intel core 2 duo santa rosa.
The first few levels of a gdb backtrace:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47923767875296 (LWP 16318)]
0x00002b961efab6ab in free () from /lib/libc.so.6
(gdb) bt
#0 0x00002b961efab6ab in free () from /lib/libc.so.6
#1 0x00002b96305fbd3c in _nlDelete_NoImm (a=0x2b9630a129c0, r=<value optimized out>) at longrat.cc:1430
#2 0x00002b96306b2e8b in p_Delete__FieldQ_LengthGeneral_OrdGeneral (pp=0x2b86b28, r=0x2b96309d3160) at longrat.cc:2192
#3 0x00002b963024b97b in __pyx_tp_dealloc_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingular (
o=0x2b86af8) at /home/bob/sage/local//include/singular/pInline2.h:429
#4 0x00000000004d195a in frame_dealloc (f=0x2bde7e0) at Objects/frameobject.c:416
#5 0x00000000004d1b74 in frame_dealloc (f=0x2bfdb30) at Objects/frameobject.c:424
#6 0x00000000004b06bb in tb_dealloc (tb=0x2b79a28) at Python/traceback.c:34
#7 0x000000000044150d in insertdict (mp=0x762fa0, key=0x2b961f979b20, hash=7943982932492106152, value=0x2b79b48)
at Objects/dictobject.c:412
#8 0x0000000000442eee in PyDict_SetItem (op=0x762fa0, key=0x2b961f979b20, value=0x2b79b48) at Objects/dictobject.c:637
#9 0x0000000000442ffb in PyDict_SetItemString (v=0x762fa0, key=<value optimized out>, item=0x2b79b48)
at Objects/dictobject.c:2178
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

