#12158: Segfault in err_init
----------------------+-----------------------------------------------------
   Reporter:  vbraun  |          Owner:  GeorgSWeber
       Type:  defect  |         Status:  new        
   Priority:  major   |      Milestone:  sage-4.8   
  Component:  build   |       Keywords:             
Work_issues:          |       Upstream:  N/A        
   Reviewer:          |         Author:             
     Merged:          |   Dependencies:             
----------------------+-----------------------------------------------------
 This segfault is on Ubuntu oneiric 11.10 32-bit with user authentication
 over LDAP:
 {{{
 vbraun@tesla:~/tesla/sage-4.8.alpha4$ ./sage -gdb
 ----------------------------------------------------------------------
 | Sage Version 4.8.alpha4, Release Date: 2011-12-13                  |
 | Type notebook() for the GUI, and license() for information.        |
 ----------------------------------------------------------------------
 **********************************************************************
 *                                                                    *
 * Warning: this is a prerelease version, and it may be unstable.     *
 *                                                                    *
 **********************************************************************
 /home/vbraun/tesla/sage-4.8.alpha4/local/bin/sage-ipython
 GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08
 Copyright (C) 2011 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 "i686-linux-gnu".
 For bug reporting instructions, please see:
 <http://bugs.launchpad.net/gdb-linaro/>...
 Reading symbols from
 /home/vbraun/tesla/sage-4.8.alpha4/local/bin/python...done.
 [Thread debugging using libthread_db enabled]
 Python 2.6.4 (r264:75706, Dec 13 2011, 18:01:47)
 [GCC 4.6.1] on linux3
 Type "help", "copyright", "credits" or "license" for more information.

 Program received signal SIGSEGV, Segmentation fault.
 0xb73339c2 in err_init () at ../src/language/init.c:910
 910     ../src/language/init.c: No such file or directory.
         in ../src/language/init.c
 (gdb) bt
 #0  0xb73339c2 in err_init () at ../src/language/init.c:910
 #1  pari_warn (numerr=0) at ../src/language/init.c:934
 #2  0xb7323daf in pari_get_homedir (user=0xb73e0db4 "") at
 ../src/language/es.c:3413
 #3  pari_get_homedir (user=0xb73e0db4 "") at ../src/language/es.c:3389
 #4  0xb7323efe in _path_expand (s=0x81a5353 "") at
 ../src/language/es.c:3499
 #5  path_expand (s=0x81a5352 "~") at ../src/language/es.c:3579
 #6  0xb7324868 in gp_expand_path (p=0xb745d05c) at
 ../src/language/es.c:3642
 #7  0xb7335678 in pari_init_opts (parisize=10000, maxprime=500000,
 init_opts=5)
     at ../src/language/init.c:734
 #8  0xb65443d9 in __pyx_pf_4sage_4libs_4pari_3gen_12PariInstance___init__
 (__pyx_v_self=0x867e72c,
     __pyx_args=0x868922c, __pyx_kwds=0x0) at sage/libs/pari/gen.c:41808
 #9  0xb7ed13aa in type_call (type=<optimized out>, args=0x868922c,
 kwds=0x0) at Objects/typeobject.c:747
 #10 0xb7e78414 in PyObject_Call (func=0xb65a03c0, arg=0x868922c, kw=0x0)
 at Objects/abstract.c:2492
 #11 0xb6552514 in initgen () at sage/libs/pari/gen.c:51753
 #12 0xb7f2e50c in _PyImport_LoadDynamicModule (name=0xbffe2a38
 "sage.libs.pari.gen",
     pathname=0xbffe19ab
 "/home/vbraun/tesla/sage-4.8.alpha4/local/lib/python2.6/site-
 packages/sage/libs/pari/gen.so", fp=0x8655798) at ./Python/importdl.c:53
 #13 0xb7f2bf50 in load_module (name=0xbffe2a38 "sage.libs.pari.gen",
 fp=<optimized out>,
     buf=0xbffe19ab "/home/vbraun/tesla/sage-4.8.alpha4/local/lib/python2.6
 /site-packages/sage/libs/pari/gen.so", type=3, loader=0x0) at
 Python/import.c:1828
 #14 0xb7f2c629 in import_submodule (mod=0x860d674, subname=0xbffe2a47
 "gen",
     fullname=0xbffe2a38 "sage.libs.pari.gen") at Python/import.c:2589
 #15 0xb7f2c8a9 in load_next (mod=0x860d674, altmod=0xb7fb64ac,
 p_name=0xbffe2a2c,
     buf=0xbffe2a38 "sage.libs.pari.gen", p_buflen=0xbffe2a34) at
 Python/import.c:2409
 #16 0xb7f2ce96 in import_module_level (name=0x0, globals=<optimized out>,
 fromlist=0xb7fb64ac, level=-1,
     locals=<optimized out>) at Python/import.c:2131
 #17 0xb7f2d457 in PyImport_ImportModuleLevel (name=0x8502754 "gen",
 globals=0x8682dfc, locals=0x8682dfc,
     fromlist=0xb7fb64ac, level=-1) at Python/import.c:2182
 }}}


 Really, there are two bugs at the same time:
   1. Sage's gnutls library conflicts with the system gnutls library, which
 breaks LDAP. Now as soon as `LD_LIBRARY_PATH` includes the new gnutls,
 user account information can no longer be retrieved. For example:
 {{{
 vbraun@tesla:~$ whoami
 vbraun
 }}}
      but
 {{{
 vbraun@tesla:~$ sage -sh

 Starting subshell with Sage environment variables set.
 Be sure to exit when you are done and do not do anything
 with other copies of Sage!

 Bypassing shell configuration files ...

 SAGE_ROOT=/home/vbraun/tesla/sage-4.8.alpha4
 (sage subshell) tesla:~ I have no name!$ whoami
 whoami: cannot find name for user ID 12050
 }}}
   2. Now that Pari is unable to find the home directory, it tries to print
 a warning. This succeeds if I just run the stand-alone pari with `sage
 -gp`:
 {{{
 vbraun@tesla:~$ sage -gp
   ***   Warning: can't expand ~.
   ***   Warning: can't expand ~.
                          GP/PARI CALCULATOR Version 2.5.0 (development
 svn-13228)
                         i686 running linux (ix86/GMP-5.0.1 kernel) 32-bit
 version
                      compiled: Dec 13 2011, gcc-4.6.1 (Ubuntu/Linaro
 4.6.1-9ubuntu3)
                               (readline v6.2 enabled, extended help
 enabled)
 }}}
      but Sage does not handle the pari error correctly and segfaults
 unnecessarily.

 A workaround is to delete Sage's gnutls libraries, that is
 {{{
 rm sage-4.8.alpha4/local/lib/libgnutls*
 }}}
 after Sage has finished compiling.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12158>
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