A libevent patch for Gambit was made couple of years ago, can dig it out for your reference and you could make a libev or libevent patch for current Gambit?<div><br></div><div><div>Possibly Gambit could use it if it's detected as installed?</div>


</div><div><br></div><div>(select() on Windows is a mess, duno if either of libev or libevent works around that better these days.)</div><div><br></div><div>>1024 is not an everyday usecase though I'm with you that it absolutely ought to be supported natively or via a patch.</div>


<div><br></div><div>Brgds<br><br><div class="gmail_quote">2013/3/25 Dimitris Vyzovitis <span dir="ltr"><<a href="mailto:vyzo@hackzen.org" target="_blank">vyzo@hackzen.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


I guess this shouldn't be too big a surprise given this definition:<br>
/usr/include/bits/typesizes.h:#define   __FD_SETSIZE            1024<br>
<br>
/usr/include/sys/select.h:<br>
 typedef struct<br>
  {<br>
#ifdef __USE_XOPEN<br>
    __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS];<br>
# define __FDS_BITS(set) ((set)->fds_bits)<br>
#else<br>
    __fd_mask __fds_bits[__FD_SETSIZE / __NFDBITS];<br>
# define __FDS_BITS(set) ((set)->__fds_bits)<br>
#endif<br>
  } fd_set;<br>
<br>
#define __NFDBITS       (8 * (int) sizeof (__fd_mask))<br>
<br>
So great. Gambit can't do more than 1024 file descriptors, unless the<br>
scheduler is fixed to use poll instead of select.<br>
<br>
-- vyzo<br>
<div><div><br>
On Sun, Mar 24, 2013 at 10:45 PM, Dimitris Vyzovitis <<a href="mailto:vyzo@hackzen.org" target="_blank">vyzo@hackzen.org</a>> wrote:<br>
> I have a program uses large numbers of file descriptors (over 1024),<br>
> and it crashes miserably in __fortify_fail. Turning off<br>
> FORTIFY_SOURCE/stack-protector results in a plain old segfault.<br>
><br>
> Reproducing with the attached program (crash-it.scm):<br>
> Platform is GNU/Linux x86-64, gcc is 4.6.3.<br>
> You need to set your ulimit over 1024 to trigger the crash (otherwise<br>
> you'll just get "Too many open files" and rain of "integer expected"<br>
> from the looping threads)<br>
><br>
> $ ulimit -n<br>
> 4096<br>
> $ gsi crash-it.scm -e "(go 1500)"<br>
> *** buffer overflow detected ***: gsi terminated<br>
> ======= Backtrace: =========<br>
> /lib64/libc.so.6(__fortify_fail+0x37)[0x7fb775187dd7]<br>
> /lib64/libc.so.6(+0xfdbe0)[0x7fb775185be0]<br>
> /lib64/libc.so.6(+0xffd8e)[0x7fb775187d8e]<br>
> /usr/local/gambit/current/lib/libgambc.so(___device_select_add_fd+0x55)[0x7fb775d625c5]<br>
> /usr/local/gambit/current/lib/libgambc.so(+0x227a91)[0x7fb775d62a91]<br>
> /usr/local/gambit/current/lib/libgambc.so(___device_select+0x104)[0x7fb775d62324]<br>
> /usr/local/gambit/current/lib/libgambc.so(___os_condvar_select+0x141)[0x7fb775d64d61]<br>
> /usr/local/gambit/current/lib/libgambc.so(+0x2310a1)[0x7fb775d6c0a1]<br>
> /usr/local/gambit/current/lib/libgambc.so(___call+0xfa)[0x7fb775d4d2ba]<br>
> /usr/local/gambit/current/lib/libgambc.so(___setup+0xfc0)[0x7fb775d4f760]<br>
> /usr/local/gambit/current/lib/libgambc.so(___main+0x2a7)[0x7fb775d4bf57]<br>
> /usr/local/gambit/current/lib/libgambc.so(___main_char+0xb0)[0x7fb775d59200]<br>
> /lib64/libc.so.6(__libc_start_main+0xed)[0x7fb7750ac60d]<br>
> gsi[0x403199]<br>
><br>
> Build config:<br>
> ./configure<br>
>  --prefix=/usr/local/gambit<br>
>  --enable-single-host<br>
>  --enable-c-opt<br>
>  --enable-gcc-opts<br>
>  --enable-multiple-versions<br>
>  --enable-shared<br>
><br>
> To build without fortifications:<br>
>  ./configure CFLAGS="-U_FORTIFY_SOURCE -fno-stack-protector" ...<br>
> And you'll get a segfault.<br>
><br>
> -- vyzo<br>
</div></div>_______________________________________________<br>
Gambit-list mailing list<br>
<a href="mailto:Gambit-list@iro.umontreal.ca" target="_blank">Gambit-list@iro.umontreal.ca</a><br>
<a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" target="_blank">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><br>
</blockquote></div><br></div>