Re: Porting to FreeBSD/PPC64LE

Douglas Katzman via Sbcl-help <[email protected]>
Newsgroups gmane.lisp.steel-bank.general
Message-ID <CAOrNasxtBqmXffV_GkrRq8SRPNeZjXP-_fsLF9+RCOeDMf-Nyw@mail.gmail.com>
nice work getting that far! You could try gdb to find the function it's
in.  However, as shown below, you're going to get a SIGTAP right away,
because SBCL uses the ppc 'trapw' instruction for a lot of things which
unfortunately conflict with gdb.  There is (supposedly) a way to build
without using 'trapw' but I just tried it and it didn't work; maybe it
bit-rotted.
So let's not use that option. Now if you encounter sigfpe sooner than the
first sigtrap, you'll find out where that occurred.  If you get it after
the sigtrap, things are going to be more difficult.

gdb --args src/runtime/sbcl --core output/cold-sbcl.core

(gdb) *run*

COLD-INIT...

Program received signal SIGTRAP, Trace/breakpoint trap.


I tried telling gdb to passthru the sigtraps, and that failed. gdb is
acting as if the user program never installed a sigtrap handler, which I
think it must have. Not sure what's going on there.

(gdb) *handle SIGTRAP pass nostop print*

SIGTRAP is used by the debugger.

Are you sure you want to change it? (y or n)*y*

(gdb) *run*

Starting program: /home/snuglas/devel/sbcl/src/runtime/sbcl --core
output/cold-sbcl.core

[Thread debugging using libthread_db enabled]

Using host libthread_db library "/lib64/libthread_db.so.1".


Program terminated with signal SIGTRAP, Trace/breakpoint trap.

The program no longer exists.


Based on your output, you got a kernel coredump. You could start that up.
In this case 'core' is the name of the OS-format core file, so it doesn't
take a "--core" arg which is an SBCL arg.

gdb src/runtime/sbcl core

(gdb) where



If the function is C (which seems unlikely), gdb will have the name of it.
If the function is Lisp, you have to open up 'output/cold-sbcl.map' in an
editor and search for the text


II.B. defined functions (numerically):


that demarcates the function map. Scan that list visually and look for two
addresses that span the program count where gdb says the process died.

There are some other techniques we can get into as well.


One other thing to try:

wherever the code is doing ll_install_handler to install our so-called
"low-level handlers", add ll_install_handler(SIGFPE, ldb_monitor);

This will _maybe_ get it to go into SBCL's monitor at the first sigfpe.
Normally we don't install it as a low-level handler, we install it as Lisp
handler, because Lisp wants to know about the various FPEs, and we should
never see an FPE in cold-init.  But if you make a low-level handler, you
should get a chance to get into the monitor before dying



Do you have some diffs I can see?

_______________________________________________
Sbcl-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sbcl-help
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.