cschwan/sage-on-gentoo — Issue #119: pynac: Error importing sage.rings.integer
Author: gagern
Created: 2012-02-01 20:00:12+00:00
State: open

$ sage -n
----------------------------------------------------------------------
| Sage Version 4.7.2, Release Date: 2011-10-29 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------

Please wait while the Sage Notebook server starts...
terminate called after throwing an instance of 'std::runtime_error'
what():
/usr/lib64/libcsage.so(print_backtrace+0x24)[0x7ff169292bc4]
/usr/lib64/libcsage.so(sigdie+0xe)[0x7ff169292c4e]
/usr/lib64/libcsage.so(sage_signal_handler+0x171)[0x7ff169292e11]
/lib64/libpthread.so.0[0x3a6de107f0]
/lib64/libc.so.6(gsignal+0x35)[0x3a6d235c75]
/lib64/libc.so.6(abort+0x17a)[0x3a6d23701a]
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6(_ZN9__gnu_cxx27__verbose_terminate_handlerEv+0x10d)[0x3a6eabb06d]
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6[0x3a6eab9266]
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6[0x3a6eab9293]
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6[0x3a6eab93de]
/usr/lib64/libpynac-0.2.so.3(_Z8py_errorPKc+0x69)[0x7ff165e44389]
/usr/lib64/libpynac-0.2.so.3(_Z7IntegerRKl+0xfc)[0x7ff165e4453c]
/usr/lib64/libpynac-0.2.so.3(_Z8RationalRKlS0_+0x11)[0x7ff165e44571]
/usr/lib64/libpynac-0.2.so.3(_ZNK5GiNaC8Number_TdvES0_+0x333)[0x7ff165e47873]
/usr/lib64/libpynac-0.2.so.3(_ZN5GiNaC7numericC1Ell+0xef)[0x7ff165e4c66f]
/usr/lib64/libpynac-0.2.so.3(_ZN5GiNaC12library_initC2Ev+0x399)[0x7ff165e87fd9]
/usr/lib64/libpynac-0.2.so.3(+0x1c2726)[0x7ff165e89726]
/usr/lib64/libpynac-0.2.so.3(+0x1c32c6)[0x7ff165e8a2c6]

------------------------------------------------------------------------
Unhandled SIGABRT: An abort() occurred in Sage.
This probably occurred because a *compiled* component of Sage has a bug
in it and 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.
------------------------------------------------------------------------
/usr/bin/sage-notebook: line 4: 18666 Aborted /usr/bin/sage-notebook-real "$@"

Had this run through gdb. Exception is thrown in pynac:

#6 in py_error (s=<optimized out>)
at sci-libs/pynac-0.2.3/work/burcin-pynac-pynac-0.2.3/ginac/numeric.cpp:131
#7 in Integer (x=@0x61e7b0: 2)
at sci-libs/pynac-0.2.3/work/burcin-pynac-pynac-0.2.3/ginac/numeric.cpp:169

The relevant pieces of code:

129 void py_error(const char* s) {
130 if (PyErr_Occurred()) {
131 throw std::runtime_error("");
132 }
133 }

and

166 // Slow version since we can't call Cython-exported code yet.
167 PyObject* m = PyImport_ImportModule("sage.rings.integer");
168 if (!m)
169 py_error("Error importing sage.rings.integer");

So there appears to be an error message present in the source, although the called function makes no use at all of this. It appears that for some reason, the named python module won't load.

Not sure whether this is in some way related to #118, but due to that bug I can't compare this to a non-notebook launch.