[#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:39432] Re: Marshal.load で例外発生時に Segmentation faultエラー
From:
patamanta@...
Date:
2009-10-04 12:11:21 UTC
List:
ruby-dev #39432
田中さま。
お世話になっております。金田です。
最新版のスナップショットであるruby-1.8 (ruby 1.8.8dev (2009-10-02))でも試してみました。
先の提示したコードでは問題ありませんでした。
また、微妙に変化させたコードでやはりcore dumpが発生しました。
コメント行の有無でcore dumpしたり
しなかったりするようですので、
スタックの微妙な状態に依存しているように思えます。
core dumpとなったコード
---
#! /usr/local/bin/ruby
GC.stress = true
loop do
begin
f = File.open("d")
Marshal.load("")
rescue
end
end
--
$ ./ruby marshal_error.rb
marshal_error.rb:6: [BUG] Segmentation fault
ruby 1.8.8dev (2009-10-02) [x86_64-linux]
$ gdb ./ruby core.11520
GNU gdb Fedora (6.8-27.el5)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu"...
Reading symbols from /lib64/librt.so.1...done.
Loaded symbols for /lib64/librt.so.1
Reading symbols from /lib64/libdl.so.2...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/libcrypt.so.1...done.
Loaded symbols for /lib64/libcrypt.so.1
Reading symbols from /lib64/libm.so.6...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /lib64/libc.so.6...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/libpthread.so.0...done.
Loaded symbols for /lib64/libpthread.so.0
Reading symbols from /lib64/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Core was generated by `./ruby marshal_error.rb'.
Program terminated with signal 6, Aborted.
[New process 11520]
#0 0x0000003131030215 in raise () from /lib64/libc.so.6
(gdb) bt
#0 0x0000003131030215 in raise () from /lib64/libc.so.6
#1 0x0000003131031cc0 in abort () from /lib64/libc.so.6
#2 0x000000000049b478 in rb_bug (fmt=0x4b7d6d "Segmentation fault") at error.c:213
#3 0x000000000047155a in sigsegv (sig=<value optimized out>) at signal.c:634
#4 <signal handler called>
#5 0x0000000000473e1d in st_foreach (table=0x42d8db, func=0x42eac0 <mark_entry>, arg=0) at
st.c:486
#6 0x000000000042eb91 in mark_locations_array (x=0x7fffeac84b90, n=1920) at gc.c:708
#7 0x000000000042ece2 in garbage_collect () at gc.c:1505
#8 0x000000000042f7b9 in rb_newobj () at gc.c:453
#9 0x00000000004755f9 in str_alloc (klass=4380891) at string.c:67
#10 0x00000000004756f9 in str_new3 (klass=4380891, str=4385472) at string.c:143
#11 0x0000000000475746 in rb_str_new3 (str=47703126413440) at string.c:157
#12 0x00000000004165b1 in rb_eval (self=47703126553240, n=<value optimized out>) at eval.c:3
926
#13 0x0000000000416c20 in rb_eval (self=47703126553240, n=<value optimized out>) at eval.c:3
550
#14 0x00000000004187b1 in rb_eval (self=47703126553240, n=<value optimized out>) at eval.c:3
369
#15 0x0000000000426b55 in rb_yield_0 (val=6, self=47703126553240, klass=0,
flags=<value optimized out>, avalue=0) at eval.c:5154
#16 0x0000000000428067 in loop_i () at eval.c:5286
#17 0x0000000000410bc4 in rb_rescue2 (b_proc=0x428050 <loop_i>, data1=0, r_proc=0, data2=0)
at eval.c:5550
#18 0x0000000000410da0 in rb_f_loop () at eval.c:5311
#19 0x000000000041a5d6 in rb_call0 (klass=47703126563120, recv=47703126553240, id=4129, oid=
4129,
argc=32767, argv=0x0, body=0x2b62bfe99b78, flags=<value optimized out>) at eval.c:5990
#20 0x000000000041b3e8 in rb_call (klass=47703126563120, recv=47703126553240, mid=4129, argc
=0,
argv=0x0, scope=1, self=47703126553240) at eval.c:6241
#21 0x0000000000416dcb in rb_eval (self=<value optimized out>, n=<value optimized out>)
at eval.c:3570
#22 0x0000000000419149 in rb_eval (self=47703126553240, n=<value optimized out>) at eval.c:3
283
#23 0x00000000004285e5 in ruby_exec_internal () at eval.c:1688
#24 0x0000000000428605 in ruby_exec () at eval.c:1711
#25 0x000000000042862f in ruby_run () at eval.c:1721
#26 0x000000000040deb3 in main (argc=2, argv=0x7fffeac86638) at main.c:48
----- Original Message -----
送信者: Tanaka Akira<akr@fsij.org>
宛先: ruby-dev@ruby-lang.org
日付:Sunday, October, 04, 2009, 08:30 PM
件名: [ruby-dev:39431] Re: Marshal.load で例外発生時に Segmentation faultエラー
>
>
> In article <20091002182909.54020.qmail@mail.goo.ne.jp>,
> patamanta@mail.goo.ne.jp writes:
>
> > ---
> > #! /usr/local/bin/ruby
> > GC.stress = true
> > loop do
> > begin
> > f = File.open("d")
> > Marshal.load(f)
> > rescue
> > end
> > end
> > ---
> > # dは空のファイルです。
> >
> > ざっとソースをみたところ marshal.c の 1480 行目で r_byte 関数を呼び出して
> > 864行目で rb_eof_error で例外を発生させたあたりでエラーとなっているようです。
> > おそらく、1478行目でスタック上の作成した arg.wrapper オブジェクトを
> > GCが発生した際に適切に mark できなかったようにみえます。
>
> これも直ったんじゃいないかなぁ。
> --
> [田中 哲][たなか あきら][Tanaka Akira]
>
>