Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 260760 - Ruby can't use UDP sockets on uClibc systems
Summary: Ruby can't use UDP sockets on uClibc systems
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo Ruby Team
URL: http://rubyforge.org/tracker/index.ph...
Whiteboard:
Keywords:
Depends on: 252257
Blocks:
  Show dependency tree
 
Reported: 2009-03-01 18:05 UTC by Tom Lloyd
Modified: 2011-07-18 12:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Lloyd 2009-03-01 18:05:09 UTC
From Rubyforge bugtracker:
> ruby doesn't work properly under uClibc without a patch. This is because
> uClibc uses __bufpos and __bufread (rather than bufpos and bufread), which
> configure.in isn't currently detecting. The most immediate symptom is that an
> exception is raised if you try to read from a UDP socket:
> 
> root@OpenWrt:~# irb
> irb(main):001:0> require 'socket'
> => true
> irb(main):002:0> s = UDPSocket.new
> => #<UDPSocket:0x444000>
> irb(main):003:0> s.bind("0.0.0.0",1234)
> => 0
> irb(main):004:0> d = s.recvfrom(512)
> IOError: recv for buffered IO
>         from (irb):4:in `recvfrom'
>         from (irb):4
> irb(main):005:0>


This bug is apparently fixed in the latest Ruby, but the fix hasn't filtered down to Portage yet.  I can confirm the bug, and I can confirm that the patch supplied at the URL provided works for dev-lang/ruby-1.8.6_p287-r5.  I haven't tested other versions.

Can we incorporate that patch into the ebuilds for non-fixed packages, please?
Comment 1 Alex Legler (RETIRED) archtester gentoo-dev Security 2009-03-02 11:39:50 UTC
From a quick glance everything >= 1.8.7 has this fix applied.

We might add this in one of the next 1.8.6 revbumps.
Comment 2 Hans de Graaff gentoo-dev Security 2009-03-07 08:29:47 UTC
It might be a better idea to fix this by unmasking ruby 1.8.7, even though that may cause additional bugs due to incompatibilities between 1.8.6 and 1.8.7.
Comment 3 Tom Lloyd 2009-03-07 12:56:27 UTC
I'm sure I tried unmasking 1.8.7 and saw the same bug.  Unfortunately I can't verify this at the moment, (I dropped back to 1.8.6 afterwards) - a uClibc update has kind of broken my toolchain and I can't compile Ruby 'til I sort it out...
Comment 4 Alex Legler (RETIRED) archtester gentoo-dev Security 2009-04-03 12:33:47 UTC
I applied the patch to ruby-1.8.6_p287-r13. This should be fixed then, if not, reopen the bug. Thanks!
Comment 5 Tom Lloyd 2010-06-22 18:56:05 UTC
I'm using 1.8.7_p249 now, and the bug's come back :s
I'll try applying the patch against it when I have a moment and see if it still works with the new version.
Comment 6 Tom Lloyd 2010-06-22 21:19:47 UTC
Yup, patch still works against new version but vanilla ebuild is still broken.
Comment 7 Hans de Graaff gentoo-dev Security 2010-07-11 17:07:50 UTC
It looks like this is not fixed yet in ruby-1.8.7_p299. Anyone from the ruby team know why we dropped this patch?
Comment 8 Hans de Graaff gentoo-dev Security 2011-07-18 12:03:26 UTC
I can no longer reproduce this with dev-lang/ruby-1.8.7_p334-r1, so I'm going to close this. Feel free to reopen if there are still problems.