Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Garbage data in UNIXSocket path #4247

Closed
etehtsea opened this issue Oct 26, 2016 · 1 comment
Closed

Garbage data in UNIXSocket path #4247

etehtsea opened this issue Oct 26, 2016 · 1 comment
Milestone

Comments

@etehtsea
Copy link
Contributor

#4221 regression.

     [exec] Failure: test_can_create_socket_server_and_client_connected_to_it_and_send_from_client_to_server_using_recvfrom(UNIXSocketTests)
     [exec] /home/travis/build/jruby/jruby/test/jruby/test_socket.rb:494:in `test_can_create_socket_server_and_client_connected_to_it_and_send_from_client_to_server_using_recvfrom'
     [exec]      491:         cli = UNIXSocket.open(path)
     [exec]      492:         servsock = sock.accept
     [exec]      493:         cli.send("hello",0)
     [exec]   => 494:         assert_equal ["hello", ["AF_UNIX", ""]], servsock.recvfrom(5)
     [exec]      495:         servsock.close
     [exec]      496:         cli.close
     [exec]      497:         sock.close
     [exec] <["hello", ["AF_UNIX", ""]]> expected but was
     [exec] <["hello", ["AF_UNIX", "��"]]>
     [exec] 
     [exec] diff:
     [exec] ? ["hello", ["AF_UNIX", "��"]]
     [exec] ===============================================================================
     [exec] Failure: test_can_create_socketpair_and_can_send_from_the_other_with_recvfrom(UNIXSocketTests)
     [exec] /home/travis/build/jruby/jruby/test/jruby/test_socket.rb:542:in `test_can_create_socketpair_and_can_send_from_the_other_with_recvfrom'
     [exec]      539:         sock1, sock2 = UNIXSocket.socketpair
     [exec]      540: 
     [exec]      541:         sock2.send("hello", 0)
     [exec]   => 542:         assert_equal ["hello", ["AF_UNIX", ""]], sock1.recvfrom(5)
     [exec]      543: 
     [exec]      544:         sock2.close
     [exec]      545:         sock1.close
     [exec] <["hello", ["AF_UNIX", ""]]> expected but was
     [exec] <["hello", ["AF_UNIX", "# \u0017\u007F"]]>
     [exec] 
     [exec] diff:
     [exec] ? ["hello", ["AF_UNIX", "# \u0017\u007F"]]
     [exec] ===============================================================================
     [exec] Failure: test_unix_socket_peeraddr(UNIXSocketTests)
     [exec] /home/travis/build/jruby/jruby/test/jruby/test_socket.rb:334:in `test_unix_socket_peeraddr'
     [exec]      331: 
     [exec]      332:        ssrv = server.accept
     [exec]      333: 
     [exec]   => 334:        assert_equal ["AF_UNIX", ""], ssrv.peeraddr
     [exec]      335:        # TODO doesn't work as expected :
     [exec]      336:        pend "UNIXSocket#peeraddr #{cli.peeraddr.inspect} does not include path: #{path.inspect}"
     [exec]      337:        assert_equal ["AF_UNIX", path], cli.peeraddr
     [exec] <["AF_UNIX", ""]> expected but was
     [exec] <["AF_UNIX", "��"]>
     [exec] 
     [exec] diff:
     [exec] ? ["AF_UNIX", "��"]
     [exec] 
etehtsea added a commit to etehtsea/jnr-unixsocket that referenced this issue Oct 26, 2016
getsockname/getpeername/accept shouldn't inspect path for unnamed
sockets. See https://linux.die.net/man/7/unix
Fixes jruby/jruby#4247
etehtsea added a commit to etehtsea/jnr-unixsocket that referenced this issue Oct 26, 2016
getsockname/getpeername/accept shouldn't inspect path for unnamed
sockets. See https://linux.die.net/man/7/unix
Fixes jruby/jruby#4247
@etehtsea
Copy link
Contributor Author

Opened PR with fix in jnr-unixsocket repo.

etehtsea added a commit to etehtsea/jnr-unixsocket that referenced this issue Oct 26, 2016
getsockname/getpeername/accept shouldn't inspect path for unnamed
sockets. See https://linux.die.net/man/7/unix
Fixes jruby/jruby#4247
@enebo enebo reopened this Oct 26, 2016
@enebo enebo closed this as completed in 327fe55 Oct 26, 2016
@enebo enebo added this to the JRuby 9.1.6.0 milestone Nov 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants