Opened 4 years ago

Closed 3 months ago

Calculating eigenvectors of symbolic matrices leads to a crash.

Reported by: Owned by: stassev minor sage-9.3 symbolics eigenvalues, linear algebra Dave Morris Kwankyu Lee Fixed upstream, in a later stable release. f6500fb f6500fbb327d56f6d75f9eb6d130ad39b224ef1e

Below is my whole sage session with a simple example leading to the crash.

```\$ sage

┌───────────────────────────────────────────────────┐
│ SageMath version 7.6, Release Date: 2017-03-25    │
│ Type "notebook()" for the browser-based notebook interface.
│
│ Type "help()" for help.
└───────────────────────────────────────────────────┘

sage: x=var('x')
sage: matrix([ [ x,x*x ],[ 1,0 ] ]).eigenvectors_right()

------------------------------------------------------------------------
/usr/lib/python2.7/site-packages/cysignals/signals.so(+0x5187)[0x7ffa55ec9187]
/usr/lib/python2.7/site-packages/cysignals/signals.so(+0x5d05)[0x7ffa55ec9d05]
/usr/lib/python2.7/site-packages/cysignals/signals.so(+0x8278)[0x7ffa55ecc278]
/usr/lib/python2.7/site-packages/numpy/core/umath.so(+0x10cfab)[0x7ff811d5afab]
/usr/lib/libpython2.7.so.1.0(PyNumber_Multiply+0x29)[0x7ffa5edaf859]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x1377)[0x7ffa5ee4b0a7]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x8dc)[0x7ffa5ee538dc]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCode+0x28)[0x7ffa5ee539e8]
/usr/lib/libpython2.7.so.1.0(PyImport_ExecCodeModuleEx+0xa7)[0x7ffa5ee63fc7]
/usr/lib/libpython2.7.so.1.0(+0xff25e)[0x7ffa5ee6425e]
/usr/lib/libpython2.7.so.1.0(+0xfff81)[0x7ffa5ee64f81]
/usr/lib/libpython2.7.so.1.0(+0x1004ec)[0x7ffa5ee654ec]
/usr/lib/libpython2.7.so.1.0(PyImport_ImportModuleLevel+0x2ae)[0x7ffa5ee65d8e]
/usr/lib/libpython2.7.so.1.0(+0xe2907)[0x7ffa5ee47907]
/usr/lib/libpython2.7.so.1.0(PyObject_Call+0x52)[0x7ffa5edb1682]
/usr/lib/libpython2.7.so.1.0(PyEval_CallObjectWithKeywords+0x56)[0x7ffa5ee49716]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x2822)[0x7ffa5ee4c552]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x8dc)[0x7ffa5ee538dc]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCode+0x28)[0x7ffa5ee539e8]
/usr/lib/libpython2.7.so.1.0(PyImport_ExecCodeModuleEx+0xa7)[0x7ffa5ee63fc7]
/usr/lib/libpython2.7.so.1.0(+0xff25e)[0x7ffa5ee6425e]
/usr/lib/libpython2.7.so.1.0(+0x100811)[0x7ffa5ee65811]
/usr/lib/libpython2.7.so.1.0(+0xfff81)[0x7ffa5ee64f81]
/usr/lib/libpython2.7.so.1.0(+0x100209)[0x7ffa5ee65209]
/usr/lib/libpython2.7.so.1.0(PyImport_ImportModuleLevel+0x1c8)[0x7ffa5ee65ca8]
/usr/lib/libpython2.7.so.1.0(+0xe2907)[0x7ffa5ee47907]
/usr/lib/libpython2.7.so.1.0(PyObject_Call+0x52)[0x7ffa5edb1682]
/usr/lib/libpython2.7.so.1.0(PyEval_CallObjectWithKeywords+0x56)[0x7ffa5ee49716]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x2822)[0x7ffa5ee4c552]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x8dc)[0x7ffa5ee538dc]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCode+0x28)[0x7ffa5ee539e8]
/usr/lib/libpython2.7.so.1.0(PyImport_ExecCodeModuleEx+0xa7)[0x7ffa5ee63fc7]
/usr/lib/libpython2.7.so.1.0(+0xff25e)[0x7ffa5ee6425e]
/usr/lib/libpython2.7.so.1.0(+0xfff81)[0x7ffa5ee64f81]
/usr/lib/libpython2.7.so.1.0(+0x100209)[0x7ffa5ee65209]
/usr/lib/libpython2.7.so.1.0(PyImport_ImportModuleLevel+0x183)[0x7ffa5ee65c63]
/usr/lib/libpython2.7.so.1.0(+0xe2907)[0x7ffa5ee47907]
/usr/lib/libpython2.7.so.1.0(PyObject_Call+0x52)[0x7ffa5edb1682]
/usr/lib/libpython2.7.so.1.0(PyEval_CallObjectWithKeywords+0x56)[0x7ffa5ee49716]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x2822)[0x7ffa5ee4c552]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x8dc)[0x7ffa5ee538dc]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCode+0x28)[0x7ffa5ee539e8]
/usr/lib/libpython2.7.so.1.0(PyImport_ExecCodeModuleEx+0xa7)[0x7ffa5ee63fc7]
/usr/lib/libpython2.7.so.1.0(+0xff25e)[0x7ffa5ee6425e]
/usr/lib/libpython2.7.so.1.0(+0x100811)[0x7ffa5ee65811]
/usr/lib/libpython2.7.so.1.0(+0xfff81)[0x7ffa5ee64f81]
/usr/lib/libpython2.7.so.1.0(+0x100209)[0x7ffa5ee65209]
/usr/lib/libpython2.7.so.1.0(PyImport_ImportModuleLevel+0x1c8)[0x7ffa5ee65ca8]
/usr/lib/libpython2.7.so.1.0(+0xe2907)[0x7ffa5ee47907]
/usr/lib/libpython2.7.so.1.0(PyObject_Call+0x52)[0x7ffa5edb1682]
/usr/lib/libpython2.7.so.1.0(PyEval_CallObjectWithKeywords+0x56)[0x7ffa5ee49716]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x2822)[0x7ffa5ee4c552]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x8dc)[0x7ffa5ee538dc]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCode+0x28)[0x7ffa5ee539e8]
/usr/lib/libpython2.7.so.1.0(PyImport_ExecCodeModuleEx+0xa7)[0x7ffa5ee63fc7]
/usr/lib/libpython2.7.so.1.0(+0xff25e)[0x7ffa5ee6425e]
/usr/lib/libpython2.7.so.1.0(+0xfff81)[0x7ffa5ee64f81]
/usr/lib/libpython2.7.so.1.0(+0x1004ec)[0x7ffa5ee654ec]
/usr/lib/libpython2.7.so.1.0(PyImport_ImportModuleLevel+0x2ae)[0x7ffa5ee65d8e]
/usr/lib/libpython2.7.so.1.0(+0xe2907)[0x7ffa5ee47907]
/usr/lib/libpython2.7.so.1.0(PyObject_Call+0x52)[0x7ffa5edb1682]
/usr/lib/libpython2.7.so.1.0(PyEval_CallObjectWithKeywords+0x56)[0x7ffa5ee49716]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x2822)[0x7ffa5ee4c552]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x8dc)[0x7ffa5ee538dc]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCode+0x28)[0x7ffa5ee539e8]
/usr/lib/libpython2.7.so.1.0(PyImport_ExecCodeModuleEx+0xa7)[0x7ffa5ee63fc7]
/usr/lib/libpython2.7.so.1.0(+0xff25e)[0x7ffa5ee6425e]
/usr/lib/libpython2.7.so.1.0(+0x100811)[0x7ffa5ee65811]
/usr/lib/libpython2.7.so.1.0(+0xfff81)[0x7ffa5ee64f81]
/usr/lib/libpython2.7.so.1.0(+0x10029f)[0x7ffa5ee6529f]
/usr/lib/libpython2.7.so.1.0(PyImport_ImportModuleLevel+0x183)[0x7ffa5ee65c63]
/usr/lib/libpython2.7.so.1.0(+0xe2907)[0x7ffa5ee47907]
/usr/lib/libpython2.7.so.1.0(PyObject_Call+0x52)[0x7ffa5edb1682]
/usr/lib/libpython2.7.so.1.0(PyObject_CallFunctionObjArgs+0xce)[0x7ffa5edb1fae]
/usr/lib/python2.7/site-packages/sage/modules/free_module_element.so(+0x10bd2)[0x7ff841981bd2]
/usr/lib/python2.7/site-packages/sage/modules/free_module_element.so(+0x17614)[0x7ff841988614]
/usr/lib/python2.7/site-packages/sage/matrix/matrix_symbolic_dense.so(+0x6f35)[0x7ff819001f35]
/usr/lib/python2.7/site-packages/sage/matrix/matrix_symbolic_dense.so(+0x70b0)[0x7ff8190020b0]
/usr/lib/python2.7/site-packages/sage/matrix/matrix_symbolic_dense.so(+0x16665)[0x7ff819011665]
/usr/lib/python2.7/site-packages/sage/matrix/matrix_symbolic_dense.so(+0x9c4d)[0x7ff819004c4d]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x8858)[0x7ffa5ee52588]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x8dc)[0x7ffa5ee538dc]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCode+0x28)[0x7ffa5ee539e8]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x7fb1)[0x7ffa5ee51ce1]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x8dc)[0x7ffa5ee538dc]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5fd2)[0x7ffa5ee4fd02]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x8dc)[0x7ffa5ee538dc]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5fd2)[0x7ffa5ee4fd02]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x8dc)[0x7ffa5ee538dc]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5fd2)[0x7ffa5ee4fd02]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x8dc)[0x7ffa5ee538dc]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5fd2)[0x7ffa5ee4fd02]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x8dc)[0x7ffa5ee538dc]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5fd2)[0x7ffa5ee4fd02]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x8dc)[0x7ffa5ee538dc]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5fd2)[0x7ffa5ee4fd02]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x8dc)[0x7ffa5ee538dc]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCode+0x28)[0x7ffa5ee539e8]
/usr/lib/libpython2.7.so.1.0(+0x108efe)[0x7ffa5ee6defe]
/usr/lib/libpython2.7.so.1.0(PyRun_FileExFlags+0x81)[0x7ffa5ee6f1c1]
/usr/lib/libpython2.7.so.1.0(PyRun_SimpleFileExFlags+0xf4)[0x7ffa5ee704e4]
/usr/lib/libpython2.7.so.1.0(Py_Main+0xce0)[0x7ffa5ee82ca0]
/usr/lib/libc.so.6(__libc_start_main+0xea)[0x7ffa5e7c243a]
python2(_start+0x2a)[0x5584c1f307ea]
------------------------------------------------------------------------
Attaching gdb to process id 28119.

Failed to run gdb.
Failed to run gdb.
Install gdb for enhanced tracebacks.
------------------------------------------------------------------------
Unhandled SIGFPE: An unhandled floating point exception occurred.
This probably occurred because a *compiled* module has a bug
in it and is not properly wrapped with sig_on(), sig_off().
Python will now terminate.
------------------------------------------------------------------------
```

