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

Exception.new.backtrace_locations should return nil #5099

Closed
dgolombek opened this issue Mar 21, 2018 · 1 comment
Closed

Exception.new.backtrace_locations should return nil #5099

dgolombek opened this issue Mar 21, 2018 · 1 comment

Comments

@dgolombek
Copy link

no such file to load -- /opt/local/lib/ruby/gems/1.8/gems/awesome_print-0.2.1/lib/ap
jruby-9.1.16.0 :001 > JRUBY_VERSION
 => "9.1.16.0"
jruby-9.1.16.0 :002 > Exception.new.backtrace_locations
Java::JavaLang::NullPointerException:
	from org.jruby.RubyException.backtrace_locations(RubyException.java:111)
	from org.jruby.RubyException$INVOKER$i$0$0$backtrace_locations_DBG.call(RubyException$INVOKER$i$0$0$backtrace_locations_DBG.gen)
	from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:298)
	from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:127)
	from org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:344)
	from org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
	from org.jruby.ir.interpreter.Interpreter.INTERPRET_EVAL(Interpreter.java:117)
	from org.jruby.ir.interpreter.Interpreter.evalCommon(Interpreter.java:171)
	from org.jruby.ir.interpreter.Interpreter.evalWithBinding(Interpreter.java:195)
	from org.jruby.RubyKernel.evalCommon(RubyKernel.java:1028)
	from org.jruby.RubyKernel.eval19(RubyKernel.java:995)
	from org.jruby.RubyKernel$INVOKER$s$0$3$eval19_DBG.call(RubyKernel$INVOKER$s$0$3$eval19_DBG.gen)
	from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:77)
	from org.jruby.ir.instructions.CallBase.interpret(CallBase.java:432)
	from org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
	from org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
... 95 levels...
	from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:155)
	from org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:315)
	from org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
	from org.jruby.ir.interpreter.Interpreter.INTERPRET_ROOT(Interpreter.java:107)
	from org.jruby.ir.interpreter.Interpreter.execute(Interpreter.java:94)
	from org.jruby.ir.interpreter.Interpreter.execute(Interpreter.java:34)
	from org.jruby.ir.IRTranslator.execute(IRTranslator.java:42)
	from org.jruby.Ruby.runInterpreter(Ruby.java:847)
	from org.jruby.Ruby.runInterpreter(Ruby.java:851)
	from org.jruby.Ruby.runNormally(Ruby.java:754)
	from org.jruby.Ruby.runNormally(Ruby.java:767)
	from org.jruby.Ruby.runFromMain(Ruby.java:580)
	from org.jruby.Main.doRunFromMain(Main.java:417)
	from org.jruby.Main.internalRun(Main.java:305)
	from org.jruby.Main.run(Main.java:232)
	from org.jruby.Main.main(Main.java:204)

Running on "Darwin thq-m-dgolo02 16.7.0 Darwin Kernel Version 16.7.0: Thu Jan 11 22:59:40 PST 2018; root:xnu-3789.73.8~1/RELEASE_X86_64 x86_64"

From MRI (2.4.2):

2.4.2 :001 > RUBY_VERSION
 => "2.4.2"
2.4.2 :002 > Exception.new.backtrace_locations
 => nil

Came up in a testing scenario, where exception is inserted via a stub, and exception handler tries to capture information.

@kares kares added this to the JRuby 9.1.17.0 milestone Mar 21, 2018
dgolombek pushed a commit to dgolombek/aws-xray-sdk-ruby that referenced this issue Mar 22, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
This is part of aws#4. Until JRuby 9.2.0.0 is released, the
required_ruby_version in the gemspec will keep this from working there,
as well as jruby/jruby#5099.

* Replaced Oj with MultiJson + Oj OR JrJackson
* Removed Oj.dump parameters, since those are defaults when using MultiJson
* Remove rdiscount for Markdown generation, use default Yard generator.
* Made two minor code syntax changes to make the Yard generator happy

I've roughly compared the generated RDoc and they look very similar.
@headius headius closed this as completed Mar 26, 2018
@headius
Copy link
Member

headius commented Mar 26, 2018

Thanks for the report!

kares added a commit to kares/jruby that referenced this issue Mar 27, 2018
* jruby-9.1:
  [fix] cast nsec nanos to long to avoid "overflow" with double value
  Handle this deprecation differently.
  Default to Java 9 bytecode for any java.specification.version>1.8.
  WrapperMethod is still needed for visibility.
  Revert "Finally eliminate use of WrapperMethod."
  Eliminate deprecation warnings in test suite.
  Finally eliminate use of WrapperMethod.
  Fix most deprecated calls.
  Handle error when attempting to connect to IP6 with default INET4.
  Add test_coverage to jruby.index.
  Add test for null filename in coverage. jruby#5111
  Do not attempt to add coverage for null filename. Fixes jruby#5111.
  Add basic specs for Exception#backtrace_locations.
  Exception.backtrace_locations should persist and be mutable.
  Return nil if no backtrace has been captured. Fixes jruby#5099.
  fix for jruby#5086, RegexpError invalid pattern in look-behind for certain Regexps since 9.1.16.0
eregon pushed a commit to ruby/spec that referenced this issue Apr 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants