Hi guile people,
I'm experiencing cores in guile-dbi.
This is on Solaris-10u10 on SPARC, with guile and guile-dbi compiled
with -O2.
When compiled with -O0, the problem disappears. I've also been unable to
replicate the problem on Linux x86_64. This suggests to me that the
underlying cause could be timing-related (my guile app does use threads).
This is what gdb shows:
Program terminated with signal 10, Bus error.
#0 0xffffffff75601c8c in mark_db_handle (g_db_handle_smob=0x10115efc0)
at guile-dbi.c:114
114 scm_gc_mark(g_db_handle->bcknd);
(gdb) p g_db_handle
$1 = (gdbi_db_handle_t *) 0x304
That 0x304 is SCM_EOL. The only part of guile-dbi.c which looks like it
could be
causing this is free_db_handle, which does this:
SCM_SETCDR (g_db_handle_smob, SCM_EOL);
If this is the cause, then why is mark_db_handle being called after the
object
has already been free'd?
I can prevent the cores by adding this to the start of mark_db_handle:
if (g_db_handle == (gdbi_db_handle_t*) SCM_EOL) return SCM_UNSPECIFIED;
However, I'm concerned that this isn't the right fix; what if something
really does need
to be marked, and isn't? -- it'll be GC'd when it shouldn't, right?
--
Andrew