Skip to content

Exception.new.backtrace_locations should return nil #5099

@dgolombek

Description

@dgolombek
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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions