[#75225] [Ruby trunk Feature#12324] Support OpenSSL 1.1.0 (and drop support for 0.9.6/0.9.7) — k@...
Issue #12324 has been reported by Kazuki Yamaguchi.
6 messages
2016/04/27
[#78693] Re: [Ruby trunk Feature#12324] Support OpenSSL 1.1.0 (and drop support for 0.9.6/0.9.7)
— Eric Wong <normalperson@...>
2016/12/17
k@rhe.jp wrote:
[#78701] Re: [Ruby trunk Feature#12324] Support OpenSSL 1.1.0 (and drop support for 0.9.6/0.9.7)
— Kazuki Yamaguchi <k@...>
2016/12/17
On Sat, Dec 17, 2016 at 01:31:12AM +0000, Eric Wong wrote:
[#78702] Re: [Ruby trunk Feature#12324] Support OpenSSL 1.1.0 (and drop support for 0.9.6/0.9.7)
— Eric Wong <normalperson@...>
2016/12/17
Kazuki Yamaguchi <k@rhe.jp> wrote:
[ruby-core:74981] [Ruby trunk Bug#12068] raise overwrites exception cause even if exception is not new
From:
nagachika00@...
Date:
2016-04-16 19:28:45 UTC
List:
ruby-core #74981
Issue #12068 has been updated by Tomoyuki Chikanaga.
Backport changed from 2.0.0: DONTNEED, 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED to 2.0.0: DONTNEED, 2.1: REQUIRED, 2.2: REQUIRED, 2.3: DONE
ruby_2_3 r54617 merged revision(s) 53819,53822.
----------------------------------------
Bug #12068: raise overwrites exception cause even if exception is not new
https://bugs.ruby-lang.org/issues/12068#change-58107
* Author: Charles Nutter
* Status: Closed
* Priority: Normal
* Assignee:
* ruby -v: 2.3.0
* Backport: 2.0.0: DONTNEED, 2.1: REQUIRED, 2.2: REQUIRED, 2.3: DONE
----------------------------------------
It appears that `raise` will overwrite the original cause of an exception even when re-raising the same one. I believe this is a bug, since loses the original cause and associates the re-raised exception with a completely unrelated cause.
Example:
```ruby
begin
begin
raise 'a'
rescue => a
begin
raise 'b'
rescue => b
p [b, b.cause]
begin
raise 'c'
rescue
raise b
end
end
end
rescue
p [$!, $!.cause]
end
```
CRuby outputs:
```
[] ~/projects/jruby $ ruby23 cause.rb
[#<RuntimeError: b>, #<RuntimeError: a>]
[#<RuntimeError: b>, #<RuntimeError: c>]
```
Here, the original cause of the "b" exception (the "a" exception) is lost, replaced during the re-raise with the "c" exception.
I believe JRuby 9.0.5.0's behavior is correct here:
```
[] ~/projects/jruby $ rvm jruby-9.0.5.0 do ruby cause.rb
[#<RuntimeError: b>, #<RuntimeError: a>]
[#<RuntimeError: b>, #<RuntimeError: a>]
```
--
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>