[#84280] [Ruby trunk Bug#14181] hangs or deadlocks from waitpid, threads, and trapping SIGCHLD — nobu@...
Issue #14181 has been updated by nobu (Nobuyoshi Nakada).
3 messages
2017/12/15
[#84398] [Ruby trunk Bug#14220] WEBrick changes - failures on MSWIN, MinGW — Greg.mpls@...
Issue #14220 has been reported by MSP-Greg (Greg L).
3 messages
2017/12/22
[#84472] Re: [ruby-dev:50394] [Ruby trunk Bug#14240] warn four special variables: $; $, $/ $\ — Eric Wong <normalperson@...>
Shouldn't English posts be on ruby-core instead of ruby-dev?
3 messages
2017/12/26
[ruby-core:84482] [Ruby trunk Bug#4352] [patch] Fix eval(s, b) backtrace; make eval(s, b) consistent with eval(s)
From:
mame@...
Date:
2017-12-26 17:39:44 UTC
List:
ruby-core #84482
Issue #4352 has been updated by mame (Yusuke Endoh).
Target version set to next minor
We discussed this issue at today's Ruby committer's meeting. We can't change the behavior soon because of compatibility issue, so we need a transition path.
After r61483, a warning is now printed when `eval` receives only `binding` and the code includes `__FILE__` or `__LINE__`.
```
$ ./miniruby -w -e 'eval("[__FILE__, __LINE__]", binding)'
-e:1: warning: __FILE__ in eval may not return location in binding; use Binding#source_location instead
-e:1: warning: __LINE__ in eval may not return location in binding; use Binding#source_location instead
```
The return value will be changed from binding's source location to eval's default, i.e., `"(eval)"` and `1`. If you need the traditional behavior, please pass the location information explicitly, like: `eval("[__FILE__, __LINE__]", binding, *binding.source_location)`.
----------------------------------------
Bug #4352: [patch] Fix eval(s, b) backtrace; make eval(s, b) consistent with eval(s)
https://bugs.ruby-lang.org/issues/4352#change-68997
* Author: quix (James M. Lawrence)
* Status: Assigned
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version: next minor
* ruby -v: ruby 1.9.3dev (2011-02-01 trunk 30751) [i386-darwin9.8.0]
* Backport:
----------------------------------------
=begin
def ex_message
begin
yield
rescue => e
p e.message
end
end
ex_message { eval('raise') }
ex_message { eval('raise', binding) }
eval('def f ; end')
p method(:f).source_location
eval('def g ; end', binding)
p method(:g).source_location
----
Without patch:
"(eval):1:in `block in <main>': "
""
["(eval)", 1]
["eval_test.rb", 14]
With patch:
"(eval):1:in `block in <main>': "
"(eval):1:in `block in <main>': "
["(eval)", 1]
["(eval)", 1]
Knowing the line of an error inside eval is useful. Passing a binding
shouldn't discard that information. Present behavior is even wrong:
there's no line 10 in this file.
----
eval %{
# .. code ...
raise
}, binding
----
Without patch:
/Users/jlawrence/tmp/raiser.rb:10:in `<main>': unhandled exception
from /Users/jlawrence/tmp/raiser.rb:7:in `eval'
from /Users/jlawrence/tmp/raiser.rb:7:in `<main>'
With patch:
/Users/jlawrence/tmp/raiser.rb:7:in `eval': (eval):4:in `<main>': (RuntimeError)
from /Users/jlawrence/tmp/raiser.rb:7:in `eval'
from /Users/jlawrence/tmp/raiser.rb:7:in `<main>'
=end
---Files--------------------------------
eval.patch (1.75 KB)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>