Bug #4956

[PATCH] string.c (tr_s_bang): fix leak with heap strings

Added by Eric Wong about 4 years ago. Updated about 4 years ago.

[ruby-core:37708]
Status:Closed
Priority:Normal
Assignee:-
ruby -v:- Backport:

Description

Trivially reproduced with:

loop { "this string is too long to embed".tr_s!(" \t\r\n\f", " ") }

This also affects Ruby 1.9.2-p180

0001-string.c-tr_s_bang-fix-leak-with-heap-strings.patch Magnifier (757 Bytes) Eric Wong, 07/01/2011 11:21 AM

noname (500 Bytes) Aaron Patterson, 07/06/2011 05:59 AM

noname (500 Bytes) Aaron Patterson, 07/06/2011 07:23 AM

Associated revisions

Revision 32349
Added by Yui NARUSE about 4 years ago

  • string.c (tr_trans): free heap ptr when the str is not embeded. patched by Eric Wong. [Bug #4956]

Revision 32349
Added by Yui NARUSE about 4 years ago

  • string.c (tr_trans): free heap ptr when the str is not embeded. patched by Eric Wong. [Bug #4956]

History

#1 Updated by Yui NARUSE about 4 years ago

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

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


  • string.c (tr_trans): free heap ptr when the str is not embeded. patched by Eric Wong. [Bug #4956]

#2 Updated by Eric Wong about 4 years ago

Eric Wong normalperson@yhbt.net wrote:

This also affects Ruby 1.9.2-p180

Now this is in trunk, can we also get this backported to the 1.9.2
branch? Thanks!

#3 Updated by Aaron Patterson about 4 years ago

  • ruby -v changed from ruby 1.9.3dev (2011-07-01 trunk 32347) [x86_64-linux] to -

On Wed, Jul 06, 2011 at 04:46:44AM +0900, Eric Wong wrote:

Eric Wong normalperson@yhbt.net wrote:

This also affects Ruby 1.9.2-p180

Now this is in trunk, can we also get this backported to the 1.9.2
branch? Thanks!

I suggest opening a backport ticket to ease yugui's job:

http://redmine.ruby-lang.org/projects/ruby-192/issues?set_filter=1&tracker_id=4

--
Aaron Patterson
http://tenderlovemaking.com/

#4 Updated by Eric Wong about 4 years ago

Aaron Patterson aaron@tenderlovemaking.com wrote:

I suggest opening a backport ticket to ease yugui's job:

http://redmine.ruby-lang.org/projects/ruby-192/issues?set_filter=1&tracker_id=4

I've considered opening backport tickets in the past, but
http://redmine.ruby-lang.org/projects/ruby-192 says:

"Don't report issues here"

--
Eric Wong

#5 Updated by Aaron Patterson about 4 years ago

On Wed, Jul 06, 2011 at 06:29:24AM +0900, Eric Wong wrote:

Aaron Patterson aaron@tenderlovemaking.com wrote:

I suggest opening a backport ticket to ease yugui's job:

http://redmine.ruby-lang.org/projects/ruby-192/issues?set_filter=1&tracker_id=4

I've considered opening backport tickets in the past, but
http://redmine.ruby-lang.org/projects/ruby-192 says:

"Don't report issues here"

Ya, I think that should be worded like "Don't report bugs here" or
something. Whenever I commit things that need to be backported, I file
a ticket there so yugui knows the revisions I want backported so that
she doesn't have to review every commit to trunk.

--
Aaron Patterson
http://tenderlovemaking.com/

Also available in: Atom PDF