Socket#getsockname for closed socket causes NPE
-----------------------------------------------

                 Key: JRUBY-5234
                 URL: http://jira.codehaus.org/browse/JRUBY-5234
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.5.5
         Environment: jruby 1.5.5 (ruby 1.8.7 patchlevel 249) (2010-11-10 
4bd4200) (OpenJDK 64-Bit Server VM 1.6.0_20) [amd64-java]
            Reporter: Hiroshi Nakamura
            Assignee: Hiroshi Nakamura
            Priority: Minor


{noformat}
1% jruby -rsocket -e 'server = TCPServer.new("localhost", 0); server.close; 
server.getsockname'  
RubyBasicSocket.java:192:in `getLocalSocket': java.lang.NullPointerException
        from RubyIPSocket.java:110:in `getsockname'
        from 
org/jruby/ext/socket/RubyBasicSocket$i_method_0_0$RUBYINVOKER$getsockname.gen:65535:in
 `call'
        from CachingCallSite.java:289:in `cacheAndCall'
        from CachingCallSite.java:108:in `call'
        from -e:1:in `__file__'
        from -e:-1:in `load'
        from Ruby.java:690:in `runScript'
        from Ruby.java:573:in `runNormally'
        from Ruby.java:416:in `runFromMain'
        from Main.java:286:in `run'
        from Main.java:128:in `run'
        from Main.java:97:in `main'
1% ruby -rsocket -e 'server = TCPServer.new("localhost", 0); server.close; 
server.getsockname' 
-e:1:in `getsockname': closed stream (IOError)
        from -e:1:in `<main>'
{noformat}

Other tests are in test/externals/ruby1.8/socket/test_socket.rb

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to