Project

General

Profile

Actions

Bug #7591

closed

SEGV on sparc Solaris10 when Marshal.dump

Added by ngoto (Naohisa Goto) over 11 years ago. Updated over 11 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.0.0dev (2012-12-16) [sparc64-solaris2.10]
Backport:
[ruby-dev:46772]

Description

sparc Solaris10 上にて、Oracle Solaris Studio 12.3 にてデフォルトの最適化オプションである -O (-xO4 相当)を付けて make すると、rdoc作成時に Marshal.dump 内にて SEGV が発生します。make test-all すると、 TestMarshal が Failure になります。

marshal.c の marshal_dump および marshal_load 関数にて、変数 wrapper が最適化のためスタックに乗らないようで、w_object などの呼び出した先の関数の中で走ったGCによって消されてしまい、SEGVに至るようです。関数の最後のほうにある RB_GC_GUARD(wrapper) は効果が無いようです。

添付のパッチのように修正すると治りました。
添付のパッチ適用後は、関数末尾の RB_GC_GUARD(wrapper) は無くても動くようですが、念のため残しています。


Files

marshal-prevent-GC.patch (828 Bytes) marshal-prevent-GC.patch ngoto (Naohisa Goto), 12/19/2012 11:26 PM
Actions #1

Updated by ngoto (Naohisa Goto) over 11 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r38473.
Naohisa, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • marshal.c (marshal_dump, marshal_load): fix SEGV during make rdoc
    and test failure in TestMarshal#test_gc and test_context_switch
    on SPARC Solaris 10 compiled with Oracle Solaris Studio 12.3.
    [Bug #7591] [ruby-dev:46772]
Actions

Also available in: Atom PDF

Like0
Like0