Here's an example program:
#include <stdio.h>
#include <libguile.h>
void
my_main (void *closure, int argc, char *argv [])
{
printf ("We initialized guile\n");
}
int
main (int argc, char *argv [])
{
scm_boot_guile (argc, argv, my_main, 0);
}
Build it, and run it with stdin closed:
% ./prog <&-1
Segmentation fault (core dumped)
(gdb) bt
#0 0x4007906e in scm_ithrow () from /usr/lib/libguile.so.6
#1 0x40034c74 in scm_error () from /usr/lib/libguile.so.6
#2 0x40034ebb in scm_syserror () from /usr/lib/libguile.so.6
#3 0x400454a9 in scm_init_fluids () from /usr/lib/libguile.so.6
#4 0x40045ae1 in scm_fdes_to_port () from /usr/lib/libguile.so.6
#5 0x4004cd71 in scm_init_hashtab () from /usr/lib/libguile.so.6
#6 0x4004cdcf in scm_init_hashtab () from /usr/lib/libguile.so.6
#7 0x4004d14e in scm_boot_guile () from /usr/lib/libguile.so.6
#8 0x4004cf54 in scm_boot_guile () from /usr/lib/libguile.so.6
#9 0x8048646 in main ()
Why I care:
Gnome object activation closes fd 0 as part of the daemonizing
procedure. Gnumeric embeds guile, and crashes if it's activated via
the Gnome Object Activation service.
We can work around this if we have to. But shouldn't guile be prepared
for this situation.
Otherwise, all embedding applications will have to make a workaround.
Jon