evanphx/puma — Issue #41: JRuby 1.6.6 + Rails 3.2.1 | Lots of errors?
Author: meskyanichi
Created: 2012-02-10 17:19:13+00:00
State: open

Using JRuby 1.6.6, Rails 3.2.1

Running: bundle exec puma -b tcp://0.0.0.0:3000

On a bare Rails 3.2.1 app, on the basic Rails index.html with the rails.png image, when you hold CMD+R and spam refresh on the browser, eventually within about 10 seconds the following exception will be raised:

```
java(9162,0x10f01e000) malloc: *** error for object 0x7f9739c22bb0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
```

Also occasionally see this:

```
Exception in thread "RubyThread-9: /Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/thread_pool.rb:55" java.nio.channels.IllegalBlockingModeException
at java.nio.channels.spi.AbstractSelectableChannel.configureBlocking(AbstractSelectableChannel.java:257)
at org.jruby.util.io.SelectBlob.tidyUp(SelectBlob.java:335)
at org.jruby.util.io.SelectBlob.goForIt(SelectBlob.java:86)
at org.jruby.RubyIO.select_static(RubyIO.java:3351)
at org.jruby.RubyIO.select(RubyIO.java:3347)
at org.jruby.RubyIO$s$0$3$select.call(RubyIO$s$0$3$select.gen:65535)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:69)
at org.jruby.ast.CallManyArgsNode.interpret(CallManyArgsNode.java:59)
at org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123)
at org.jruby.ast.IfNode.interpret(IfNode.java:111)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.ast.IfNode.interpret(IfNode.java:119)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.ast.IfNode.interpret(IfNode.java:117)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.ast.WhileNode.interpret(WhileNode.java:131)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.ast.WhileNode.interpret(WhileNode.java:131)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.RescueNode.executeBody(RescueNode.java:216)
at org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:120)
at org.jruby.ast.RescueNode.interpret(RescueNode.java:110)
at org.jruby.ast.EnsureNode.interpret(EnsureNode.java:96)
at org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:190)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:199)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:312)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:169)
at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
at org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:212)
at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:200)
at org.jruby.runtime.Interpreted19Block.call(Interpreted19Block.java:131)
at org.jruby.runtime.Block.call(Block.java:89)
at org.jruby.RubyProc.call(RubyProc.java:270)
at org.jruby.RubyProc.call19(RubyProc.java:258)
at org.jruby.RubyProc$i$0$0$call19.call(RubyProc$i$0$0$call19.gen:65535)
at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:211)
at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:207)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:312)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:169)
at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.ast.WhileNode.interpret(WhileNode.java:131)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
at org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:212)0:0:0:0:0:0:0:1%0 - - [10/Feb/
at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:200)
2012 18:14:20] "GET /index.html HTTP/1.1" 304 - 0.0120
at org.jruby.runtime.Interpreted19Block.call(Interpreted19Block.java:131)
at org.jruby.runtime.Block.call(Block.java:89)
at org.jruby.RubyProc.call(RubyProc.java:270)
at org.jruby.RubyProc.call(RubyProc.java:224)
at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:95)
at java.lang.Thread.run(Thread.java:680)
```

Another thing I noticed is when running Puma through Bundler, two processes seem to stay running. Is this normal? What is the other process doing? One is using about 200mb ram, the other is using 130mb ram. When running Puma without using Bundler I get this:

