Project

General

Profile

Actions

Bug #1679

closed

rb_w32_getenv() invalidates previous environment pointers

Added by jeremi_tu (Jarek Jurasz) almost 15 years ago. Updated almost 13 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]
Backport:
[ruby-core:23983]

Description

=begin
On Windows turning on page heap (gflags -p /enable ruby.exe /full) revealed that environment pointers returned by rb_w32_getenv() get invalidated on the next call to this function due to the freeing of the environment buffer.
In particular getenv("RUBYLIB_PREFIX") in rubylib_mangle() frees getenv("RUBYLIB") fetched in ruby_init_loadpath(). This bug is also present in ruby 1.9.1-p129.

The workaround - the RTL version of getenv() - worked fine for me so far.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0