On Jan 8, 1:40 pm, Jaap Spies <[EMAIL PROTECTED]> wrote:
> mabshoff wrote:
>
> > On Jan 8, 12:26 am, Jaap Spies <[EMAIL PROTECTED]> wrote:
> >> Fernando Perez wrote:
> >>> On Jan 7, 2008 2:09 PM, Jaap Spies <[EMAIL PROTECTED]> wrote:
> >>>> sage: /home/jaap/downloads/sage-2.9.2/local/bin/sage-sage: line 210:  
> >>>> 4746 Segmentation fault      sage-ipython -c "$SAGE_STARTUP_COMMAND;" 
> >>>> "$@"
> >>>> [EMAIL PROTECTED] sage-2.9.2]$
> >>>> Any idea?
> >>> Not without a gdb backtrace, no... Can you provide one please?
> >> To be honnest I've no clue how to do that.
>
> >> I used to do:
>
> >> gdb prog core
>
> >> but how do I proceed here?
>
> > Run ./sage -gdb - do what you did above. Then on an error you should
> > be dropped into gdb. Punch in bt, hit return a couple times until the
> > whole backtrace is there and then post the result.
>
> Thanks, now I remember :)

I always thought you had forgotten more about computers than most of
us know ;)

> sage: import IPython
>
> sage: IPython.Shell.IPShellWX().mainloop()
> [New Thread -1225729136 (LWP 17468)]
> [Detaching after fork from child process 17469.]
>
> ----------------------------------------------------------------------
> | SAGE Version 2.9.2, Release Date: 2008-01-05                       |
> | Type notebook() for the GUI, and license() for information.        |
> ----------------------------------------------------------------------
>
> sage:
> Exiting SAGE (CPU time 0m0.55s, Wall time 3m35.50s).
> [Thread -1225729136 (LWP 17468) exited]
> Closing threads... Done.
>
> sage:
> Exiting SAGE (CPU time 0m0.56s, Wall time 3m38.45s).
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread -1209112896 (LWP 17458)]
> 0x0064a3ec in free () from /lib/libc.so.6
> (gdb) bt
> #0  0x0064a3ec in free () from /lib/libc.so.6
> #1  0x061db266 in destroyAllCodes () from 
> /home/jaap/downloads/sage-2.9.2/local/lib/libm4ri.so.0
> #2  0x05efb187 in __pyx_pf_4sage_6matrix_17matrix_mod2_dense_free_m4ri 
> (__pyx_self=0x0, unused=0x0) at sage/matrix/matrix_mod2_dense.c:1634

Ok, the culprit points to a cleanup function of m4ri, which under
normal conditions is called only once. I am not seeing the above issue
under valgrdind with "pure" Sage 2.10.alpha0, but as I just learned
yesterday problematic free() calls might be hidden by other bugs.
Imagine my surprise that once I fixed #1092 or #1093 some invalid free
popped up. We currently have a problem in tp_new (see #1337) which is
the only culprit on our end that could hide that. But the question
remains if IPython does something funny with threads and somehow
triggers more than one cleanup call. We could add some check for NULL
inside destroyAllCodes(). So, anybody with a better knowledge of
IPython: It seems that threads are involved, so could this somehow be
triggered?

> #3  0x080c51e0 in PyEval_EvalFrameEx (f=0xaea9fbc, throwflag=0) at 
> Python/ceval.c:3548
> #4  0x080c65d5 in PyEval_EvalCodeEx (co=0xb7e6c9f8, globals=0xb7e833e4, 
> locals=0x0, args=0xaea9d84, argcount=0, kws=0xaea9d84, kwcount=0,
>      defs=0xa74b3b8, defcount=1, closure=0x0) at Python/ceval.c:2831
> #5  0x080c4a89 in PyEval_EvalFrameEx (f=0xaea9c3c, throwflag=0) at 
> Python/ceval.c:3660
> #6  0x080c65d5 in PyEval_EvalCodeEx (co=0xb7e6cc80, globals=0xb7e833e4, 
> locals=0x0, args=0xa7ab3b4, argcount=1, kws=0xa7ab3b8, kwcount=0,
>      defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2831
> #7  0x080c4a89 in PyEval_EvalFrameEx (f=0xa7ab264, throwflag=0) at 
> Python/ceval.c:3660
> #8  0x080c65d5 in PyEval_EvalCodeEx (co=0xb7af84a0, globals=0xb7aecdfc, 
> locals=0x0, args=0xa7abb14, argcount=2, kws=0xa7abb1c, kwcount=0,
>      defs=0xb7a457d8, defcount=1, closure=0x0) at Python/ceval.c:2831
> #9  0x080c4a89 in PyEval_EvalFrameEx (f=0xa7ab9d4, throwflag=0) at 
> Python/ceval.c:3660
> #10 0x080c65d5 in PyEval_EvalCodeEx (co=0xb7af83c8, globals=0xb7aecdfc, 
> locals=0x0, args=0x8f46b50, argcount=2, kws=0x8f46b58, kwcount=0,
>      defs=0xb7a457b8, defcount=1, closure=0x0) at Python/ceval.c:2831
> #11 0x080c4a89 in PyEval_EvalFrameEx (f=0x8f46a0c, throwflag=0) at 
> Python/ceval.c:3660
> #12 0x080c65d5 in PyEval_EvalCodeEx (co=0xb7ac80f8, globals=0xb7ac2bdc, 
> locals=0x0, args=0x8e6548c, argcount=1, kws=0x8e65490, kwcount=2,
>      defs=0xb7aced98, defcount=2, closure=0x0) at Python/ceval.c:2831
> #13 0x080c4a89 in PyEval_EvalFrameEx (f=0x8e65354, throwflag=0) at 
> Python/ceval.c:3660
> #14 0x080c65d5 in PyEval_EvalCodeEx (co=0xb7e6c608, globals=0xb7ebeacc, 
> locals=0xb7ebeacc, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0,
>      defcount=0, closure=0x0) at Python/ceval.c:2831
> #15 0x080c6647 in PyEval_EvalCode (co=0xb7e6c608, globals=0xb7ebeacc, 
> locals=0xb7ebeacc) at Python/ceval.c:494
> #16 0x080e52d8 in PyRun_FileExFlags (fp=0x8e8e488, filename=0xbff8cb6f 
> "/home/jaap/downloads/sage-2.9.2/local/bin/sage-gdb-pythonstartup",
> ---Type <return> to continue, or q <return> to quit---
>      start=257, globals=0xb7ebeacc, locals=0xb7ebeacc, closeit=0, 
> flags=0xbff8bdb8) at Python/pythonrun.c:1271
> #17 0x080e5567 in PyRun_SimpleFileExFlags (fp=0x8e8e488,
>      filename=0xbff8cb6f 
> "/home/jaap/downloads/sage-2.9.2/local/bin/sage-gdb-pythonstartup", 
> closeit=0, flags=0xbff8bdb8)
>      at Python/pythonrun.c:877
> #18 0x080571a6 in Py_Main (argc=0, argv=0xbff8be84) at Modules/main.c:134
> #19 0x08056432 in main (argc=99635103, argv=0x5efb170) at 
> ./Modules/python.c:23
> (gdb)
>
> Hope this helps,

:)

> Jaap

Cheers,

Michael
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to