Skip to content

getsockopt crashing with 9.2.18.0 and JRUBY_OPTS=--dev flag #6714

@gsouzab

Description

@gsouzab

Hey all 👋
After upgrading to the latest 9.2.18.0 we started experiencing this weird error. It happens only when using the JRUBY_OPTS="--dev" flag. Let me know if you need any extra details to help with the investigation.

Environment Information

  • JRuby 9.2.18.0
  • JRUBY_OPTS="--dev"

Expected Behavior
getsockopt works

Actual Behavior
When using JRUBY_OPTS=--dev getsockopt crashes with the following stacktrace

Traceback (most recent call last): 16: from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:85) 15: from org.jruby.RubyKernel$INVOKER$s$0$3$eval.call(RubyKernel$INVOKER$s$0$3$eval.gen) 14: from org.jruby.RubyKernel.eval(RubyKernel.java:1048) 13: from org.jruby.RubyKernel.evalCommon(RubyKernel.java:1086) 12: from org.jruby.ir.interpreter.Interpreter.evalWithBinding(Interpreter.java:182) 11: from org.jruby.ir.interpreter.Interpreter.evalCommon(Interpreter.java:158) 10: from org.jruby.ir.interpreter.Interpreter.INTERPRET_EVAL(Interpreter.java:106) 9: from org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) 8: from org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:325) 7: from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:206) 6: from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:397) 5: from org.jruby.ext.socket.RubyBasicSocket$INVOKER$i$2$0$getsockopt.call(RubyBasicSocket$INVOKER$i$2$0$getsockopt.gen) 4: from org.jruby.ext.socket.RubyBasicSocket.getsockopt(RubyBasicSocket.java:430) 3: from com.sun.proxy.$Proxy30.getsockoptInt(Unknown Source) 2: from jnr.ffi.provider.NativeInvocationHandler.invoke(NativeInvocationHandler.java:47) 1: from jnr.ffi.provider.jffi.DefaultInvokerFactory$FunctionNotFoundInvoker.invoke(DefaultInvokerFactory.java:465) Java::JavaLang::UnsatisfiedLinkError (native method 'getsockoptInt' not found for method public default int org.jruby.ext.socket.RubyBasicSocket$LibC.getsockoptInt(int,int,int,java.nio.ByteBuffer,jnr.ffi.byref.IntByReference))

How to reproduce
Using the latest JRuby image run the following snippet

require "socket"
puts(JRUBY_VERSION) # to make sure it's 9.2.18.0
s = TCPServer.new(2560)
s.getsockopt(Socket::IPPROTO_TCP, Socket::TCP_INFO) # this is where it crashes

Using irb:

docker run -it jruby:9.2.18.0 bin/bash
JRUBY_OPTS="--dev" irb
require "socket"
puts(JRUBY_VERSION) # to make sure it's 9.2.18.0
s = TCPServer.new(2560)
s.getsockopt(Socket::IPPROTO_TCP, Socket::TCP_INFO) # this is where it crashes

Watch it crash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions