jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JRuby
  • JRUBY-2424

running with -rprofile with multithreaded test causes NPE

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: JRuby 1.2
  • Component/s: Application Error
  • Labels:
    None

Description

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)

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Charles Oliver Nutter added a comment - 12/Feb/09 11:57 AM

I committed fixes in r9114 to both get --profile working again and to confirm that this is fixed. It is fixed!

Show
Charles Oliver Nutter added a comment - 12/Feb/09 11:57 AM I committed fixes in r9114 to both get --profile working again and to confirm that this is fixed. It is fixed!

People

  • Assignee:
    Charles Oliver Nutter
    Reporter:
    Joshua Hull
Vote (0)
Watch (1)

Dates

  • Created:
    21/Apr/08 11:42 AM
    Updated:
    21/Mar/09 1:14 PM
    Resolved:
    12/Feb/09 11:57 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.