Project

General

Profile

Actions

Bug #17160

closed

Wrong exception backtrace

Added by vo.x (Vit Ondruch) about 4 years ago. Updated about 4 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
[ruby-core:99962]

Description

Looking at web-console test results 1, there is following error reported:

WebConsole::EvaluatorTest#test_Evaluator_callers_are_cleaned_up_of_unneeded_backtraces [/home/travis/build/rails/web-console/test/web_console/evaluator_test.rb:63]:
--- expected
+++ actual
@@ -1,3 +1,3 @@
 "RuntimeError: oops
-\tfrom /home/travis/build/rails/web-console/test/web_console/evaluator_test.rb:61:in `block in <class:EvaluatorTest>'
+\tfrom (eval):1:in `block in <class:EvaluatorTest>'
 "

Trying to reproduce the issue, it seems that the exception backtrace is not correct. I have used slightly modified version of 2 included in attachment and the output is:

$ ruby -ractive_support -r./evaluator -e 'e = WebConsole::Evaluator.new(binding); puts e.eval("raise %{oops}")'
# exc.backtrace #
-e:1:in `<main>'
/builddir/t/evaluator.rb:22:in `eval'
/builddir/t/evaluator.rb:22:in `eval'
-e:1:in `<main>'
# caller #
/builddir/t/evaluator.rb:24:in `rescue in eval'
/builddir/t/evaluator.rb:21:in `eval'
-e:1:in `<main>'
RuntimeError: oops

I believe, that the exc.backtrace is wrong and the second line should actually be /builddir/t/evaluator.rb:21:in `eval' similarly to the output of the caller.


Files

evaluator.rb (1.12 KB) evaluator.rb Modified evaluator.rb from web-console. vo.x (Vit Ondruch), 09/07/2020 01:15 PM

Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #17419: `binding.eval` backtrace differenteClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0