[Openmcl-devel] Segmentation fault on linuxppc

Gary Byers gb at clozure.com
Thu Aug 12 22:59:09 PDT 2004

On Wed, 11 Aug 2004, Jan Idzikowski wrote:

> hallo gary,
> here is the gdb ouput:
> GNU gdb 6.0
> Copyright 2003 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "powerpc-unknown-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".
> Breakpoint 1 at 0x11e08: file ../lisp-exceptions.c, line 2108.
> tgetent: warning: termcap entry too long
> (gdb) break start_lisp
> Breakpoint 2 at 0x8848: file ../subprims.s, line 75.
> (gdb) run
> Starting program: /home/ji/tmp/ccl/ppccl
> warning: Unable to find dynamic linker breakpoint function.

This warning seems a little suspicious, certainly; I think that the
function it's looking for is part of the threads debugging library.

> GDB will be unable to debug shared library initializers
> and track explicitly loaded dynamic code.
> Program terminated with signal SIGSEGV, Segmentation fault.
> The program no longer exists.
> --

OK, that tells us that it doesn't get out of the kernel initialization
code (part of which should establish a handler for SIGSEGV.)

That handler's established via a call to exception_init(), made from
main (after it hasn't done much of anything else.)  The fact that the
SIGSEGV terminates the application (instead of dropping into GDB or
the lisp kernel debugger) is a little confusing; one scenario that
-might- cause that would be recursive SIGSEGVs triggered from inside
the code that's supposed to handle SIGSEGV.

The only way I know of to debug this sort of thing is via binary search:
by setting breakpoints and seeing if they're reached.  If the breakpoint's
reached, we try setting one later; if not, we try setting one earlier,
and (eventually) we get things narrowed down a bit better.

If you could, please try repeating the experiment with breakpoints set
at main, exception_init, PMCL_exception_handler, initial_stack_bottom,
and start_lisp (e.g.,

(gdb) break main
(gdb) break exception_init
... etc)

We -should- reach all of these except for PMCL_exception_handler; we know
that we never make it as far as start_lisp.

If you're not familiar with GDB: you can continue from a breakpoint
by doint:

(gdb) continue

I'd be curious to know which breakpoints are actually reached before the
fatal SIGSEGV occurs.

More information about the Openmcl-devel mailing list