< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事(スレッド移動)
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Issue #5218 has been updated by Koichi Sasada.
Status changed from Open to Assigned
Assignee set to Nobuyoshi Nakada
----------------------------------------
Bug #5218: at_exit bug with exception handling
https://bugs.ruby-lang.org/issues/5218
Author: Edgars Beigarts
Status: Assigned
Priority: Normal
Assignee: Nobuyoshi Nakada
Category:
Target version:
ruby -v: ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]
It seems that ruby 1.9.2 and later doesn't like exception handling in `at_exit` blocks and resets the exit code to 0.
Here is an example:
#!/usr/bin/ruby
at_exit do
raise "X" rescue nil
end
at_exit do
nil
end
at_exit do
exit 1
end
at_exit do
exit 2
end
Results:
### ruby 1.9.4dev (2011-08-23 trunk 33027) [x86_64-darwin10.8.0]
$ ruby at_exit.rb ; echo $?
0
### ruby 1.9.3dev (2011-07-31 revision 32789) [x86_64-darwin10.8.0]
$ ruby at_exit.rb ; echo $?
0
### ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]
$ ruby at_exit.rb ; echo $?
0
### ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin10.8.0]
$ ruby at_exit.rb ; echo $?
1
### jruby 1.6.3 (ruby-1.8.7-p330) (2011-07-07 965162f) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_26) [darwin-x86_64-java]
$ jruby at_exit.rb ; echo $?
1
### jruby 1.6.3 (ruby-1.9.2-p136) (2011-07-07 965162f) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_26) [darwin-x86_64-java]
$ jruby --1.9 at_exit.rb ; echo $?
1
Related issues:
https://github.com/jnicklas/capybara/pull/463
https://github.com/jnicklas/capybara/issues/178
https://github.com/rspec/rspec-core/pull/410
--
http://bugs.ruby-lang.org/