Bug #2664
closedFailure: test_segv_test(TestRubyOptions)
Description
=begin
環境によって「-- Ruby level backtrace information-----------------------------------------」が出たり出なかったりして、出る環境では test/ruby/test_rubyoptions.rb の test_segv_test が Failure になります。
% ruby-trunk -e 'Process.kill :SEGV, $$' 2>&1 | head
-e:1: [BUG] Segmentation fault
ruby 1.9.2dev (2010-01-27 trunk 26434) [x86_64-linux]
-- control frame ----------
c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC :kill
c:0003 p:0019 s:0006 b:0006 l:002058 d:001bc8 EVAL -e:1
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:002058 d:002058 TOP
-- Ruby level backtrace information-----------------------------------------
出たり出なかったりする原因は rb_vm_bugreport の i が初期化されていないからのように見えます。
テストも含めて以下のような修正でどうでしょうか?
Index: vm_dump.c¶
--- vm_dump.c (revision 26436)
+++ vm_dump.c (working copy)
@@ -571,8 +571,8 @@
bugreport_backtrace(void arg, VALUE file, int line, VALUE method)
{
if (!(int *)arg) {
- fprintf(stderr, "-- Ruby level backtrace information"
-
"-----------------------------------------\n");
- fprintf(stderr, "-- Ruby level backtrace information "
-
*(int *)arg = 1;"----------------------------------------\n");
}
fprintf(stderr, "%s:%d:in `%s'\n", RSTRING_PTR(file), line, RSTRING_PTR(method));
@@ -586,7 +586,7 @@
rb_vm_bugreport(void)
{
if (GET_THREAD()->vm) {
- int i;
-
int i = 0;
SDR();if (rb_backtrace_each(bugreport_backtrace, &i)) {
Index: test/ruby/test_rubyoptions.rb
===================================================================
--- test/ruby/test_rubyoptions.rb (revision 26436)
+++ test/ruby/test_rubyoptions.rb (working copy)
@@ -333,6 +333,7 @@
--\scontrol\sframe\s----------\n
(?:c:.\n)
---------------------------\n -
--\sRuby\slevel\sbacktrace\sinformation\s----------------------------------------\n -e:1:in\s`<main>'\n -e:1:in\s`kill'\n\n (?:
=end
Updated by matz (Yukihiro Matsumoto) about 14 years ago
=begin
まつもと ゆきひろです
In message "Re: [ruby-dev:40169] [Bug #2664] Failure: test_segv_test(TestRubyOptions)"
on Wed, 27 Jan 2010 08:44:48 +0900, Kazuhiro NISHIYAMA redmine@ruby-lang.org writes:
|出たり出なかったりする原因は rb_vm_bugreport の i が初期化されていないからのように見えます。
|
|テストも含めて以下のような修正でどうでしょうか?
iを初期化するのはともかく、-の個数の変更はなんか意味があるん
ですか?
=end
Updated by znz (Kazuhiro NISHIYAMA) about 14 years ago
=begin
西山和広です。
At Wed, 27 Jan 2010 18:44:14 +0900,
Yukihiro Matsumoto wrote:
|出たり出なかったりする原因は rb_vm_bugreport の i が初期化されていないからのように見えます。
|
|テストも含めて以下のような修正でどうでしょうか?iを初期化するのはともかく、-の個数の変更はなんか意味があるん
ですか?
-- Ruby level backtrace information-----------------------------------------
だったのを
-- C level backtrace information -------------------------------------------
にあわせて空白を入れて(その分 - を減らして)、
-- Ruby level backtrace information ----------------------------------------
となるようにしました。
--
|ZnZ(ゼット エヌ ゼット)
|西山和広(Kazuhiro NISHIYAMA)
=end
Updated by ko1 (Koichi Sasada) about 14 years ago
=begin
(2010/01/27 21:56), Kazuhiro NISHIYAMA wrote::
|出たり出なかったりする原因は rb_vm_bugreport の i が初期化されていないからのように見えます。
|
|テストも含めて以下のような修正でどうでしょうか?iを初期化するのはともかく、-の個数の変更はなんか意味があるん
ですか?-- Ruby level backtrace information-----------------------------------------
だったのを
-- C level backtrace information -------------------------------------------
にあわせて空白を入れて(その分 - を減らして)、
-- Ruby level backtrace information ----------------------------------------
となるようにしました。
どうぞコミットして下さいませ.
--
// SASADA Koichi at atdot dot net
=end
Updated by znz (Kazuhiro NISHIYAMA) about 14 years ago
- Status changed from Open to Closed
=begin
r26447 でコミットしました。
=end