running with -rprofile with multithreaded test causes NPE
---------------------------------------------------------

                 Key: JRUBY-2424
                 URL: http://jira.codehaus.org/browse/JRUBY-2424
             Project: JRuby
          Issue Type: Bug
            Reporter: Joshua Hull
            Assignee: Thomas E Enebo


The following stack trace is emitted from:

require 'java'
require 'benchmark'

num_threads = 16
threads = []

date = Time.new

(0...num_threads).each do |i|
        threads[i] = Thread.new do
                1000.times do
                        java.util.HashMap.new
                end
        end
end

(0...num_threads).each { |i| threads[i].join }

puts ("date: #{Time.new-date}")

-----

where running with -rprofile

Exception in thread "Ruby Thread122390045" java.lang.NullPointerException
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:374)
        at org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:632)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:303)
        at org.jruby.evaluator.ASTInterpreter.caseNode(ASTInterpreter.java:754)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:311)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:169)
        at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:150)
        at org.jruby.runtime.InterpretedBlock.call(InterpretedBlock.java:103)
        at org.jruby.runtime.Block.call(Block.java:105)
        at org.jruby.RubyProc.call(RubyProc.java:205)
        at org.jruby.RubyProc.call(RubyProc.java:184)
        at org.jruby.Ruby$CallTraceFuncHook.event(Ruby.java:1937)
        at org.jruby.Ruby.callEventHooks(Ruby.java:1982)
        at 
org.jruby.internal.runtime.methods.SimpleCallbackMethod.call(SimpleCallbackMethod.java:63)
        at 
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:66)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:235)
        at org.jruby.evaluator.ASTInterpreter.callNode(ASTInterpreter.java:682)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:309)
        at 
org.jruby.evaluator.ASTInterpreter.whileNode(ASTInterpreter.java:1801)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:490)
        at org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:632)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:303)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:169)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:172)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:148)
        at org.jruby.RubyClass.invoke(RubyClass.java:238)
        at 
org.jruby.javasupport.util.RuntimeHelpers.invoke(RuntimeHelpers.java:323)
        at org.jruby.RubyObject.callMethod(RubyObject.java:484)
        at org.jruby.RubyEnumerable.callEach(RubyEnumerable.java:63)
        at org.jruby.RubyEnumerable.collect(RubyEnumerable.java:281)
        at org.jruby.RubyEnumerableInvoker$collect_s_method_0_0.call(Unknown 
Source)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:280)
        at 
ruby.Users.josh.Development.biblio.trunk.bcui.test.closure_44_3(test.rb:54)
        at 
ruby.Users.josh.Development.biblio.trunk.bcui.testBlockCallback$closure_44_3xx1.call(Unknown
 Source)
        at org.jruby.runtime.CompiledBlock.yield(CompiledBlock.java:107)
        at org.jruby.runtime.CompiledBlock.yield(CompiledBlock.java:88)
        at org.jruby.runtime.Block.yield(Block.java:109)
        at org.jruby.RubyInteger.times(RubyInteger.java:162)
        at org.jruby.RubyIntegerInvoker$times_method_0_0.call(Unknown Source)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:280)
        at 
ruby.Users.josh.Development.biblio.trunk.bcui.test.closure_43_2(test.rb:45)
        at 
ruby.Users.josh.Development.biblio.trunk.bcui.testBlockCallback$closure_43_2xx1.call(Unknown
 Source)
        at org.jruby.runtime.CompiledBlock.yield(CompiledBlock.java:107)
        at org.jruby.runtime.CompiledBlock.call(CompiledBlock.java:83)
        at org.jruby.runtime.Block.call(Block.java:105)
        at org.jruby.RubyProc.call(RubyProc.java:205)
        at org.jruby.RubyProc.call(RubyProc.java:184)
        at 
org.jruby.internal.runtime.RubyNativeThread.run(RubyNativeThread.java:73)

-- 
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