[gambit-list] Gambit crash with over 1024 file descriptors

Dimitris Vyzovitis vyzo at hackzen.org
Mon Mar 25 01:45:41 EDT 2013


I have a program uses large numbers of file descriptors (over 1024),
and it crashes miserably in __fortify_fail. Turning off
FORTIFY_SOURCE/stack-protector results in a plain old segfault.

Reproducing with the attached program (crash-it.scm):
Platform is GNU/Linux x86-64, gcc is 4.6.3.
You need to set your ulimit over 1024 to trigger the crash (otherwise
you'll just get "Too many open files" and rain of "integer expected"
from the looping threads)

$ ulimit -n
4096
$ gsi crash-it.scm -e "(go 1500)"
*** buffer overflow detected ***: gsi terminated
======= Backtrace: =========
/lib64/libc.so.6(__fortify_fail+0x37)[0x7fb775187dd7]
/lib64/libc.so.6(+0xfdbe0)[0x7fb775185be0]
/lib64/libc.so.6(+0xffd8e)[0x7fb775187d8e]
/usr/local/gambit/current/lib/libgambc.so(___device_select_add_fd+0x55)[0x7fb775d625c5]
/usr/local/gambit/current/lib/libgambc.so(+0x227a91)[0x7fb775d62a91]
/usr/local/gambit/current/lib/libgambc.so(___device_select+0x104)[0x7fb775d62324]
/usr/local/gambit/current/lib/libgambc.so(___os_condvar_select+0x141)[0x7fb775d64d61]
/usr/local/gambit/current/lib/libgambc.so(+0x2310a1)[0x7fb775d6c0a1]
/usr/local/gambit/current/lib/libgambc.so(___call+0xfa)[0x7fb775d4d2ba]
/usr/local/gambit/current/lib/libgambc.so(___setup+0xfc0)[0x7fb775d4f760]
/usr/local/gambit/current/lib/libgambc.so(___main+0x2a7)[0x7fb775d4bf57]
/usr/local/gambit/current/lib/libgambc.so(___main_char+0xb0)[0x7fb775d59200]
/lib64/libc.so.6(__libc_start_main+0xed)[0x7fb7750ac60d]
gsi[0x403199]

Build config:
./configure
 --prefix=/usr/local/gambit
 --enable-single-host
 --enable-c-opt
 --enable-gcc-opts
 --enable-multiple-versions
 --enable-shared

To build without fortifications:
 ./configure CFLAGS="-U_FORTIFY_SOURCE -fno-stack-protector" ...
And you'll get a segfault.

-- vyzo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crash-it.scm
Type: application/octet-stream
Size: 606 bytes
Desc: not available
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20130324/526b6ec0/attachment.obj>


More information about the Gambit-list mailing list