Project

General

Profile

Bug #13089

r57227 の変更ではリークが起きるようです

Added by metanest (Makoto Kishimoto) over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-dev:49930]

Description

きしもとです

手元の環境で、最新版(r57227 の変更以降)で、以下のような
スクリプトを実行しながら、topコマンドでインタプリタのプロセスを
見ていると、リークがあるようで、SIZE, RES がじりじりと増えて
ゆきます。

# fdiv_leak_sample

A = 0x4000_0000_0000_0000
B = 0x4000_0000_0000_0000

def f
  A.fdiv B
end

t = true

while t do
  f
  GC.start
end

r57227 は、計算前に約分するので、私が現在コードを書いている
変更とは相互に影響しないのですが(bignumの変更についても、
さきほどGitHubのほうにpushしました)、情報を失わないような
左シフトだけを使って実装することで、浮動小数点リテラルの
特異な場合(次を参照)、
https://practical-scheme.net/wiliki/wiliki.cgi?Gauche%3A%E6%B5%AE%E5%8B%95%E5%B0%8F%E6%95%B0%E7%82%B9%E6%95%B0%E3%82%92%E3%81%A9%E3%81%93%E3%81%BE%E3%81%A7%E8%AA%AD%E3%82%80%E3%81%8B
に対処する、というような応用にも使えるように改良することを
意図した改造を作業中なのですが、反対とかありますでしょうか?
(大きい数になるので、除算コストが大きい、というのは
あるかもしれません)

Associated revisions

Revision 994d13b9
Added by nobu (Nobuyoshi Nakada) over 2 years ago

rational.c: memory leak in gcd

  • rational.c (rb_gcd_gmp): fix memory leak. patched by KISHIMOTO, Makoto in [ruby-dev:49934]. [Bug #13089]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 57236
Added by nobu (Nobuyoshi Nakada) over 2 years ago

rational.c: memory leak in gcd

  • rational.c (rb_gcd_gmp): fix memory leak. patched by KISHIMOTO, Makoto in [ruby-dev:49934]. [Bug #13089]

Revision 57236
Added by nobu (Nobuyoshi Nakada) over 2 years ago

rational.c: memory leak in gcd

  • rational.c (rb_gcd_gmp): fix memory leak. patched by KISHIMOTO, Makoto in [ruby-dev:49934]. [Bug #13089]

Revision 57236
Added by nobu (Nobuyoshi Nakada) over 2 years ago

rational.c: memory leak in gcd

  • rational.c (rb_gcd_gmp): fix memory leak. patched by KISHIMOTO, Makoto in [ruby-dev:49934]. [Bug #13089]

Revision b232b1bb
Added by naruse (Yui NARUSE) over 2 years ago

merge revision(s) 57236: [Backport #13089]

    rational.c: memory leak in gcd

    * rational.c (rb_gcd_gmp): fix memory leak.  patched by KISHIMOTO,
      Makoto <ksmakoto AT dd.iij4u.or.jp> in [ruby-dev:49934].
      [Bug #13089]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@57846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 57846
Added by naruse (Yui NARUSE) over 2 years ago

merge revision(s) 57236: [Backport #13089]

rational.c: memory leak in gcd

* rational.c (rb_gcd_gmp): fix memory leak.  patched by KISHIMOTO,
  Makoto <ksmakoto AT dd.iij4u.or.jp> in [ruby-dev:49934].
  [Bug #13089]

Revision d53acd85
Added by usa (Usaku NAKAMURA) over 2 years ago

merge revision(s) 57236: [Backport #13089]

    rational.c: memory leak in gcd

    * rational.c (rb_gcd_gmp): fix memory leak.  patched by KISHIMOTO,
      Makoto <ksmakoto AT dd.iij4u.or.jp> in [ruby-dev:49934].
      [Bug #13089]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@58089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 58089
Added by usa (Usaku NAKAMURA) over 2 years ago

merge revision(s) 57236: [Backport #13089]

rational.c: memory leak in gcd

* rational.c (rb_gcd_gmp): fix memory leak.  patched by KISHIMOTO,
  Makoto <ksmakoto AT dd.iij4u.or.jp> in [ruby-dev:49934].
  [Bug #13089]

Revision 648ee72d
Added by nagachika (Tomoyuki Chikanaga) over 2 years ago

merge revision(s) 57236: [Backport #13089]

    rational.c: memory leak in gcd

    * rational.c (rb_gcd_gmp): fix memory leak.  patched by KISHIMOTO,
      Makoto <ksmakoto AT dd.iij4u.or.jp> in [ruby-dev:49934].
      [Bug #13089]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 58173
Added by nagachika (Tomoyuki Chikanaga) over 2 years ago

merge revision(s) 57236: [Backport #13089]

rational.c: memory leak in gcd

* rational.c (rb_gcd_gmp): fix memory leak.  patched by KISHIMOTO,
  Makoto <ksmakoto AT dd.iij4u.or.jp> in [ruby-dev:49934].
  [Bug #13089]

History

#1

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

  • Status changed from Open to Closed

Applied in changeset r57236.


rational.c: memory leak in gcd

  • rational.c (rb_gcd_gmp): fix memory leak. patched by KISHIMOTO, Makoto in [ruby-dev:49934]. [Bug #13089]

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

  • Backport changed from 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN to 2.2: REQUIRED, 2.3: REQUIRED, 2.4: REQUIRED
  • Description updated (diff)

Updated by naruse (Yui NARUSE) over 2 years ago

  • Backport changed from 2.2: REQUIRED, 2.3: REQUIRED, 2.4: REQUIRED to 2.2: REQUIRED, 2.3: REQUIRED, 2.4: DONE

ruby_2_4 r57846 merged revision(s) 57236.

Updated by usa (Usaku NAKAMURA) over 2 years ago

  • Backport changed from 2.2: REQUIRED, 2.3: REQUIRED, 2.4: DONE to 2.2: DONE, 2.3: REQUIRED, 2.4: DONE

ruby_2_2 r58089 merged revision(s) 57236.

Updated by nagachika (Tomoyuki Chikanaga) over 2 years ago

  • Backport changed from 2.2: DONE, 2.3: REQUIRED, 2.4: DONE to 2.2: DONE, 2.3: DONE, 2.4: DONE

ruby_2_3 r58173 merged revision(s) 57236.

Also available in: Atom PDF