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

repeated popen call may throw NULL pointer exception

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: JRuby 1.1.3
  • Fix Version/s: JRuby 1.2
  • Component/s: Core Classes/Modules
  • Labels:
    None
  • Environment:
    Linux amd64 Sun jre 1.6
  • Testcase included:
    yes

Description

For me the attached code locks up within few iterations, and sometimes throws a NULL pointer exception.

ava.lang.NullPointerException
at org.jruby.util.io.OpenFile.finalize(OpenFile.java:241)
at org.jruby.util.io.OpenFile.cleanup(OpenFile.java:226)
at org.jruby.RubyIO.close2(RubyIO.java:1684)
at org.jruby.RubyIO.close(RubyIO.java:1662)
at org.jruby.RubyIOInvoker$close_method_0_0.call(Unknown Source)
at org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:123)
at org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:333)
at ruby.Users.hramrach.testt2.rescue_2$RUBY$_rescue_(testt2.rb)
at ruby.Users.hramrach.testt2.method__0$RUBY$try_analyze(testt2.rb:16)
at ruby.Users.hramrach.testt2Invokermethod__0$RUBY$try_analyzeOpt.call(Unknown
Source)
at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:134)
at org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:111)
at org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:282)
at ruby.Users.hramrach.testt2.block_3$RUBY$_block_(testt2.rb:21)
at ruby.Users.hramrach.testt2BlockCallback$block_3$RUBY$_block_xx1.call(Unknown
Source)
at org.jruby.runtime.CompiledBlock.yield(CompiledBlock.java:100)
at org.jruby.runtime.Block.yield(Block.java:100)
at org.jruby.RubyInteger.upto(RubyInteger.java:122)
at org.jruby.RubyIntegerInvoker$upto_method_1_0.call(Unknown Source)
at org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:159)
at org.jruby.runtime.CallSite$InlineCachingCallSite.callIter(CallSite.java:415)
at ruby.Users.hramrach.testt2._file_(testt2.rb:20)
at ruby.Users.hramrach.testt2._file_(testt2.rb)
at ruby.Users.hramrach.testt2.load(testt2.rb)
at org.jruby.Ruby.runScript(Ruby.java:541)
at org.jruby.Ruby.runNormally(Ruby.java:454)
at org.jruby.Ruby.runFromMain(Ruby.java:327)
at org.jruby.Main.run(Main.java:194)
at org.jruby.Main.run(Main.java:91)
at org.jruby.Main.main(Main.java:82)

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. File
    testt2_.rb
    27/Aug/08 7:09 AM
    0.4 kB
    Michal Suchanek

Activity

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

I cleaned up some logic that should prevent the exceptions you were seeing, but the script is a little problematic; you have a thread spinning away writing to the descriptor and then you close it at some indeterminate time in the future. It's probably expected that you should see some exceptional behavior since it could be in the middle of a write when it's closed. You may want to sync up with the thread a bit more aggressively. At any rate, script seems to run well now. Can you come up with something we could include as a test case?

Show
Charles Oliver Nutter added a comment - 09/Feb/09 11:00 AM I cleaned up some logic that should prevent the exceptions you were seeing, but the script is a little problematic; you have a thread spinning away writing to the descriptor and then you close it at some indeterminate time in the future. It's probably expected that you should see some exceptional behavior since it could be in the middle of a write when it's closed. You may want to sync up with the thread a bit more aggressively. At any rate, script seems to run well now. Can you come up with something we could include as a test case?

People

  • Assignee:
    Charles Oliver Nutter
    Reporter:
    Michal Suchanek
Vote (0)
Watch (1)

Dates

  • Created:
    27/Aug/08 7:09 AM
    Updated:
    21/Mar/09 1:14 PM
    Resolved:
    09/Feb/09 11:00 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.