Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException in CachingCallSite.pollAndGetClass #885

Closed
rb2k opened this issue Jul 15, 2013 · 5 comments
Closed

NullPointerException in CachingCallSite.pollAndGetClass #885

rb2k opened this issue Jul 15, 2013 · 5 comments

Comments

@rb2k
Copy link

rb2k commented Jul 15, 2013

I ran into this:

Exception in thread "RubyThread-4: crawler_00_launcher.rb:1" java.lang.NullPointerException
        at org.jruby.runtime.callsite.CachingCallSite.pollAndGetClass(CachingCallSite.java:433)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:131)
        at rubyjit.DBInserter$$insert_domain_92F22C715B6840731C519D323FF0F42DB457A79D1067935966.block_2$RUBY$__file__(/opt/Crawler/Crawler/lib/lib/db_inserter.rb:344)
        at rubyjit$DBInserter$$insert_domain_92F22C715B6840731C519D323FF0F42DB457A79D1067935966$block_2$RUBY$__file__.call(rubyjit$DBInserter$$insert_domain_92F22C715B6840731C519D323FF0F42DB457A79D1067935966$block_2$RUBY$__file__)
        at org.jruby.runtime.CompiledBlock19.yield(CompiledBlock19.java:159)
        at org.jruby.runtime.CompiledBlock19.yield(CompiledBlock19.java:145)
        at org.jruby.runtime.Block.yieldArray(Block.java:158)
        at org.jruby.RubyHash$23.visit(RubyHash.java:1621)
        at org.jruby.RubyHash.visitAll(RubyHash.java:636)
        at org.jruby.RubyHash.iteratorVisitAll(RubyHash.java:1296)
        at org.jruby.RubyHash.delete_ifInternal(RubyHash.java:1619)
        at org.jruby.RubyHash.delete_if(RubyHash.java:1632)
        at org.jruby.RubyHash$INVOKER$i$0$0$delete_if.call(RubyHash$INVOKER$i$0$0$delete_if.gen)
        at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:143)
        at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:154)
        at rubyjit.DBInserter$$insert_domain_92F22C715B6840731C519D323FF0F42DB457A79D1067935966.__file__(/opt/Crawler/Crawler/lib/lib/db_inserter.rb:344)
        at rubyjit.DBInserter$$insert_domain_92F22C715B6840731C519D323FF0F42DB457A79D1067935966.__file__(/opt/Crawler/Crawler/lib/lib/db_inserter.rb)
        at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:181)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)
        at crawler_00_launcher.block_6$RUBY$__file__(crawler_00_launcher.rb:182)
        at crawler_00_launcher$block_6$RUBY$__file__.call(crawler_00_launcher$block_6$RUBY$__file__)
        at org.jruby.runtime.CompiledBlock19.yieldSpecificInternal(CompiledBlock19.java:117)
        at org.jruby.runtime.CompiledBlock19.yieldSpecific(CompiledBlock19.java:92)
        at org.jruby.runtime.Block.yieldSpecific(Block.java:111)
        at org.jruby.RubyKernel.loop(RubyKernel.java:1489)
        at org.jruby.RubyKernel$INVOKER$s$0$0$loop.call(RubyKernel$INVOKER$s$0$0$loop.gen)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:316)
        at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:145)
        at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:154)
        at crawler_00_launcher.block_5$RUBY$__file__(crawler_00_launcher.rb:89)
        at crawler_00_launcher$block_5$RUBY$__file__.call(crawler_00_launcher$block_5$RUBY$__file__)
        at org.jruby.runtime.CompiledBlock19.yield(CompiledBlock19.java:159)
        at org.jruby.runtime.CompiledBlock19.call(CompiledBlock19.java:87)
        at org.jruby.runtime.Block.call(Block.java:101)
        at org.jruby.RubyProc.call(RubyProc.java:274)
        at org.jruby.RubyProc.call(RubyProc.java:215)
        at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:100)
        at java.lang.Thread.run(Thread.java:724)

The line 344 is this piece of code:

    # cleanup empty values, we don't need to save nils/empty strings in the database
    new_doc.delete_if { |key,value| value.to_s.empty? }
@rb2k
Copy link
Author

rb2k commented Jul 16, 2013

Note that this doesn't happen on every run with every document, it will show up after a minute or two.

Also:

# ruby -v
jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on Java HotSpot(TM) 64-Bit Server VM 1.7.0_25-b15 [linux-amd64]

The current workaround seems to be:

new_doc.keys.each do |k|
    new_doc.delete(k) if new_doc[k].to_s.empty?
end

@headius
Copy link
Member

headius commented Jul 24, 2013

Usually this means that a null is getting into the call path somewhere. I don't suppose you can try building JRuby yourself, so we could add some monitoring code and figure out what is happening?

@rb2k
Copy link
Author

rb2k commented Jul 24, 2013

I could try it once I get my hands on a bit of free time :)
Any instructions on how I'd have to build it?

@headius
Copy link
Member

headius commented Jul 25, 2013

There's pretty good instructions in BUILDING.md. Let me know if you have trouble.

@enebo enebo added this to the Invalid or Duplicate milestone Apr 1, 2016
@enebo
Copy link
Member

enebo commented Apr 1, 2016

coming on 3 years with no more info to act on. If this problem still exists then please open a new issue.

@enebo enebo closed this as completed Apr 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants