Ben Browning created JRUBY-6621:
-----------------------------------
Summary: New ThreadLocal recursiveKey breaks usage of runtimes
across multiple Java threads
Key: JRUBY-6621
URL: https://jira.codehaus.org/browse/JRUBY-6621
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.7
Reporter: Ben Browning
Assignee: Thomas E Enebo
Fix For: JRuby 1.7
As of commit 46c59ad659136fbda7c7fcd77b8bb47180f424f0 you can no longer use a
JRuby runtime across multiple Java threads when using 1.9 mode because the
ThreadLocal variable recursiveKey only gets initialized once when the runtime
is initialized. So, as soon as I pass an initialzed runtime to a new thread
recursiveKey has no value and results in an NPE like:
java.lang.NullPointerException
at org.jruby.RubyHash.internalGetEntry(RubyHash.java:506) [jruby.jar:]
at org.jruby.RubyHash.internalGet(RubyHash.java:502) [jruby.jar:]
at org.jruby.RubyHash.fastARef(RubyHash.java:942) [jruby.jar:]
at org.jruby.Ruby.recursiveCheck(Ruby.java:3765) [jruby.jar:]
at org.jruby.Ruby.execRecursiveInternal(Ruby.java:3801) [jruby.jar:]
at org.jruby.Ruby.execRecursiveOuter(Ruby.java:3876) [jruby.jar:]
at org.jruby.RubyArray.hash19(RubyArray.java:694) [jruby.jar:]\
JUnit TestCase at https://gist.github.com/2494050
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.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