[#89555] [Ruby trunk Feature#15251] Hash aset should deduplicate non tainted string — chopraanmol1@...
Issue #15251 has been updated by chopraanmol1 (Anmol Chopra).
3 messages
2018/10/25
[#89583] [PATCH] vm_trace.c (postponed_job_register): only hit main thread — Eric Wong <normalperson@...>
@hsbt: I post here on ruby-core because I hit errors with
5 messages
2018/10/27
[#89584] Re: [PATCH] vm_trace.c (postponed_job_register): only hit main thread
— Koichi Sasada <ko1@...>
2018/10/27
thank you for you patch.
[#89590] Re: [PATCH] vm_trace.c (postponed_job_register): only hit main thread
— Eric Wong <normalperson@...>
2018/10/28
Koichi Sasada <ko1@atdot.net> wrote:
[#89621] [Ruby trunk Bug#14867] Process.wait can wait for MJIT compiler process — Greg.mpls@...
Issue #14867 has been updated by MSP-Greg (Greg L).
4 messages
2018/10/29
[#89622] Re: [Ruby trunk Bug#14867] Process.wait can wait for MJIT compiler process
— Eric Wong <normalperson@...>
2018/10/29
Greg.mpls@gmail.com wrote:
[#89627] [Ruby trunk Bug#14867] Process.wait can wait for MJIT compiler process — takashikkbn@...
Issue #14867 has been updated by k0kubun (Takashi Kokubun).
3 messages
2018/10/30
[#89654] [Ruby trunk Bug#14867] Process.wait can wait for MJIT compiler process — takashikkbn@...
Issue #14867 has been updated by k0kubun (Takashi Kokubun).
4 messages
2018/10/31
[#89655] Re: [Ruby trunk Bug#14867] Process.wait can wait for MJIT compiler process
— Eric Wong <normalperson@...>
2018/10/31
takashikkbn@gmail.com wrote:
[ruby-core:89601] [Ruby trunk Bug#13930] Exception is caught in rescue above ensure
From:
s.wanabe@...
Date:
2018-10-28 09:13:23 UTC
List:
ruby-core #89601
Issue #13930 has been updated by wanabe (_ wanabe).
File bug13930.disasm added
File bug13930.patch added
I think it's due to `compile_next()` and `add_ensure_iseq()`.
The following is a reduced script result.
```
$ ruby -e 'iseq = RubyVM::InstructionSequence.compile("1.times do; begin; p :loop; next; rescue; p :NG_rescue; ensure; raise \"test\"; end; end rescue p $!"); File.write("bug13930.disasm", iseq.disasm); iseq.eval'
:loop
:NG_rescue
#<RuntimeError: test>
```
Attached "bug13930.disasm" is the disasm result.
"catch type: rescue st: 0001 ed: 0019" may be wrong and it might be a good to be "ed: 0006" or "ed: 0008".
Because "0009 putself" is the receiver of "0012 opt_send_without_block <callinfo!mid:raise ...>" in ensure clause.
I wrote "bug13930.patch" but this is incorrect because:
1. The patch has a performance issue because of `throw` instruction.
* I haven't measured benchmark yet and I don't know how.
2. "next in while loop" pattern should be also fixed.
3. `compile_break()` / `compile_redo()` / `compile_return()` will have same issue because they use `add_ensure_iseq()`.
* But I can't fix them because of "break from proc-closure" error.
----------------------------------------
Bug #13930: Exception is caught in rescue above ensure
https://bugs.ruby-lang.org/issues/13930#change-74638
* Author: msauter (Michael Sauter)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
Given the following code:
~~~ ruby
def foo
i = 0
3.times do |n|
begin
puts "a"
i += 1
next if i > 1
puts "b"
rescue => e
puts "rescue in foo, caught #{e}"
ensure
puts "ensure in foo, yield from foo: #{n}"
yield n
end
end
end
begin
x = 0
foo do |o|
puts o
x += 1
raise "test" if x > 1
puts "done yielding"
end
rescue => e
puts "rescue outside, caught #{e}"
ensure
puts "ensure outside"
end
~~~
The output is:
~~~
a
b
ensure in foo, yield from foo: 0
0
done yielding
a
ensure in foo, yield from foo: 1
1
rescue in foo, caught test
ensure in foo, yield from foo: 1
1
rescue outside, caught test
ensure outside
~~~
So the exception raised within the yielded block is caught in the rescue block above the ensure block which yielded. That sounds wrong to me. Or is it intended? The issue seems to be with the usage of next. Also, exception is caught inside AND outside as it seems that the ensure block ends up being called twice ?!
If I change the code to this:
~~~ ruby
def foo
i = 0
3.times do |n|
begin
puts "a"
i += 1
# next if i > 1
puts "b"
rescue => e
puts "rescue in foo, caught #{e}"
ensure
puts "ensure in foo, yield from foo: #{n}"
yield n
end
end
end
begin
x = 0
foo do |o|
puts o
x += 1
raise "test" if x > 1
puts "done yielding"
end
rescue => e
puts "rescue outside, caught #{e}"
ensure
puts "ensure outside"
end
~~~
Then the output is:
~~~
a
b
ensure in foo, yield from foo: 0
0
done yielding
a
b
ensure in foo, yield from foo: 1
1
rescue outside, caught test
ensure outside
~~~
I would have expected this output also when using next as above.
---Files--------------------------------
bug13930.disasm (3.62 KB)
bug13930.patch (492 Bytes)
--
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>