```
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:6 warning: already initialized constant HTTP_STATUS_CODES
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:47 warning: already initialized constant STATUS_WITH_NO_ENTITY_BODY
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:66 warning: already initialized constant PERSISTENT_TIMEOUT
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:68 warning: already initialized constant DATE
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:70 warning: already initialized constant SCRIPT_NAME
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:73 warning: already initialized constant REQUEST_URI
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:74 warning: already initialized constant REQUEST_PATH
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:76 warning: already initialized constant PATH_INFO
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:78 warning: already initialized constant VERSION
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:78 warning: already initialized constant PUMA_VERSION
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:80 warning: already initialized constant PUMA_TMP_BASE
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:83 warning: already initialized constant ERROR_404_RESPONSE
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:85 warning: already initialized constant CONTENT_LENGTH
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:88 warning: already initialized constant ERROR_503_RESPONSE
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:91 warning: already initialized constant CHUNK_SIZE
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:95 warning: already initialized constant MAX_HEADER
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:98 warning: already initialized constant MAX_BODY
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:101 warning: already initialized constant STATUS_FORMAT
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:103 warning: already initialized constant CONTENT_TYPE
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:105 warning: already initialized constant LAST_MODIFIED
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:106 warning: already initialized constant ETAG
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:107 warning: already initialized constant SLASH
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:108 warning: already initialized constant REQUEST_METHOD
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:109 warning: already initialized constant GET
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:110 warning: already initialized constant HEAD
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:112 warning: already initialized constant ETAG_FORMAT
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:113 warning: already initialized constant LINE_END
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:114 warning: already initialized constant REMOTE_ADDR
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:115 warning: already initialized constant HTTP_X_FORWARDED_FOR
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:116 warning: already initialized constant HTTP_IF_MODIFIED_SINCE
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:117 warning: already initialized constant HTTP_IF_NONE_MATCH
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:118 warning: already initialized constant REDIRECT
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:119 warning: already initialized constant HOST
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:121 warning: already initialized constant SERVER_NAME
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:122 warning: already initialized constant SERVER_PORT
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:123 warning: already initialized constant HTTP_HOST
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:124 warning: already initialized constant PORT_80
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:126 warning: already initialized constant SERVER_PROTOCOL
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:127 warning: already initialized constant HTTP_11
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:128 warning: already initialized constant HTTP_10
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:130 warning: already initialized constant SERVER_SOFTWARE
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:131 warning: already initialized constant GATEWAY_INTERFACE
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:132 warning: already initialized constant CGI_VER
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:134 warning: already initialized constant STOP_COMMAND
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:135 warning: already initialized constant HALT_COMMAND
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:137 warning: already initialized constant RACK_INPUT
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:138 warning: already initialized constant RACK_URL_SCHEME
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:139 warning: already initialized constant RACK_AFTER_REPLY
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:141 warning: already initialized constant HTTP
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:142 warning: already initialized constant HTTPS
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:144 warning: already initialized constant HTTPS_KEY
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:146 warning: already initialized constant HTTP_VERSION
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:147 warning: already initialized constant HTTP_CONNECTION
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:149 warning: already initialized constant HTTP_11_200
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:150 warning: already initialized constant HTTP_10_200
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:152 warning: already initialized constant CLOSE
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:153 warning: already initialized constant KEEP_ALIVE
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:155 warning: already initialized constant CONTENT_LENGTH2
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:156 warning: already initialized constant CONTENT_LENGTH_S
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:157 warning: already initialized constant TRANSFER_ENCODING
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:159 warning: already initialized constant CONNECTION_CLOSE
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:160 warning: already initialized constant CONNECTION_KEEP_ALIVE
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:162 warning: already initialized constant TRANSFER_ENCODING_CHUNKED
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:163 warning: already initialized constant CLOSE_CHUNKED
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:165 warning: already initialized constant COLON
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/const.rb:167 warning: already initialized constant NEWLINE
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/events.rb:45 warning: already initialized constant DEFAULT
/Users/Michael/.rvm/gems/jruby-1.6.6/bundler/gems/puma-256970e0487b/lib/puma/server.rb:324 warning: already initialized constant EmptyBody
LoadError: no such file to load -- openssl/digest
require at org/jruby/RubyKernel.java:1036
(root) at /Users/Michael/.rvm/gems/jruby-1.6.6/gems/net-ssh-2.3.0/lib/net/ssh/transport/hmac/abstract.rb:2
require at org/jruby/RubyKernel.java:1036
(root) at /Users/Michael/.rvm/gems/jruby-1.6.6/gems/net-ssh-2.3.0/lib/net/ssh/transport/hmac/abstract.rb:1
require at org/jruby/RubyKernel.java:1036
(root) at /Users/Michael/.rvm/gems/jruby-1.6.6/gems/net-ssh-2.3.0/lib/net/ssh/transport/hmac/md5.rb:2
require at org/jruby/RubyKernel.java:1036
(root) at /Users/Michael/.rvm/gems/jruby-1.6.6/gems/net-ssh-2.3.0/lib/net/ssh/transport/hmac.rb:6
require at org/jruby/RubyKernel.java:1036
(root) at /Users/Michael/.rvm/gems/jruby-1.6.6/gems/net-ssh-2.3.0/lib/net/ssh/transport/algorithms.rb:7
require at org/jruby/RubyKernel.java:1036
(root) at /Users/Michael/.rvm/gems/jruby-1.6.6/gems/net-ssh-2.3.0/lib/net/ssh/transport/session.rb:10
require at org/jruby/RubyKernel.java:1036
(root) at /Users/Michael/.rvm/gems/jruby-1.6.6/gems/net-ssh-2.3.0/lib/net/ssh.rb:2
require at org/jruby/RubyKernel.java:1036
(root) at /Users/Michael/.rvm/gems/jruby-1.6.6/gems/net-ssh-gateway-1.1.0/lib/net/ssh/gateway.rb:2
require at org/jruby/RubyKernel.java:1036
(root) at /Users/Michael/.rvm/gems/jruby-1.6.6/gems/capistrano-2.9.0/lib/capistrano/configuration/connections.rb:4
require at org/jruby/RubyKernel.java:1036
(root) at /Users/Michael/.rvm/gems/jruby-1.6.6/gems/capistrano-2.9.0/lib/capistrano/configuration.rb:1
require at org/jruby/RubyKernel.java:1036
require at /Users/Michael/.rvm/gems/jruby-1.6.6/gems/capistrano-2.9.0/lib/capistrano.rb:68
each at org/jruby/RubyArray.java:1614
require at /Users/Michael/.rvm/gems/jruby-1.6.6/gems/bundler-1.0.21/lib/bundler/runtime.rb:66
each at org/jruby/RubyArray.java:1614
require at /Users/Michael/.rvm/gems/jruby-1.6.6/gems/bundler-1.0.21/lib/bundler/runtime.rb:55
require at /Users/Michael/.rvm/gems/jruby-1.6.6/gems/bundler-1.0.21/lib/bundler.rb:122
(root) at /Users/Michael/Desktop/hirefire-2/config/application.rb:13
require at org/jruby/RubyKernel.java:1036
require at /Users/Michael/.rvm/rubies/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36
(root) at /Users/Michael/Desktop/hirefire-2/config/application.rb:2
require at org/jruby/RubyKernel.java:1036
require at /Users/Michael/.rvm/rubies/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36
parse_file at /Users/Michael/Desktop/hirefire-2/config/environment.rb:4
instance_eval at org/jruby/RubyBasicObject.java:1726
initialize at /Users/Michael/.rvm/gems/jruby-1.6.6/gems/rack-1.4.1/lib/rack/builder.rb:51
parse_file at config.ru:1
eval at org/jruby/RubyKernel.java:1082
parse_file at /Users/Michael/.rvm/gems/jruby-1.6.6/gems/rack-1.4.1/lib/rack/builder.rb:40
app at /Users/Michael/.rvm/gems/jruby-1.6.6/gems/puma-0.9.3-java/lib/puma/configuration.rb:56
run at /Users/Michael/.rvm/gems/jruby-1.6.6/gems/puma-0.9.3-java/lib/puma/cli.rb:215
(root) at /Users/Michael/.rvm/gems/jruby-1.6.6/gems/puma-0.9.3-java/bin/puma:11
load at org/jruby/RubyKernel.java:1062
(root) at /Users/Michael/.rvm/gems/jruby-1.6.6/bin/puma:19
```