From: nobu@... Date: 2015-03-16T01:46:16+00:00 Subject: [ruby-core:68536] [Ruby trunk - Bug #10975] [BUG] rb_sys_fail(getaddrinfo) - errno == 0 (Ruby 2.0.0) Issue #10975 has been updated by Nobuyoshi Nakada. Fixed the previous patch. ~~~diff diff --git a/ext/socket/ipsocket.c b/ext/socket/ipsocket.c index fa5c13c..314825c 100644 --- a/ext/socket/ipsocket.c +++ b/ext/socket/ipsocket.c @@ -41,6 +41,7 @@ inetsock_cleanup(struct inetsock_arg *arg) static VALUE init_inetsock_internal(struct inetsock_arg *arg) { + int error = 0; int type = arg->type; struct addrinfo *res; int fd, status = 0; @@ -66,6 +67,7 @@ init_inetsock_internal(struct inetsock_arg *arg) syscall = "socket(2)"; fd = status; if (fd < 0) { + error = errno; continue; } arg->fd = fd; @@ -92,6 +94,7 @@ init_inetsock_internal(struct inetsock_arg *arg) } if (status < 0) { + error = errno; close(fd); arg->fd = fd = -1; continue; @@ -99,7 +102,7 @@ init_inetsock_internal(struct inetsock_arg *arg) break; } if (status < 0) { - rb_sys_fail(syscall); + rb_syserr_fail(error, syscall); } arg->fd = -1; @@ -107,8 +110,9 @@ init_inetsock_internal(struct inetsock_arg *arg) if (type == INET_SERVER) { status = listen(fd, SOMAXCONN); if (status < 0) { + error = errno; close(fd); - rb_sys_fail("listen(2)"); + rb_syserr_fail(error, "listen(2)"); } } ~~~ ---------------------------------------- Bug #10975: [BUG] rb_sys_fail(getaddrinfo) - errno == 0 (Ruby 2.0.0) https://bugs.ruby-lang.org/issues/10975#change-51856 * Author: Steve Johnson * Status: Feedback * Priority: Normal * Assignee: * ruby -v: ruby 2.0.0p598 (2014-11-13 revision 48408) [x86_64-linux] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- I'm not a developer and I'm not interested in upgrading Ruby as a troubleshooting step. I googled the error but have no idea if the solutions I found address this issue. Environment: Ubuntu 14 with Ruby 2.0.0, Apache 2.4, PHP 5.6, Jekyll 2.4.0, Markdown source with some HTML in source also Steps to reproduce: 1. rm -rf _site 2. bundle exec jekyll serve 3. check-links --no-warnings . Expected result: check-links runs without errors Actual result: check-links starts throwing these while checking files that were authored in HTML: Problem: ./_site/guides/m1x/other/solr-ee-patches.html Link: http://support.magentocommerce.com/ Response: Too many open files - getaddrinfo Note: check-links worked fine before I added the HTML-authored files to the project. Final stack trace: ~~~ /home/stack/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/2.0.0/net/http.rb:878: [BUG] rb_sys_fail(getaddrinfo) - errno == 0 ruby 2.0.0p598 (2014-11-13 revision 48408) [x86_64-linux] (snip) ~~~ ---Files-------------------------------- bug-10975.log (20.1 KB) -- https://bugs.ruby-lang.org/