[gambit-list] What is the best strategy to ensure that non-FFI code can never cause sigsegv:s / bus errors?
mikael.more at gmail.com
Wed Jul 9 10:15:47 EDT 2008
We're having limited problems with our Gambit software throwing sigsegvs /
bus errors, on x86 debian and on mac os x.
The instances we see that we have had sigsegvs / bus errors in are:
- when using #!unbound or #!void values in code compiled with (declare (not
- when not catching exceptions (like in the example below)
- immediately following C calls from Scheme, where the C code makes
callbacks back into Scheme, though these errors may be due to us using
broken FFI code.
What are the best strategies to ensure that non-FFI code can never cause
sigsegv:s / bus errors?
( I suppose for starters, it is not to override the default (declare (safe))
declaration. What more? )
The following example produces sigsegv undepending on if compiled with gcc
or g++. Executing (termite#spawn (lambda () (raise "hi"))) works as
expected, it does not throw any sigsegv.
debian:~/main$ gdb gsc
GNU gdb 6.4.90-debian
Copyright (C) 2006 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
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...Using host libthread_db
Starting program: /usr/bin/gsc
Failed to read a valid object file image from memory.
> (load "~~/lib/termite/termite")
> (termite#node-init (termite#make-node "127.0.0.1" 3000))
> (termite#spawn (lambda () (raise "hi")))
Program received signal SIGSEGV, Segmentation fault.
0x08220202 in ___H__20___kernel ()
#0 0x08220202 in ___H__20___kernel ()
#1 0x00000000 in ?? ()
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Gambit-list