#10147: Inconsistent behaviour of p.roots(ring=CC) for p(x) in QQ['y']['x'] 
(incl.
crashing)
---------------------------+------------------------------------------------
   Reporter:  mmezzarobba  |       Owner:  AlexGhitza
       Type:  defect       |      Status:  new       
   Priority:  major        |   Milestone:  sage-4.6  
  Component:  algebra      |    Keywords:            
     Author:               |    Upstream:  N/A       
   Reviewer:               |      Merged:            
Work_issues:               |  
---------------------------+------------------------------------------------
 `p.roots(ring=CC)` where `p` is an element `QQ['y']['x']` whose
 coefficient do not depend on `y` leads to several different errors
 depending on the value of p.  I guess there are in fact several distinct
 issues.  The final crash might be related to #9826.

 {{{
 ~$ sage
 ----------------------------------------------------------------------
 | Sage Version 4.5.3, Release Date: 2010-09-04                       |
 | Type notebook() for the GUI, and license() for information.        |
 ----------------------------------------------------------------------
 sage: R.<x> = QQ['y'][]
 sage: (-x+1).roots(ring=CC)
 [(1.00000000000000, 1)]
 sage: (-1/2*x+1).roots(ring=CC)
 ERROR: An unexpected error occurred while tokenizing input
 The following traceback may be corrupted or invalid
 The error message is: ('EOF in multi-line statement', (19469, 0))

 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)

 /home/marc/<ipython console> in <module>()

 /home/marc/opt/sage-4.5.3/local/lib/python2.6/site-
 packages/sage/rings/polynomial/polynomial_element.so in
 sage.rings.polynomial.polynomial_element.Polynomial.roots
 (sage/rings/polynomial/polynomial_element.c:31226)()

 /home/marc/opt/sage-4.5.3/local/lib/python2.6/site-
 packages/sage/rings/polynomial/polynomial_element.so in
 sage.rings.polynomial.polynomial_element.Polynomial.change_ring
 (sage/rings/polynomial/polynomial_element.c:16456)()

 /home/marc/opt/sage-4.5.3/local/lib/python2.6/site-
 packages/sage/structure/parent.so in sage.structure.parent.Parent.__call__
 (sage/structure/parent.c:6407)()

 /home/marc/opt/sage-4.5.3/local/lib/python2.6/site-
 packages/sage/structure/coerce_maps.so in
 sage.structure.coerce_maps.DefaultConvertMap_unique._call_
 (sage/structure/coerce_maps.c:3108)()

 /home/marc/opt/sage-4.5.3/local/lib/python2.6/site-
 packages/sage/structure/coerce_maps.so in
 sage.structure.coerce_maps.DefaultConvertMap_unique._call_
 (sage/structure/coerce_maps.c:3010)()

 /home/marc/opt/sage-4.5.3/local/lib/python2.6/site-
 packages/sage/rings/polynomial/polynomial_ring.pyc in
 _element_constructor_(self, x, check, is_gen, construct, **kwds)
     311                 x = x.Polrev()
     312
 --> 313         return C(self, x, check, is_gen, construct=construct,
 **kwds)
     314
     315     def is_integral_domain(self, proof = True):

 /home/marc/opt/sage-4.5.3/local/lib/python2.6/site-
 packages/sage/rings/polynomial/polynomial_real_mpfr_dense.so in
 sage.rings.polynomial.polynomial_real_mpfr_dense.PolynomialRealDense.__init__
 (sage/rings/polynomial/polynomial_real_mpfr_dense.c:3609)()

 /home/marc/opt/sage-4.5.3/local/lib/python2.6/site-
 packages/sage/structure/parent.so in sage.structure.parent.Parent.__call__
 (sage/structure/parent.c:6407)()

 /home/marc/opt/sage-4.5.3/local/lib/python2.6/site-
 packages/sage/structure/coerce_maps.so in
 sage.structure.coerce_maps.DefaultConvertMap_unique._call_
 (sage/structure/coerce_maps.c:3108)()

 /home/marc/opt/sage-4.5.3/local/lib/python2.6/site-
 packages/sage/structure/coerce_maps.so in
 sage.structure.coerce_maps.DefaultConvertMap_unique._call_
 (sage/structure/coerce_maps.c:3010)()

 /home/marc/opt/sage-4.5.3/local/lib/python2.6/site-
 packages/sage/rings/real_mpfr.so in
 sage.rings.real_mpfr.RealField_class._element_constructor_
 (sage/rings/real_mpfr.c:5058)()

 /home/marc/opt/sage-4.5.3/local/lib/python2.6/site-
 packages/sage/rings/real_mpfr.so in sage.rings.real_mpfr.RealNumber._set
 (sage/rings/real_mpfr.c:8767)()

 TypeError: Unable to convert x (='-1/2') to real number.
 sage: (-1/2*x+1/2).roots()
 ---------------------------------------------------------------------------
 NotImplementedError                       Traceback (most recent call
 last)

 /home/marc/<ipython console> in <module>()

 /home/marc/opt/sage-4.5.3/local/lib/python2.6/site-
 packages/sage/rings/polynomial/polynomial_element.so in
 sage.rings.polynomial.polynomial_element.Polynomial.roots
 (sage/rings/polynomial/polynomial_element.c:31591)()

 NotImplementedError: root finding for this polynomial not implemented
 sage: (-1/2*x+1/2).roots(ring=CC)
 *** glibc detected *** python: munmap_chunk(): invalid pointer:
 0x0000000001208958 ***
 ======= Backtrace: =========
 /lib/libc.so.6[0x3c38271ad6]
 
/home/marc/opt/sage-4.5.3/local/lib/libmpfr.so.1(mpfr_clear+0x45)[0x7fc911f80a45]
 /home/marc/opt/sage-4.5.3/local/lib/python2.6/site-
 
packages/sage/rings/polynomial/polynomial_real_mpfr_dense.so(+0x7867)[0x7fc90a74d867]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(+0xa241c)[0x7fc91e85841c]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyObject_Call+0x53)[0x7fc91e7fce13]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x3af3)[0x7fc91e89f973]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cd)[0x7fc91e8a2d1d]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(+0x730df)[0x7fc91e8290df]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyObject_Call+0x53)[0x7fc91e7fce13]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(+0x5819f)[0x7fc91e80e19f]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyObject_Call+0x53)[0x7fc91e7fce13]
 /home/marc/opt/sage-4.5.3/local/lib/python2.6/site-
 packages/sage/structure/coerce_maps.so(+0x12724)[0x7fc910609724]
 /home/marc/opt/sage-4.5.3/local/lib/python2.6/site-
 packages/sage/structure/parent.so(+0x25ec2)[0x7fc9174a2ec2]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyObject_Call+0x53)[0x7fc91e7fce13]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(+0xaba8c)[0x7fc91e861a8c]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyObject_Call+0x53)[0x7fc91e7fce13]
 /home/marc/opt/sage-4.5.3/local/lib/python2.6/site-
 packages/sage/rings/polynomial/polynomial_element.so(+0xd3c2)[0x7fc90bc873c2]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyObject_Call+0x53)[0x7fc91e7fce13]
 /home/marc/opt/sage-4.5.3/local/lib/python2.6/site-
 packages/sage/rings/polynomial/polynomial_element.so(+0xd191c)[0x7fc90bd4b91c]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x5a8e)[0x7fc91e8a190e]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cd)[0x7fc91e8a2d1d]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyEval_EvalCode+0x32)[0x7fc91e8a2df2]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x6244)[0x7fc91e8a20c4]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cd)[0x7fc91e8a2d1d]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x5235)[0x7fc91e8a10b5]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cd)[0x7fc91e8a2d1d]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x5235)[0x7fc91e8a10b5]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x5ab2)[0x7fc91e8a1932]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cd)[0x7fc91e8a2d1d]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x5235)[0x7fc91e8a10b5]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cd)[0x7fc91e8a2d1d]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x5235)[0x7fc91e8a10b5]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cd)[0x7fc91e8a2d1d]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x5235)[0x7fc91e8a10b5]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cd)[0x7fc91e8a2d1d]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyEval_EvalCode+0x32)[0x7fc91e8a2df2]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyRun_FileExFlags+0xb0)[0x7fc91e8c2c90]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(PyRun_SimpleFileExFlags+0xdc)[0x7fc91e8c2e5c]
 
