[#39420] Marshal.load で例外発生時に Segmentation fault エラー — patamanta@...
金田有二と申します。
5 messages
2009/10/02
[#39421] exception from open-uri — Yusuke ENDOH <mame@...>
遠藤です。
5 messages
2009/10/03
[#39439] [Bug #2179] 1.9.2において block のスコープがおかしいときがある — 益隆 三村 <redmine@...>
Bug #2179: 1.9.2において block のスコープがおかしいときがある
4 messages
2009/10/06
[#39446] Is the maintainer discharging rule approved? and about matrix.rb — Yugui <yugui@...>
Yuguiです。
4 messages
2009/10/08
[#39451] getaddrinfo: Name or service not known (SocketError) in net/ftp — Tanaka Akira <akr@...>
boron で気がついたのですが、net/ftp で login のときに
4 messages
2009/10/09
[#39469] Re: getaddrinfo: Name or service not known (SocketError) in net/ftp
— Shugo Maeda <shugo@...>
2009/10/12
前田です。
[#39453] [BUG: trunk] GC mark bug — SASADA Koichi <ko1@...>
ささだです.
7 messages
2009/10/10
[#39501] [bug:trunk] invalid memory access in 100**900 — Tanaka Akira <akr@...>
以下のように、100**900 を計算すると変なところをアクセスするようです。
4 messages
2009/10/17
[#39506] [Bug:1.9] case 文の式が省略され when 節に配列展開があるときの挙動 — wanabe <s.wanabe@...>
ワナベと申します。
4 messages
2009/10/17
[#39533] [Bug #2263] typo in man/ruby.1 — Narihiro Nakamura <redmine@...>
Bug #2263: typo in man/ruby.1
11 messages
2009/10/24
[#39534] Re: [Bug #2263] typo in man/ruby.1
— Yusuke ENDOH <mame@...>
2009/10/24
遠藤です。
[#39548] [Bug #2291] Net::FTPでソケットをオープンする前にbinary=を呼び出すと落ちる — Akira Matsuda <redmine@...>
Bug #2291: Net::FTPでソケットをオープンする前にbinary=を呼び出すと落ちる
10 messages
2009/10/27
[#39578] [Bug #2308] セーフレベル1の場合、Net::IMAPでSecurityErrorが発生する — Nozomu Kurasawa <redmine@...>
Bug #2308: セーフレベル1の場合、Net::IMAPでSecurityErrorが発生する
5 messages
2009/10/30
[#39579] [Bug #2310] should ensure GVL_UNLOCK_END in rb_thread_blocking_region — _ wanabe <redmine@...>
Bug #2310: should ensure GVL_UNLOCK_END in rb_thread_blocking_region
4 messages
2009/10/30
[#39584] Re: [ruby-cvs:32774] Ruby:r25556 (trunk): * array.c (rb_ary_to_ary): do not use #respond_to? to detect — Nobuyoshi Nakada <nobu@...>
なかだです。
6 messages
2009/10/30
[#39585] Re: [ruby-cvs:32774] Ruby:r25556 (trunk): * array.c (rb_ary_to_ary): do not use #respond_to? to detect
— Yukihiro Matsumoto <matz@...>
2009/10/30
まつもと ゆきひろです
[#39589] Re: [ruby-cvs:32774] Ruby:r25556 (trunk): * array.c (rb_ary_to_ary): do not use #respond_to? to detect
— Yukihiro Matsumoto <matz@...>
2009/10/30
まつもと ゆきひろです
[#39591] Re: [ruby-cvs:32774] Ruby:r25556 (trunk): * array.c (rb_ary_to_ary): do not use #respond_to? to detect
— Nobuyoshi Nakada <nobu@...>
2009/10/30
なかだです。
[#39592] infinite recursive call to C function — Yusuke ENDOH <mame@...>
遠藤です。
17 messages
2009/10/30
[#39596] Re: infinite recursive call to C function
— Yukihiro Matsumoto <matz@...>
2009/10/30
まつもと ゆきひろです
[#39599] Re: infinite recursive call to C function
— Nobuyoshi Nakada <nobu@...>
2009/11/02
なかだです。
[#39601] Re: infinite recursive call to C function
— Yukihiro Matsumoto <matz@...>
2009/11/02
まつもと ゆきひろです
[#39602] Re: infinite recursive call to C function
— Nobuyoshi Nakada <nobu@...>
2009/11/02
なかだです。
[#39603] Re: infinite recursive call to C function
— Yukihiro Matsumoto <matz@...>
2009/11/02
まつもと ゆきひろです
[#39605] Re: infinite recursive call to C function
— Nobuyoshi Nakada <nobu@...>
2009/11/02
なかだです。
[#39608] Re: infinite recursive call to C function
— Yukihiro Matsumoto <matz@...>
2009/11/02
まつもと ゆきひろです
[#39609] Re: infinite recursive call to C function
— Nobuyoshi Nakada <nobu@...>
2009/11/02
なかだです。
[#39610] Re: infinite recursive call to C function
— Yukihiro Matsumoto <matz@...>
2009/11/02
まつもと ゆきひろです
[ruby-dev:39448] Re: coverage and ensure
From:
Yusuke ENDOH <mame@...>
Date:
2009-10-08 16:03:44 UTC
List:
ruby-dev #39448
遠藤です。
2009年9月11日1:51 Tanaka Akira <akr@fsij.org>:
> coverage で、ensure 節内の文が数えられない気がします。
>
> % cat z.rb
> begin
> p 1
> ensure
> p 2
> end
> % ./ruby -rcoverage -ve '
> Coverage.start
> load "z.rb"
> p Coverage.result
> '
> ruby 1.9.2dev (2009-09-10 trunk 24826) [i686-linux]
> 1
> 2
> {"z.rb"=>[1, 1, nil, 0, nil]}
ものすごく遅くなってすみません。
p "foo"; p "bar" のような複文のある行に対して実行回数を重複して数える
のを避けるために、同じ行に対するカバレッジのイベントを 1 回しか挿入
しないようにしていたのですが、ensure の中身は例外が起きた場合と通常
終了した場合にコードがコピーされるため、複数個のカバレッジイベントを
挿入する必要がありました。
どうするか悩んだのですが、同じ行を「連続して」コンパイルする場合に、
1 回だけカバレッジイベントを発生するようにしてみました。
とりあえずこの方法で対処して、問題が見つかったら考えようと思います。
Index: iseq.c
===================================================================
--- iseq.c (revision 25260)
+++ iseq.c (working copy)
@@ -249,6 +249,7 @@
iseq->compile_data->storage_head->buff =
(char *)(&iseq->compile_data->storage_head->buff + 1);
iseq->compile_data->option = option;
+ iseq->compile_data->last_coverable_line = -1;
set_relation(iseq, parent);
Index: iseq.h
===================================================================
--- iseq.h (revision 25260)
+++ iseq.h (working copy)
@@ -82,6 +82,7 @@
struct iseq_compile_data_storage *storage_head;
struct iseq_compile_data_storage *storage_current;
int last_line;
+ int last_coverable_line;
int flip_cnt;
int label_no;
int node_level;
Index: compile.c
===================================================================
--- compile.c (revision 25260)
+++ compile.c (working copy)
@@ -223,8 +223,9 @@
#define ADD_TRACE(seq, line, event) \
do { \
if ((event) == RUBY_EVENT_LINE && iseq->coverage && \
- RARRAY_PTR(iseq->coverage)[(line) - 1] == Qnil) { \
+ (line) != iseq->compile_data->last_coverable_line) { \
RARRAY_PTR(iseq->coverage)[(line) - 1] = INT2FIX(0); \
+ iseq->compile_data->last_coverable_line = (line); \
ADD_INSN1(seq, line, trace, INT2FIX(RUBY_EVENT_COVERAGE)); \
} \
if (iseq->compile_data->option->trace_instruction) { \
--
Yusuke ENDOH <mame@tsg.ne.jp>