Bug #9373

test_autobind(TestSocket_UNIXSocket) fails on PPC

Added by Vit Ondruch over 1 year ago. Updated about 1 year ago.

[ruby-core:59601]
Status:Third Party's Issue
Priority:Normal
Assignee:-
ruby -v:ruby 2.0.0p247 (2013-06-27) [powerpc-linux] Backport:1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN

Description

=begin
test_autobind(TestSocket_UNIXSocket) fails quite often on PPC:

test_autobind(TestSocket_UNIXSocket):
Errno::ECONNREFUSED: Connection refused - connect(2)
/builddir/build/BUILD/ruby-2.0.0-p247/.ext/common/socket.rb:65:in connect'
/builddir/build/BUILD/ruby-2.0.0-p247/.ext/common/socket.rb:65:in
connect_internal'
/builddir/build/BUILD/ruby-2.0.0-p247/.ext/common/socket.rb:135:in connect'
/builddir/build/BUILD/ruby-2.0.0-p247/.ext/common/socket.rb:765:in
unix'
/builddir/build/BUILD/ruby-2.0.0-p247/test/socket/test_unix.rb:589:in block in test_autobind'
/builddir/build/BUILD/ruby-2.0.0-p247/.ext/common/socket.rb:806:in
unix_server_socket'
/builddir/build/BUILD/ruby-2.0.0-p247/test/socket/test_unix.rb:585:in `test_autobind'
=end

History

#1 Updated by Vit Ondruch about 1 year ago

So this issue was recently reported also into RH bugzilla [1] and Gustavo provided reproducer [2] for this issue:

#include <sys/socket.h>
#include <stdio.h>

int main()
{
        int fd = socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC, 0);

        int i = 1;
        setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &i, 4);

        struct sockaddr addr;
        addr.sa_family = AF_LOCAL;
        bind(fd, &addr, 2);

        listen(fd, 128);

        struct sockaddr_storage ss;
        socklen_t sslen = (socklen_t)sizeof(ss);
        getsockname(fd, (struct sockaddr*)&ss, &sslen);

        fd = socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC, 0);

        if (connect(fd, (struct sockaddr*)&ss, sslen) == -1){
                perror(NULL);
                return 1;
        }
        printf("OK\n");
        return 0;
} 

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1070206
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1070206#c2

#2 Updated by Vit Ondruch about 1 year ago

  • Status changed from Open to Third Party's Issue

Closing, since this will be fixed in Kernel. Sorry for the noise.

http://patchwork.ozlabs.org/patch/326572/

Also available in: Atom PDF