# Socket issue in ruby 1.8.6 in freebsd?

**URL:** <https://www.ruby-forum.com/t/socket-issue-in-ruby-1-8-6-in-freebsd/159857>\
**Category:** Ruby\
**Created:** [February 9, 2009, 2:22pm UTC](https://www.ruby-forum.com/t/socket-issue-in-ruby-1-8-6-in-freebsd/159857 "2009-02-09T14:22:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saku\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e5b9ba/32.png) [@Saku\_Y](https://www.ruby-forum.com/u/Saku_Y)\
**Post date:** [February 9, 2009, 2:22pm UTC](https://www.ruby-forum.com/t/socket-issue-in-ruby-1-8-6-in-freebsd/159857/1 "2009-02-09T14:22:16Z")

</div>

WORKING: (telnet 62.95.30.77 echo)  
getuid(0x2,0x1,0x6,0xff,0x0,0x0) = 0 (0x0)  
setuid(0x0,0x1,0x6,0xff,0x0,0x0) = 0 (0x0)  
setsockopt(0x3,0x0,0x3,0x8062020,0x4,0x0) = 0 (0x0)  
connect(3,{ AF\_INET 62.95.30.77:7 },16) ERR#61 ‘Connection refused’

BROKEN: (Ping.pingecho(‘62.95.30.77’))  
fcntl(3,F\_GETFL,) = 2 (0x2)  
fcntl(3,F\_SETFL,O\_NONBLOCK|0x2) = 0 (0x0)  
connect(3,{ AF\_INET 62.95.30.77:7 },16) ERR#36 ‘Operation now in  
progress’  
getsockopt(0x3,0xffff,0x1007,0xbfbfc7e4,0xbfbfc7e0,0x28070ae0) = 0 (0x0)  
gettimeofday({1234181515.137904 },0x0) = 0 (0x0)  
select(5,{},{3},{3},{4.964864 }) = 1 (0x1)  
connect(3,{ AF\_INET 62.95.30.77:7 },16) ERR#22 ‘Invalid argument’  
getsockopt(0x3,0xffff,0x1007,0xbfbfc7e4,0xbfbfc7e0,0x28070ae0) = 0 (0x0)  
gettimeofday({1234181515.157227 },0x0) = 0 (0x0)  
gettimeofday({1234181515.157406 },0x0) = 0 (0x0)  
select(0,{},{},{},{0.099820 }) = 0 (0x0)  
gettimeofday({1234181515.264522 },0x0) = 0 (0x0)  
select(0,{},{},{},{0.000000 }) = 0 (0x0)  
connect(3,{ AF\_INET 62.95.30.77:7 },16) ERR#22 ‘Invalid argument’  
fcntl(3,F\_SETFL,0x2) = 0 (0x0)  
close(3) = 0 (0x0)  
sigprocmask(SIG\_SETMASK,0x0,0x0) = 0 (0x0)

Is the connect after select an issue here? Or what is? Same thing  
works in Linux. In both cases I do receive the TCP RST (as per  
tcpdump).

---

<div class="post-metadata">

**Author:** ![Saku\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e5b9ba/32.png) [@Saku\_Y](https://www.ruby-forum.com/u/Saku_Y)\
**Post date:** [February 19, 2009, 11:26am UTC](https://www.ruby-forum.com/t/socket-issue-in-ruby-1-8-6-in-freebsd/159857/2 "2009-02-19T11:26:58Z")

</div>

On (2009-02-09 22:19 +0900), Saku Y. wrote:

Just short update, FreeBSD packet maintainer has confirmed this  
issue and reported that RubySpec also trips on it.  
No clue yet about resolution.

---

<div class="post-metadata">

**Author:** ![Saku\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e5b9ba/32.png) [@Saku\_Y](https://www.ruby-forum.com/u/Saku_Y)\
**Post date:** [February 21, 2009, 1:41am UTC](https://www.ruby-forum.com/t/socket-issue-in-ruby-1-8-6-in-freebsd/159857/3 "2009-02-21T01:41:47Z")

</div>

Saku Y. wrote:

> On (2009-02-09 22:19 +0900), Saku Y. wrote:
> 
> Just short update, FreeBSD packet maintainer has confirmed this  
> issue and reported that RubySpec also trips on it.  
> No clue yet about resolution.

I’d repost this to core.  
Cheers!  
-=r

---

<div class="post-metadata">

**Author:** ![Saku\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e5b9ba/32.png) [@Saku\_Y](https://www.ruby-forum.com/u/Saku_Y)\
**Post date:** [February 23, 2009, 6:21pm UTC](https://www.ruby-forum.com/t/socket-issue-in-ruby-1-8-6-in-freebsd/159857/4 "2009-02-23T18:21:10Z")

</div>

On Feb 21, 2:41 am, Roger P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Just short update, FreeBSD packet maintainer has confirmed this  
> > issueand reported that RubySpec also trips on it.  
> > No clue yet about resolution.
> 
> I’d repost this to core.

Yeah I indeed planned, but FreeBSD packet maintainer fixed this.  
[http://www.freebsd.org/cgi/cvsweb.cgi/ports/lang/ruby18/files/patch-ext\_socket\_socket.c?sortby=date](http://www.freebsd.org/cgi/cvsweb.cgi/ports/lang/ruby18/files/patch-ext_socket_socket.c?sortby=date)

---

<div class="post-metadata">

**Author:** ![Saku\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e5b9ba/32.png) [@Saku\_Y](https://www.ruby-forum.com/u/Saku_Y)\
**Post date:** [February 23, 2009, 8:25pm UTC](https://www.ruby-forum.com/t/socket-issue-in-ruby-1-8-6-in-freebsd/159857/5 "2009-02-23T20:25:08Z")

</div>

> > I’d repost this to core.
> 
> Yeah I indeed planned, but FreeBSD packet maintainer fixed this.  
> [ViewVC Repository Listing](http://www.freebsd.org/cgi/cvsweb.cgi/ports/lang/ruby18/files/patch-ext_socket_socket.c?sortby=date)

perhaps should submit a patch to core of it.  
-=r