/home/marc/opt/sage-4.5.3/local/lib/libpython2.6.so.1.0(Py_Main+0xb36)[0x7fc91e8d0186]
 /lib/libc.so.6(__libc_start_main+0xfd)[0x3c3821ec4d]
 python[0x400699]
 ======= Memory map: ========
 00400000-00401000 r-xp 00000000 08:0a 1787644
 /home/marc/opt/sage-4.5.3/local/bin/python
 00600000-00601000 rw-p 00000000 08:0a 1787644
 /home/marc/opt/sage-4.5.3/local/bin/python
 00cb1000-05306000 rw-p 00000000 00:00 0
 [heap]
 32b2c00000-32b2c16000 r-xp 00000000 08:06 40741
 /lib/libgcc_s.so.1
 32b2c16000-32b2e15000 ---p 00016000 08:06 40741
 /lib/libgcc_s.so.1
 32b2e15000-32b2e16000 rw-p 00015000 08:06 40741
 /lib/libgcc_s.so.1
 3c37e00000-3c37e1e000 r-xp 00000000 08:06 40724
 /lib/ld-2.11.2.so
 3c3801d000-3c3801e000 r--p 0001d000 08:06 40724
 /lib/ld-2.11.2.so
 3c3801e000-3c3801f000 rw-p 0001e000 08:06 40724
 /lib/ld-2.11.2.so
 3c3801f000-3c38020000 rw-p 00000000 00:00 0
 3c38200000-3c38358000 r-xp 00000000 08:06 40737
 /lib/libc-2.11.2.so
 3c38358000-3c38557000 ---p 00158000 08:06 40737
 /lib/libc-2.11.2.so
 3c38557000-3c3855b000 r--p 00157000 08:06 40737
 /lib/libc-2.11.2.so
 3c3855b000-3c3855c000 rw-p 0015b000 08:06 40737
 /lib/libc-2.11.2.so
 3c3855c000-3c38561000 rw-p 00000000 00:00 0
 3c38600000-3c38680000 r-xp 00000000 08:06 40787
 /lib/libm-2.11.2.so
 3c38680000-3c38880000 ---p 00080000 08:06 40787
 /lib/libm-2.11.2.so
 3c38880000-3c38881000 r--p 00080000 08:06 40787
 /lib/libm-2.11.2.so
 3c38881000-3c38882000 rw-p 00081000 08:06 40787
 /lib/libm-2.11.2.so
 3c38a00000-3c38a02000 r-xp 00000000 08:06 40738
 /lib/libdl-2.11.2.so
 3c38a02000-3c38c02000 ---p 00002000 08:06 40738
 /lib/libdl-2.11.2.so
 3c38c02000-3c38c03000 r--p 00002000 08:06 40738
 /lib/libdl-2.11.2.so
 3c38c03000-3c38c04000 rw-p 00003000 08:06 40738
 /lib/libdl-2.11.2.so
 3c38e00000-3c38e17000 r-xp 00000000 08:06 40766
 /lib/libpthread-2.11.2.so
 3c38e17000-3c39016000 ---p 00017000 08:06 40766
 /lib/libpthread-2.11.2.so
 3c39016000-3c39017000 r--p 00016000 08:06 40766
 /lib/libpthread-2.11.2.so
 3c39017000-3c39018000 rw-p 00017000 08:06 40766
 /lib/libpthread-2.11.2.so
 3c39018000-3c3901c000 rw-p 00000000 00:00 0
 3c4ba00000-3c4ba08000 r-xp 00000000 08:06 40917
 /lib/libcrypt-2.11.2.so
 3c4ba08000-3c4bc07000 ---p 00008000 08:06 40917
 /lib/libcrypt-2.11.2.so
 3c4bc07000-3c4bc08000 r--p 00007000 08:06 40917
 /lib/libcrypt-2.11.2.so
 3c4bc08000-3c4bc09000 rw-p 00008000 08:06 40917
 /lib/libcrypt-2.11.2.so
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10147>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to