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

Gathering global thread backtraces fails often on CentOS with JRuby 1.7 #406

Closed
ferrous26 opened this Issue Nov 23, 2012 · 3 comments

Comments

Projects
None yet
2 participants
@ferrous26
Copy link
Contributor

ferrous26 commented Nov 23, 2012

Using JRuby 1.7 on 64-bit CentOS, I get a lot of null pointer exceptions when I try get backtraces for all running threads. I threw together a sample that can cause the exception every single time on the machine that I am using:

Thread.new do
  10.times do 
    Thread.new do
      1_000_000_000.times do
        1 + 1
      end
    end
  end
end

100.times do
  Thread.list.map &:backtrace
end

The backtrace that I get from JRuby looks like this:

RubyThread.java:212:in `getContext': java.lang.NullPointerException
        from RubyThread.java:973:in `backtrace'
        from RubyThread$INVOKER$i$0$0$backtrace.gen:-1:in `call'
        from JavaMethod.java:861:in `call'
        from CachingCallSite.java:70:in `call'
        from RubySymbol.java:428:in `yieldInner'
        from RubySymbol.java:433:in `yield'
        from Block.java:130:in `yield'
        from RubyArray.java:2347:in `collect'
        from RubyArray.java:2360:in `map19'
        from RubyArray$INVOKER$i$0$0$map19.gen:-1:in `call'
        from CachingCallSite.java:143:in `callBlock'
        from CachingCallSite.java:149:in `call'
        from bug.rb:12:in `block_4$RUBY$__file__'
        from bug$block_4$RUBY$__file__:-1:in `call'
        from CompiledBlock19.java:139:in `yield'
        from Block.java:130:in `yield'
        from RubyFixnum.java:273:in `times'
        from RubyFixnum$INVOKER$i$0$0$times.gen:-1:in `call'
        from CachingCallSite.java:316:in `cacheAndCall'
        from CachingCallSite.java:145:in `callBlock'
        from CachingCallSite.java:154:in `callIter'
        from bug.rb:11:in `__file__'
        from bug.rb:-1:in `load'
        from Ruby.java:779:in `runScript'
        from Ruby.java:772:in `runScript'
        from Ruby.java:649:in `runNormally'
        from Ruby.java:498:in `runFromMain'
        from Main.java:375:in `doRunFromMain'
        from Main.java:264:in `internalRun'
        from Main.java:230:in `run'
        from Main.java:214:in `run'
        from Main.java:194:in `main'

java -version info is:

java version "1.7.0_09-icedtea"
OpenJDK Runtime Environment (rhel-2.3.3.el6_3.1-x86_64)
OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
@ferrous26

This comment has been minimized.

Copy link
Contributor Author

ferrous26 commented Nov 23, 2012

I should have mentioned that I do not have this issue when I run the sample code on OS X 10.8.2 with JRuby 1.7

@ferrous26

This comment has been minimized.

Copy link
Contributor Author

ferrous26 commented Nov 23, 2012

Actually, it does occasionally happen on OS X now...hmm.

@benweint

This comment has been minimized.

Copy link

benweint commented Jan 3, 2013

I'm also able to reproduce on OS X 10.8.2 with JRuby 1.7.1. Full version info:

jruby 1.7.1 (1.9.3p327) 2012-12-03 30a153b on Java HotSpot(TM) 64-Bit Server VM 1.6.0_37-b06-434-11M3909 [darwin-x86_64]

@headius headius closed this in fec1af4 Sep 17, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.