comment:1 Changed 4 years ago by mforets

Hi, this is running on my system:

```sage: matrix([ [ x,x*x ],[ 1,0 ] ]).eigenvectors_right()

[(-1/2*x*(sqrt(5) - 1), [(1, -1/2*(sqrt(5) + 1)/x)], 1),
(1/2*x*(sqrt(5) + 1), [(1, 1/2*(sqrt(5) - 1)/x)], 1)]
```

tested both in v.7.6. and in the latest v.8.0.beta12.

(that said, i have no idea what could be the issue in your session, probably someone can answer in the usual forums).

comment:2 Changed 4 years ago by rws

• Description modified (diff)

I'm also failing the confirmation. You seem to be using a special installation of Sage because the system Python is used. What's your setup/system?

comment:3 Changed 4 years ago by rws

• Milestone changed from sage-8.0 to sage-8.1
• Status changed from new to needs_info

comment:4 Changed 4 years ago by stassev

I'm using the archlinux sagemath package, so I reported it as an archlinux bug (https://bugs.archlinux.org/task/54620). There, I was told the following:

This is caused by ecl 16.1.3. We are applying the patch from https://trac.sagemath.org/ticket/22191 but apparently it doesn't fix all issues

comment:5 Changed 3 months ago by gh-DaveWitteMorris

• Branch set to public/23332

comment:6 Changed 3 months ago by gh-DaveWitteMorris

• Authors set to Dave Morris
• Keywords eigenvalues linear algebra added
• Milestone changed from sage-8.1 to sage-9.3
• Priority changed from major to minor
• Report Upstream changed from N/A to Fixed upstream, in a later stable release.
• Status changed from needs_info to needs_review

The archlinux ticket was closed long ago, so I think we can close this old ticket. The PR just adds the ticket's example as a regression doctest for `eigenvectors_left` and `eigenvectors_right`.

New commits:

 ​f6500fb `trac 23332 doctests`

comment:7 Changed 3 months ago by klee

• Reviewers set to Kwankyu Lee
• Status changed from needs_review to positive_review

Looks good.

comment:8 Changed 3 months ago by gh-DaveWitteMorris

Thanks for the quick review!

comment:9 Changed 3 months ago by vbraun

• Branch changed from public/23332 to f6500fbb327d56f6d75f9eb6d130ad39b224ef1e
• Resolution set to fixed
• Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.