Project

General

Profile

Backport #7754

Backport file.c (realpath_rec) GC fix to 1.9.3

Added by jschneiderhan (Jon-Erik Schneiderhan) over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:51738]

Description

I'm hitting a problem with ruby-1.9.3-p327 and ruby-1.9.3-p374 that I tracked down with gdb to the realpath_rec method in file.c. The behavior I am seeing is that the char array pointed at by link_names is written over if GC runs in subsequent calls to realpath_rec.

It turns out the issue has already been resolved in trunk:

https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/37174/diff/file.c

I was wondering if this could be backported to 1.9.3.


Files

file.c.patch (1.03 KB) file.c.patch jschneiderhan (Jon-Erik Schneiderhan), 01/30/2013 03:57 AM

Associated revisions

Revision 326ce405
Added by usa (Usaku NAKAMURA) over 6 years ago

merge revision(s) 37174: [Backport #7754]

    * file.c (realpath_rec): prevent link from GC while link_names refers
      the content.

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

Revision 39092
Added by usa (Usaku NAKAMURA) over 6 years ago

merge revision(s) 37174: [Backport #7754]

* file.c (realpath_rec): prevent link from GC while link_names refers
  the content.

History

Updated by luislavena (Luis Lavena) over 6 years ago

  • Status changed from Open to Assigned
  • Assignee set to usa (Usaku NAKAMURA)
#2

Updated by usa (Usaku NAKAMURA) over 6 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport193
  • Category deleted (core)
  • Target version deleted (1.9.3)
#3

Updated by usa (Usaku NAKAMURA) over 6 years ago

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

This issue was solved with changeset r39092.
Jon-Erik, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 37174: [Backport #7754]

* file.c (realpath_rec): prevent link from GC while link_names refers
  the content.

Also available in: Atom PDF