Hi!<br><br>We're having limited problems with our Gambit software throwing sigsegvs / bus errors, on x86 debian and on mac os x.<br><br>The instances we see that we have had sigsegvs / bus errors in are:<br> - when using #!unbound or #!void values in code compiled with (declare (not safe))<br>

 - when not catching exceptions (like in the example below)<br> - 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.<br>

<br>What are the best strategies to ensure that non-FFI code can never cause sigsegv:s / bus errors?<br><br>( I suppose for starters, it is not to override the default (declare (safe)) declaration. What more? )<br><br>Thanks<br>

Mikael<br><br> -<br><br>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.<br>
<br>debian:~/main$ gdb gsc<br>GNU gdb 6.4.90-debian<br>Copyright (C) 2006 Free Software Foundation, Inc.<br>GDB is free software, covered by the GNU General Public License, and you are<br>welcome to change it and/or distribute copies of it under certain conditions.<br>

Type "show copying" to see the conditions.<br>There is absolutely no warranty for GDB.  Type "show warranty" for details.<br>This GDB was configured as "i486-linux-gnu"...Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".<br>

<br>(gdb) run<br>Starting program: /usr/bin/gsc<br>Failed to read a valid object file image from memory.<br>Gambit v4.2.8<br><br>> (load "~~/lib/termite/termite")<br>"/usr/local/Gambit-C/v4.2.8/lib/termite/termite.o1"<br>

> (termite#node-init (termite#make-node "<a href="http://127.0.0.1" target="_blank"><font color="red"><b>MailScanner warning: numerical links are often malicious:</b></font> 127.0.0.1</a>" 3000))<br>ok<br>>  (termite#spawn (lambda () (raise "hi")))<br>#<thread #2><br>><br>Program received signal SIGSEGV, Segmentation fault.<br>

0x08220202 in ___H__20___kernel ()<br>(gdb) bt<br>#0  0x08220202 in ___H__20___kernel ()<br>#1  0x00000000 in ?? ()<br><br>