Bug#36030: libc6: Segmentation fault in setvbuf() when called thru libguile4
Package: libc6
Version: 2.1.1-0.2
Sample program to demonstrate bug (code from guile-ref info file):
--------------------
/* simple-guile.c --- how to start up the Guile
interpreter from C code. */
/* Get declarations for all the scm_ functions. */
#include <libguile.h>
static void
inner_main (void *closure, int argc, char **argv)
{
/* module initializations would go here */
scm_shell (argc, argv);
}
int
main (int argc, char **argv)
{
scm_boot_guile (argc, argv, inner_main, 0);
return 0; /* never reached */
}
--------------------
Compile with:
$ gcc simple-guile.c -lguile -lqthreads
--------------------
Debug backtrace (this time compiled with static libraries)
arno@maxi$ gdb a.out
GNU gdb 4.17
Copyright 1998 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 conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i586-pc-linux-gnu"...
(gdb) r
Starting program: /home/arno/share/hacks/scheme/a.out
Program received signal SIGSEGV, Segmentation fault.
0x4006bb91 in setvbuf ()
(gdb) where
#0 0x4006bb91 in setvbuf ()
#1 0x808c638 in scm_setbuf0 (port=1074864240) at fports.c:150
#2 0x808cc60 in scm_stdio_to_port (file=0x80b3e28, mode=0x80a74c4 "r0",
name=1074864232) at fports.c:343
#3 0x808cccc in scm_standard_stream_to_port (file=0x80b3e28,
mode=0x80a74c4 "r0", name=0x80a74b5 "standard input") at fports.c:358
#4 0x804bd77 in scm_init_standard_ports () at init.c:267
#5 0x804c06c in scm_boot_guile_1 (base=0xbffffa8c, closure=0xbffffa90)
at init.c:496
#6 0x804be8c in scm_boot_guile (argc=1, argv=0xbffffb04,
main_func=0x804bb40 <inner_main>, closure=0x0) at init.c:378
#7 0x804bb77 in main ()
#8 0x40030ccf in __libc_start_main ()
(gdb)
-- System Information
Debian Release: potato
Kernel Version: Linux maxi 2.2.5 #3 Tue Mar 30 00:44:13 CEST 1999 i586 unknown
Versions of the packages libc6 depends on:
ii ldso 1.9.10-1.2 The Linux dynamic linker, library and utilit
Versions of the packages also mentioned in this bugreport:
ii libguile4 1.3-12 `libguile.so.4' shared libraries for Guile1.
ii libguile4-dev 1.3-12 Development headers and static library for l
ii gcc 2.91.66-1 The GNU (egcs) C compiler.
Reply to: