#11116: Pynac module not initialized before being used. This causes a crash on
64-bit OpenSolaris.
------------------------+---------------------------------------------------
Reporter: drkirkby | Owner: drkirkby
Type: defect | Status: new
Priority: major | Milestone: sage-4.7
Component: solaris | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------+---------------------------------------------------
Old description:
> Sage builds fully 64-bit on Solaris 10 (SPARC).
>
> On 64-bit !OpenSolaris or Solaris 10, the stats package R fails to build.
> Since R is an external program, one can just touch
> {{{SAGE_ROOT/spkg/installed/r-$versions}}} and get an almost complete
> Sage.
>
> However, this 64-bit Sage crashes at startup with !OpenSolaris on x86, as
> discussed at:
>
> http://groups.google.com/group/sage-
> devel/browse_thread/thread/efc864c79fed92df?hl=en
>
> (one would expect similar on Solaris 10 x86 and probably SPARC too).
>
> A backtrace with gdb on a Sun Ultra 27 running !OpenSolaris 06/2009
> shows:
>
> {{{
> drkirkby@hawk:~/64/sage-4.7.alpha3$ ./sage -gdb
> Building Sage on Solaris in 64-bit mode
> Creating SAGE_LOCAL/lib/sage-64.txt since it does not exist
> Detected SAGE64 flag
> Building Sage on Solaris in 64-bit mode
> ----------------------------------------------------------------------
> | Sage Version 4.7.alpha3, Release Date: 2011-03-31 |
> | Type notebook() for the GUI, and license() for information. |
> ----------------------------------------------------------------------
> **********************************************************************
> * *
> * Warning: this is a prerelease version, and it may be unstable. *
> * *
> **********************************************************************
> /export/home/drkirkby/64/sage-4.7.alpha3/local/bin/sage-ipython
> GNU gdb 6.8
> Copyright (C) 2008 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show
> copying"
> and "show warranty" for details.
> This GDB was configured as "i386-pc-solaris2.11"...
> warning: Lowest section in /lib/amd64/libdl.so.1 is .dynamic at
> 00000000000000b0
> Python 2.6.4 (r264:75706, Apr 1 2011, 15:07:52)
> [GCC 4.5.0] on sunos5
> Type "help", "copyright", "credits" or "license" for more information.
> warning: Lowest section in /lib/amd64/libintl.so.1 is .dynamic at
> 00000000000000b0
> warning: Lowest section in /lib/amd64/libpthread.so.1 is .dynamic at
> 00000000000000b0
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00000000003eb0a5 in ?? ()
> (gdb) bt
> #0 0x00000000003eb0a5 in ?? ()
> #1 0xfffffd7fff2ac5d1 in _Unwind_RaiseException_Body () from
> /lib/64/libc.so.1
> #2 0xfffffd7fff2ac855 in _Unwind_RaiseException () from
> /lib/64/libc.so.1
> #3 0xfffffd7ff91d6729 in __cxa_throw (obj=<value optimized out>,
> tinfo=<value optimized out>, dest=<value optimized out>)
> at ../../../../../gcc-4.5.0/libstdc++-v3/libsupc++/eh_throw.cc:78
> #4 0xfffffd7fcec6d5ff in GiNaC::function::find_function
> (name=@0x4a359b0, nparams=2) at function.cpp:1446
> #5 0xfffffd7fce9454ad in
> __pyx_f_4sage_8symbolic_8function_15BuiltinFunction__is_registered
> (__pyx_v_self=0x4a142f0) at sage/symbolic/function.cpp:7301
> #6 0xfffffd7fce950755 in
> __pyx_pf_4sage_8symbolic_8function_8Function___init__
> (__pyx_v_self=0x4a142f0, __pyx_args=<value optimized out>,
> __pyx_kwds=<value optimized out>) at sage/symbolic/function.cpp:2374
> #7 0xfffffd7fffde7a70 in ?? ()
> #8 0x00000016745f5f63 in ?? ()
> #9 0x0000000004a0e5a8 in ?? ()
> #10 0x0000000004a142f0 in ?? ()
> #11 0x000000000000000b in ?? ()
> #12 0x0000000004a0e5a8 in ?? ()
> #13 0x0000000002c913e8 in ?? ()
> #14 0xfffffd7fd76c2b30 in module_members () from
> /export/home/drkirkby/64/sage-4.7.alpha3/local/lib//libpython2.6.so.1.0
> #15 0x0000002752657572 in ?? ()
> #16 0xfffffd7fd76d5c60 in ?? () from
> /export/home/drkirkby/64/sage-4.7.alpha3/local/lib//libpython2.6.so.1.0
> #17 0x2800000040520000 in ?? ()
> #18 0xfffffd7fd76d5920 in ?? () from
> /export/home/drkirkby/64/sage-4.7.alpha3/local/lib//libpython2.6.so.1.0
> #19 0x0000000000000005 in ?? ()
> #20 0x00000000049e4db8 in ?? ()
> ---Type <return> to continue, or q <return> to quit---
> #21 0x0000000000000000 in ?? ()
> }}}
>
> Burcin Erocal produced this Python call stack.
>
> {{{
> File "/export/home/burcin/sage-4.7.alpha3/local/bin/sage-ipython", line
> 21, in <module>
> ipy_sage = IPython.Shell.start()
> File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
> packages/IPython/Shell.py", line 1233, in start
> return shell(user_ns = user_ns)
> File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
> packages/IPython/Shell.py", line 78, in __init__
> debug=debug,shell_class=shell_class)
> File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
> packages/IPython/ipmaker.py", line 644, in make_IPython
> force_import(profmodname)
> File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
> packages/IPython/ipmaker.py", line 66, in force_import
> __import__(modname)
> File "ipy_profile_sage.py", line 7, in <module>
> import sage.all_cmdline
> File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
> packages/sage/all_cmdline.py", line 14, in <module>
> from sage.all import *
> File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
> packages/sage/all.py", line 75, in <module>
> from sage.schemes.all import *
> File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
> packages/sage/schemes/all.py", line 25, in <module>
> from hyperelliptic_curves.all import *
> File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
> packages/sage/schemes/hyperelliptic_curves/all.py", line 1, in <module>
> from constructor import HyperellipticCurve
> File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
> packages/sage/schemes/hyperelliptic_curves/constructor.py", line 11, in
> <module>
> from sage.schemes.generic.all import ProjectiveSpace
> File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
> packages/sage/schemes/generic/all.py", line 4, in <module>
> from affine_space import AffineSpace, is_AffineSpace
> File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
> packages/sage/schemes/generic/affine_space.py", line 24, in <module>
> import algebraic_scheme
> File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
> packages/sage/schemes/generic/algebraic_scheme.py", line 143, in <module>
> import toric_variety
> File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
> packages/sage/schemes/generic/toric_variety.py", line 236, in <module>
> from sage.geometry.cone import Cone, is_Cone
> File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
> packages/sage/geometry/cone.py", line 174, in <module>
> from sage.combinat.posets.posets import FinitePoset
> File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
> packages/sage/combinat/posets/posets.py", line 24, in <module>
> from sage.graphs.all import DiGraph
> File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
> packages/sage/graphs/all.py", line 16, in <module>
> from graph_editor import graph_editor
> File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
> packages/sage/graphs/graph_editor.py", line 22, in <module>
> from sagenb.misc.support import EMBEDDED_MODE
> File
> "/export/home/burcin/sage-4.7.alpha3/devel/sagenb/sagenb/misc/support.py",
> line 563, in <module>
> from sage.symbolic.all import Expression, SR
> File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
> packages/sage/symbolic/all.py", line 9, in <module>
> from sage.symbolic.relation import solve, solve_mod, solve_ineq
> File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
> packages/sage/symbolic/relation.py", line 314, in <module>
> from sage.calculus.calculus import maxima
> File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
> packages/sage/calculus/calculus.py", line 374, in <module>
> from sage.symbolic.integration.integral import indefinite_integral, \
> File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
> packages/sage/symbolic/integration/integral.py", line 129, in <module>
> indefinite_integral = IndefiniteIntegral()
> File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
> packages/sage/symbolic/integration/integral.py", line 62, in __init__
> BuiltinFunction.__init__(self, "integrate", nargs=2)
> }}}
>
> Burchin writes on sage-devel
>
> ''
> It seems that cones.py looks for posets.py, which needs the graphs
> module, which initializes the graph_editor. The graph editor tries to
> see if it's in the notebook or the command line, but sagenb imports SR
> and Expression from sage.symbolic.all (line 563 of
> sagenb/misc/support.py). This tries to initialize the functions
> (integrate in this case) before pynac is initialized...''
>
> ''We need a better solution for making sure modules are initialized
> properly before anything is imported from them. I thought putting an
> __init__.py file in sage/symbolic/ with "import pynac" would solve the
> problem. However, it seems that python just ignores that file.
> ''
>
> This is one of the very few issues preventing a complete 64-bit build on
> Solaris/!OpenSolaris, so it would be nice to crack this one.
New description:
Sage builds fully 64-bit on Solaris 10 (SPARC).
On 64-bit !OpenSolaris or Solaris 10, the stats package R fails to build.
Since R is an external program, one can just touch
{{{SAGE_ROOT/spkg/installed/r-$versions}}} and get an almost complete
Sage.
However, this 64-bit Sage crashes at startup with !OpenSolaris on x86, as
discussed at:
http://groups.google.com/group/sage-
devel/browse_thread/thread/efc864c79fed92df?hl=en
(one would expect similar on Solaris 10 x86 and probably SPARC too).
A backtrace with gdb on a Sun Ultra 27 running !OpenSolaris 06/2009 shows:
{{{
drkirkby@hawk:~/64/sage-4.7.alpha3$ ./sage -gdb
Building Sage on Solaris in 64-bit mode
Creating SAGE_LOCAL/lib/sage-64.txt since it does not exist
Detected SAGE64 flag
Building Sage on Solaris in 64-bit mode
----------------------------------------------------------------------
| Sage Version 4.7.alpha3, Release Date: 2011-03-31 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
**********************************************************************
* *
* Warning: this is a prerelease version, and it may be unstable. *
* *
**********************************************************************
/export/home/drkirkby/64/sage-4.7.alpha3/local/bin/sage-ipython
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i386-pc-solaris2.11"...
warning: Lowest section in /lib/amd64/libdl.so.1 is .dynamic at
00000000000000b0
Python 2.6.4 (r264:75706, Apr 1 2011, 15:07:52)
[GCC 4.5.0] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
warning: Lowest section in /lib/amd64/libintl.so.1 is .dynamic at
00000000000000b0
warning: Lowest section in /lib/amd64/libpthread.so.1 is .dynamic at
00000000000000b0
Program received signal SIGSEGV, Segmentation fault.
0x00000000003eb0a5 in ?? ()
(gdb) bt
#0 0x00000000003eb0a5 in ?? ()
#1 0xfffffd7fff2ac5d1 in _Unwind_RaiseException_Body () from
/lib/64/libc.so.1
#2 0xfffffd7fff2ac855 in _Unwind_RaiseException () from /lib/64/libc.so.1
#3 0xfffffd7ff91d6729 in __cxa_throw (obj=<value optimized out>,
tinfo=<value optimized out>, dest=<value optimized out>)
at ../../../../../gcc-4.5.0/libstdc++-v3/libsupc++/eh_throw.cc:78
#4 0xfffffd7fcec6d5ff in GiNaC::function::find_function (name=@0x4a359b0,
nparams=2) at function.cpp:1446
#5 0xfffffd7fce9454ad in
__pyx_f_4sage_8symbolic_8function_15BuiltinFunction__is_registered
(__pyx_v_self=0x4a142f0) at sage/symbolic/function.cpp:7301
#6 0xfffffd7fce950755 in
__pyx_pf_4sage_8symbolic_8function_8Function___init__
(__pyx_v_self=0x4a142f0, __pyx_args=<value optimized out>,
__pyx_kwds=<value optimized out>) at sage/symbolic/function.cpp:2374
#7 0xfffffd7fffde7a70 in ?? ()
#8 0x00000016745f5f63 in ?? ()
#9 0x0000000004a0e5a8 in ?? ()
#10 0x0000000004a142f0 in ?? ()
#11 0x000000000000000b in ?? ()
#12 0x0000000004a0e5a8 in ?? ()
#13 0x0000000002c913e8 in ?? ()
#14 0xfffffd7fd76c2b30 in module_members () from
/export/home/drkirkby/64/sage-4.7.alpha3/local/lib//libpython2.6.so.1.0
#15 0x0000002752657572 in ?? ()
#16 0xfffffd7fd76d5c60 in ?? () from
/export/home/drkirkby/64/sage-4.7.alpha3/local/lib//libpython2.6.so.1.0
#17 0x2800000040520000 in ?? ()
#18 0xfffffd7fd76d5920 in ?? () from
/export/home/drkirkby/64/sage-4.7.alpha3/local/lib//libpython2.6.so.1.0
#19 0x0000000000000005 in ?? ()
#20 0x00000000049e4db8 in ?? ()
---Type <return> to continue, or q <return> to quit---
#21 0x0000000000000000 in ?? ()
}}}
Burcin Erocal produced this Python call stack.
{{{
File "/export/home/burcin/sage-4.7.alpha3/local/bin/sage-ipython", line
21, in <module>
ipy_sage = IPython.Shell.start()
File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
packages/IPython/Shell.py", line 1233, in start
return shell(user_ns = user_ns)
File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
packages/IPython/Shell.py", line 78, in __init__
debug=debug,shell_class=shell_class)
File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
packages/IPython/ipmaker.py", line 644, in make_IPython
force_import(profmodname)
File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
packages/IPython/ipmaker.py", line 66, in force_import
__import__(modname)
File "ipy_profile_sage.py", line 7, in <module>
import sage.all_cmdline
File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
packages/sage/all_cmdline.py", line 14, in <module>
from sage.all import *
File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
packages/sage/all.py", line 75, in <module>
from sage.schemes.all import *
File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
packages/sage/schemes/all.py", line 25, in <module>
from hyperelliptic_curves.all import *
File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
packages/sage/schemes/hyperelliptic_curves/all.py", line 1, in <module>
from constructor import HyperellipticCurve
File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
packages/sage/schemes/hyperelliptic_curves/constructor.py", line 11, in
<module>
from sage.schemes.generic.all import ProjectiveSpace
File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
packages/sage/schemes/generic/all.py", line 4, in <module>
from affine_space import AffineSpace, is_AffineSpace
File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
packages/sage/schemes/generic/affine_space.py", line 24, in <module>
import algebraic_scheme
File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
packages/sage/schemes/generic/algebraic_scheme.py", line 143, in <module>
import toric_variety
File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
packages/sage/schemes/generic/toric_variety.py", line 236, in <module>
from sage.geometry.cone import Cone, is_Cone
File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
packages/sage/geometry/cone.py", line 174, in <module>
from sage.combinat.posets.posets import FinitePoset
File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
packages/sage/combinat/posets/posets.py", line 24, in <module>
from sage.graphs.all import DiGraph
File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
packages/sage/graphs/all.py", line 16, in <module>
from graph_editor import graph_editor
File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
packages/sage/graphs/graph_editor.py", line 22, in <module>
from sagenb.misc.support import EMBEDDED_MODE
File
"/export/home/burcin/sage-4.7.alpha3/devel/sagenb/sagenb/misc/support.py",
line 563, in <module>
from sage.symbolic.all import Expression, SR
File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
packages/sage/symbolic/all.py", line 9, in <module>
from sage.symbolic.relation import solve, solve_mod, solve_ineq
File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
packages/sage/symbolic/relation.py", line 314, in <module>
from sage.calculus.calculus import maxima
File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
packages/sage/calculus/calculus.py", line 374, in <module>
from sage.symbolic.integration.integral import indefinite_integral, \
File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
packages/sage/symbolic/integration/integral.py", line 129, in <module>
indefinite_integral = IndefiniteIntegral()
File "/export/home/burcin/sage-4.7.alpha3/local/lib/python2.6/site-
packages/sage/symbolic/integration/integral.py", line 62, in __init__
BuiltinFunction.__init__(self, "integrate", nargs=2)
}}}
Burcin writes on sage-devel
''
It seems that cones.py looks for posets.py, which needs the graphs
module, which initializes the graph_editor. The graph editor tries to
see if it's in the notebook or the command line, but sagenb imports SR
and Expression from sage.symbolic.all (line 563 of
sagenb/misc/support.py). This tries to initialize the functions
(integrate in this case) before pynac is initialized...''
''We need a better solution for making sure modules are initialized
properly before anything is imported from them. I thought putting an
__init__.py file in sage/symbolic/ with "import pynac" would solve the
problem. However, it seems that python just ignores that file.
''
This is one of the very few issues preventing a complete 64-bit build on
Solaris/!OpenSolaris, so it would be nice to crack this one.
--
Comment(by drkirkby):
Replying to [comment:5 fbissey]:
> Well Martin who reported the backtrace on github (but it wasn't the
first report of it) tracked it down to what he thinks is a bug in glibc
> [http://sources.redhat.com/bugzilla/show_bug.cgi?id=12453]
I'm suspicious of the fact this may be a bug in glibc, as I'm 99% sure GCC
will use the Sun C library and not the GNU one. I think Burcin's diagnosis
of the problem is more likely to be correct. I posted a comment to that
effect on the Gentoo site.
There's a test program on the Redhat glibc site, but I can't get that to
run. Probably a bashism that needs a newer version of bash than I have.
Dave
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11116#comment:7>
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.