• Bug#265429: libruby1.8: IO.select() mysteriously hangs

    From Andres Salomon@1:229/2 to All on Fri Aug 13 10:20:12 2004
    From: [email protected]

    Package: libruby1.8
    Version: 1.8.1+1.8.2pre2-1
    Severity: normal

    The following script hangs inside ruby's rb_f_select() function, for
    some reason:

    #!/usr/bin/ruby -w

    require "net/https"
    h = Net::HTTP.new('www.ultrasecure.net', 443)
    h.set_debug_output($stderr)
    h.use_ssl = 1
    hdr = { 'Connection'=>'keep-alive' }
    resp = h.get('/test.php', hdr)
    p resp.body


    Disabling keep-alive, as well as using http instead of https, causes
    this not to trigger. Otherwise, what happens is that Net::Protocol
    buffers the page in 1024 chunks; initially, the headers as well as 900
    or so bytes of the page are grabbed and stored internally (in @rbuf,
    filled in by rbuf_fill()). Once the buffer is empty, the next chunk is grabbed; this, for some reason hangs in Net::Protocol's rbuf_fill
    IO.select() routine. There is no timeout exception triggered; instead,
    there's a 15-30 second wait, and then select returns (w/ the socket in
    the read descriptor array). This happens w/ any site, including
    localhost.

    As I mentioned, disabling keep-alive fixes this. The reason keep-alive
    is used is become XMLRPC::Client uses it; that's how I discovered this,
    queries that returned XMLRPC packets larger than 1000 bytes seemed to
    hang. I'm not sure whether the correct fix is to turn off keep-alive,
    or there's a bug in io.c's rb_f_select() function. Any tips on the
    proper fix for this would be appreciated.


    -- System Information:
    Debian Release: 3.1
    APT prefers unstable
    APT policy: (500, 'unstable'), (500, 'testing')
    Architecture: i386 (i686)
    Kernel: Linux 2.6.8-1-686
    Locale: LANG=C, LC_CTYPE=C

    Versions of packages libruby1.8 depends on:
    ii libc6 2.3.2.ds1-16 GNU C Library: Shared libraries an

    -- no debconf information


    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)