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

MiniSSL blows up on Java 8 #2308

Closed
kovyrin opened this issue Jul 8, 2020 · 3 comments
Closed

MiniSSL blows up on Java 8 #2308

kovyrin opened this issue Jul 8, 2020 · 3 comments

Comments

@kovyrin
Copy link

kovyrin commented Jul 8, 2020

Describe the bug

When running on Java 8 with SSL configured, I see our process reliably blow up with the following error:

Error reached top of thread-pool: java.nio.ByteBuffer.limit(I)Ljava/nio/ByteBuffer; (Java::JavaLang::NoSuchMethodError)

After patching puma's thread pool class, I got the following stack trace:

Stacktrace: org.jruby.puma.MiniSSL$MiniSSLBuffer.resize(MiniSSL.java:97)
	org.jruby.puma.MiniSSL$MiniSSLBuffer.put(MiniSSL.java:82)
	org.jruby.puma.MiniSSL.inject(MiniSSL.java:203)
	org.jruby.puma.MiniSSL$INVOKER$i$1$0$inject.call(MiniSSL$INVOKER$i$1$0$inject.gen)
	org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:375)
	org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:174)
	org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:316)
	org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
	org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)
	org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:156)
	org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:143)
	org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
	org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:375)
	org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:174)
	org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:316)
	org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
	org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:80)
	org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:121)
	org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:108)
	org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:192)
	org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:354)
	org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:143)
	org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:345)
	org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
	org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:80)
	org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:121)
	org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:108)
	org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:192)
	org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:354)
	org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:143)
	org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:345)
	org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
	org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:116)
	org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:143)
	org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:79)
	org.jruby.runtime.Block.call(Block.java:129)
	org.jruby.RubyProc.call(RubyProc.java:299)
	org.jruby.RubyProc.call(RubyProc.java:278)
	org.jruby.RubyProc.call(RubyProc.java:266)
	org.jruby.RubyProc$INVOKER$i$0$0$call.call(RubyProc$INVOKER$i$0$0$call.gen)
	org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:332)
	org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:86)
	org.jruby.ir.instructions.CallBase.interpret(CallBase.java:540)
	org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:361)
	org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
	org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:116)
	org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:143)
	org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:79)
	org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:71)
	org.jruby.runtime.Block.call(Block.java:125)
	org.jruby.RubyProc.call(RubyProc.java:274)
	org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:105)
	java.lang.Thread.run(Thread.java:748)

When I re-compiled the http11 jar with java8, it all worked as expected.

Puma config:

We're running Puma in an embedded mode, so there is no command line, but it is basically a simple default puma launcher with a bind URL that looks like this:

ssl://127.0.0.1:3002?keystore=%2Fvar%2Ffolders%2Fp4%2Fnkn4d60s6bdcl0xwyq969hgw0000gn%2FT%2F20200708-4547-1u8cpc5&keystore-pass=BnBIKszsXS9YmiVfnE8XMIS5uDmQLDwT%2Bw6UbFoLOo69eX5LQexfDCjq6m5cjl6J1wwuiCJPLijWWSN2%2FzOYUg%3D%3D&verify_mode=none

To Reproduce

Sorry, did not have the time to build a repro case for this, but the internet is full of issues explaining the problem, so that should help I think: jetty/jetty.project#3244.

Expected behavior

When running in Java 8, puma's MiniSSL library should work.

Desktop:

  • OS: Mac
  • Puma Version 4.3.5
  • Java: 1.8
@kovyrin
Copy link
Author

kovyrin commented Jul 8, 2020

Given the comment here, it seems that it is supposed to produce 1.6-compatible bytecode, but looks like something is broken there.

Paging @headius for any insight he might have 🙏

@JohnPhillips31416
Copy link
Contributor

similar to #2301

@nateberkopec
Copy link
Member

Fixed on master now by #2307

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

3 participants