On Mon, Jul 19, 2010 at 9:10 AM, David Kirkby <david.kir...@onetel.net> wrote:
> Yes - see below.
>
> sage: quit
> Exiting Sage (CPU time 0m0.29s, Wall time 0m3.52s).
>
> Program received signal SIGSEGV, Segmentation fault.
> 0xffffffff7e6627ec in _free_unlocked () from /lib/64/libc.so.1
> (gdb) bt
> #0  0xffffffff7e6627ec in _free_unlocked () from /lib/64/libc.so.1
> #1  0xffffffff7e662784 in free () from /lib/64/libc.so.1
> #2  0xffffffff78c13154 in ?? ()
> #3  0xffffffff78c13154 in ?? ()
> Backtrace stopped: previous frame identical to this frame (corrupt stack?)
> (gdb)
>
> I don't know how to approach this.

Well, under Linux I would try valgrind next; but evidently valgrind
doesn't work under Solaris.

I'm guessing the problem is some sort of malloc heap corruption.  If
so, here are some tips on debugging that.

Is there a way under Solaris to turn on some sort of memory debugging
in libc?  (For example, glibc does some extra heap corruption checks
if the MALLOC_CHECK environment variable is set.)

Otherwise, here's a list of malloc debug libraries.  Probably some of
them work on Solaris.
http://www.fortran-2000.com/ArnaudRecipes/FreeMemoryDB.html

If that fails, here's a technique I've used for pinpointing crash
locations.  It works if the crash is sufficiently reproducible
(happens the same way on every run).  Run "sage -gdb".  Once you get
the prompt, break into the debugger.  Set breakpoints on a few
frequently-called functions (they don't have to have anything to do
with your problem, "frequently-called" is the real requirement).  Type
"continue 10000".  Now you're back at the Sage prompt; exit Sage.

If you hit a breakpoint, type "continue 10000" again.  Repeat until the crash.

Now you know that the crash happens, say, between 20,000 and 30,000
breakpoints after you exit Sage.  Now you can restart Sage, set the
same breakpoints, and do binary search to find, eventually, that the
crash happens between breakpoint 23,456 and 23,457.  Now restart once
again, do "continue 23456", and then start stepping through the code
line-by-line -- you will be fairly close to the crash, so hopefully
this won't take too long.

Carl

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to