Project

General

Profile

Bug #13982

Memory leak in Zlib.gunzip

Added by rhenium (Kazuki Yamaguchi) over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.5.0dev (2017-10-06 master 60128) [x86_64-linux]
[ruby-core:83162]

Description

Zlib.gunzip which was added in Ruby 2.4 seems to leak memory every time it is called.

$ ruby -rzlib -e'END{puts File.readlines("/proc/self/status").grep(/RSS/)}' -e'd=Zlib.gzip("data"); 100_000.times{Zlib.gunzip(d)}'
VmRSS:    829496 kB

Associated revisions

Revision b268da23
Added by nobu (Nobuyoshi Nakada) over 1 year ago

zlib.c: memory leak in gunzip

  • ext/zlib/zlib.c (zlib_gunzip): clear zstream to fix memory leak. [ruby-core:83162] [Bug #13982]

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

Revision 60130
Added by nobu (Nobuyoshi Nakada) over 1 year ago

zlib.c: memory leak in gunzip

  • ext/zlib/zlib.c (zlib_gunzip): clear zstream to fix memory leak. [ruby-core:83162] [Bug #13982]

Revision 60130
Added by nobu (Nobuyoshi Nakada) over 1 year ago

zlib.c: memory leak in gunzip

  • ext/zlib/zlib.c (zlib_gunzip): clear zstream to fix memory leak. [ruby-core:83162] [Bug #13982]

Revision 60130
Added by nobu (Nobuyoshi Nakada) over 1 year ago

zlib.c: memory leak in gunzip

  • ext/zlib/zlib.c (zlib_gunzip): clear zstream to fix memory leak. [ruby-core:83162] [Bug #13982]

Revision c560c7b1
Added by nobu (Nobuyoshi Nakada) over 1 year ago

zlib.c: ensure to free

  • ext/zlib/zlib.c (zlib_gunzip): gz0 is a structure variable on the stack, no longer valid after exit by an exception. ensure to free instead. [Bug #13982]

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

Revision 60131
Added by nobu (Nobuyoshi Nakada) over 1 year ago

zlib.c: ensure to free

  • ext/zlib/zlib.c (zlib_gunzip): gz0 is a structure variable on the stack, no longer valid after exit by an exception. ensure to free instead. [Bug #13982]

Revision 60131
Added by nobu (Nobuyoshi Nakada) over 1 year ago

zlib.c: ensure to free

  • ext/zlib/zlib.c (zlib_gunzip): gz0 is a structure variable on the stack, no longer valid after exit by an exception. ensure to free instead. [Bug #13982]

Revision 60131
Added by nobu (Nobuyoshi Nakada) over 1 year ago

zlib.c: ensure to free

  • ext/zlib/zlib.c (zlib_gunzip): gz0 is a structure variable on the stack, no longer valid after exit by an exception. ensure to free instead. [Bug #13982]

Revision ce2bc45a
Added by nagachika (Tomoyuki Chikanaga) about 1 year ago

merge revision(s) 60042,60130,60131: [Backport #13982]

ext: adjust indent [ci skip]

zlib.c: memory leak in gunzip

* ext/zlib/zlib.c (zlib_gunzip): clear zstream to fix memory leak.
  [ruby-core:83162] [Bug #13982]

zlib.c: ensure to free

* ext/zlib/zlib.c (zlib_gunzip): gz0 is a structure variable on
  the stack, no longer valid after exit by an exception.  ensure
  to free instead.  [Bug #13982]

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

Revision 62172
Added by nagachika (Tomoyuki Chikanaga) about 1 year ago

merge revision(s) 60042,60130,60131: [Backport #13982]

ext: adjust indent [ci skip]

zlib.c: memory leak in gunzip

* ext/zlib/zlib.c (zlib_gunzip): clear zstream to fix memory leak.
  [ruby-core:83162] [Bug #13982]

zlib.c: ensure to free

* ext/zlib/zlib.c (zlib_gunzip): gz0 is a structure variable on
  the stack, no longer valid after exit by an exception.  ensure
  to free instead.  [Bug #13982]

History

#1

Updated by nobu (Nobuyoshi Nakada) over 1 year ago

  • Status changed from Open to Closed

Applied in changeset trunk|r60130.


zlib.c: memory leak in gunzip

  • ext/zlib/zlib.c (zlib_gunzip): clear zstream to fix memory leak. [ruby-core:83162] [Bug #13982]

Updated by nagachika (Tomoyuki Chikanaga) about 1 year ago

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

ruby_2_4 r62172 merged revision(s) 60042,60130,60131.

Also available in: Atom PDF