Issue #9352 has been updated by normalperson (Eric Wong).

File 0001-socket-preserve-errno-before-rb_sys_fail_-and-friend.patch added

I can't reproduce the issue, but I think it has to do with calling functions which may clobber errno before
finally calling rb_sys_fail.

Can you try the attached patch (or pull request) against trunk?

$ git pull git://80x24.org/ruby.git sock-preserv-errno

The following changes since commit 12b09864056bfb961f06b0ef675b9fc2fabb9238:

  * properties. (2014-01-03 01:51:05 +0000)

are available in the git repository at:

  git://80x24.org/ruby.git sock-preserv-errno

for you to fetch changes up to aaa0e88d55abcddfdf895508b86fe18e3d6b5cea:

  socket: preserve errno before rb_sys_fail_* and friends (2014-01-03 07:24:35 +0000)

----------------------------------------------------------------
Eric Wong (1):
      socket: preserve errno before rb_sys_fail_* and friends

 ext/socket/socket.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

----------------------------------------
Bug #9352: [BUG] rb_sys_fail_str(connect(2) for [fe80::1%lo0]:3000) - errno == 0
https://bugs.ruby-lang.org/issues/9352#change-44048

Author: kain (Claudio Poli)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin13.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


I'm seeing this crash attempting to connect to an http unreachable host (127.0.0.1:3000) through Excon, which in turn uses `connect_nonblock`.

I'm compiling ruby-trunk at the moment, to try on it as well.


-- 
http://bugs.ruby-lang.org/