<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/missing, branch ruby_3_4</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[Bug #20705] Update `strtod` implementation</title>
<updated>2024-10-05T14:29:42+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-09-05T13:08:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d17edf3a170b733356836353508319443d12c53c'/>
<id>d17edf3a170b733356836353508319443d12c53c</id>
<content type='text'>
The absence of either the integer or fractional part should be
allowed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The absence of either the integer or fractional part should be
allowed.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add comments in setproctitle.c</title>
<updated>2024-05-02T14:12:58+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2024-05-01T15:31:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e7d20623cbc6eb86c95357c344370cc39d29f8a3'/>
<id>e7d20623cbc6eb86c95357c344370cc39d29f8a3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Keep track of the originally allocated environ</title>
<updated>2024-05-02T14:12:58+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2024-05-01T15:15:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4f69d318b8667eb10596aaec9b75992a3265f66d'/>
<id>4f69d318b8667eb10596aaec9b75992a3265f66d</id>
<content type='text'>
We need to keep a pointer to the originally allocated environ because
adding more environment variables can cause it to be changed to something
else.

For example:

    100.times do |i|
      ENV["FOO#{i}"] = "1"
    end

Causes Valgrind to report:

    312 bytes in 1 blocks are definitely lost in loss record 9 of 13
      at 0x484D444: calloc (vg_replace_malloc.c:1340)
      by 0x1884F8: calloc1 (gc.c:1844)
      by 0x1884F8: objspace_xcalloc (gc.c:12202)
      by 0x1884F8: ruby_xcalloc_body (gc.c:12209)
      by 0x4204DD: ruby_init_setproctitle (setproctitle.c:119)
      by 0x27DDF4: ruby_process_options (ruby.c:3101)
      by 0x160BD1: ruby_options (eval.c:117)
      by 0x15B96E: rb_main (main.c:40)
      by 0x15B96E: main (main.c:59)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We need to keep a pointer to the originally allocated environ because
adding more environment variables can cause it to be changed to something
else.

For example:

    100.times do |i|
      ENV["FOO#{i}"] = "1"
    end

Causes Valgrind to report:

    312 bytes in 1 blocks are definitely lost in loss record 9 of 13
      at 0x484D444: calloc (vg_replace_malloc.c:1340)
      by 0x1884F8: calloc1 (gc.c:1844)
      by 0x1884F8: objspace_xcalloc (gc.c:12202)
      by 0x1884F8: ruby_xcalloc_body (gc.c:12209)
      by 0x4204DD: ruby_init_setproctitle (setproctitle.c:119)
      by 0x27DDF4: ruby_process_options (ruby.c:3101)
      by 0x160BD1: ruby_options (eval.c:117)
      by 0x15B96E: rb_main (main.c:40)
      by 0x15B96E: main (main.c:59)
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix leak reported by Valgrind when setting environment variables</title>
<updated>2024-05-01T12:54:45+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2024-04-30T21:22:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d1f14bafb06862e4095aea4598c7625368f6af24'/>
<id>d1f14bafb06862e4095aea4598c7625368f6af24</id>
<content type='text'>
The call to setenv replaces the string in the environ array, which causes
the original string to be reported as a memory leak.

This commit allocates another copy of environ called alloc_environ that
contains the strings allocated by ruby_init_setproctitle. Then in
ruby_free_proctitle it frees all the strings in alloc_environ.

For example:

    ENV.each { |k, v| ENV[k] = v.dup }

Valgrind reports:

    3,321 bytes in 39 blocks are definitely lost in loss record 3 of 3
      at 0x484884F: malloc (vg_replace_malloc.c:393)
      by 0x25CB5B: objspace_xmalloc0 (gc.c:11972)
      by 0x40344E: ruby_strdup (util.c:540)
      by 0x59C854: ruby_init_setproctitle (setproctitle.c:143)
      by 0x38CC44: ruby_process_options (ruby.c:3101)
      by 0x234DB1: ruby_options (eval.c:117)
      by 0x15B92E: rb_main (main.c:40)
      by 0x15B92E: main (main.c:59)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The call to setenv replaces the string in the environ array, which causes
the original string to be reported as a memory leak.

This commit allocates another copy of environ called alloc_environ that
contains the strings allocated by ruby_init_setproctitle. Then in
ruby_free_proctitle it frees all the strings in alloc_environ.

For example:

    ENV.each { |k, v| ENV[k] = v.dup }

Valgrind reports:

    3,321 bytes in 39 blocks are definitely lost in loss record 3 of 3
      at 0x484884F: malloc (vg_replace_malloc.c:393)
      by 0x25CB5B: objspace_xmalloc0 (gc.c:11972)
      by 0x40344E: ruby_strdup (util.c:540)
      by 0x59C854: ruby_init_setproctitle (setproctitle.c:143)
      by 0x38CC44: ruby_process_options (ruby.c:3101)
      by 0x234DB1: ruby_options (eval.c:117)
      by 0x15B92E: rb_main (main.c:40)
      by 0x15B92E: main (main.c:59)
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix ruby_free_proctitle</title>
<updated>2024-01-12T21:13:42+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2024-01-12T20:32:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=206388b19eb3e1d98ee77821a96705c97c86eb06'/>
<id>206388b19eb3e1d98ee77821a96705c97c86eb06</id>
<content type='text'>
It is undefined behaviour to free environ as it is managed by the system.
This caused RUBY_FREE_AT_EXIT to double free on systems like Linux. This
commit changes it to only free orig_environ, which is enough to make
both Valgrind and macOS leaks tools to not detect memory leaks.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is undefined behaviour to free environ as it is managed by the system.
This caused RUBY_FREE_AT_EXIT to double free on systems like Linux. This
commit changes it to only free orig_environ, which is enough to make
both Valgrind and macOS leaks tools to not detect memory leaks.
</pre>
</div>
</content>
</entry>
<entry>
<title>Free environ when RUBY_FREE_AT_EXIT</title>
<updated>2024-01-11T15:09:53+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2024-01-09T18:17:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=057df4379f856a868f588cdc769f397f5739983d'/>
<id>057df4379f856a868f588cdc769f397f5739983d</id>
<content type='text'>
The environ is malloc'd, so it gets reported as a memory leak. This
commit adds ruby_free_proctitle which frees it during shutdown when
RUBY_FREE_AT_EXIT is set.

    STACK OF 1 INSTANCE OF 'ROOT LEAK: &lt;calloc in ruby_init_setproctitle&gt;':
    5   dyld                                  0x18b7090e0 start + 2360
    4   ruby                                  0x10000e3a8 main + 100  main.c:58
    3   ruby                                  0x1000b4dfc ruby_options + 180  eval.c:121
    2   ruby                                  0x1001c5f70 ruby_process_options + 200  ruby.c:3014
    1   ruby                                  0x10035c9fc ruby_init_setproctitle + 76  setproctitle.c:105
    0   libsystem_malloc.dylib                0x18b8c7b78 _malloc_zone_calloc_instrumented_or_legacy + 100
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The environ is malloc'd, so it gets reported as a memory leak. This
commit adds ruby_free_proctitle which frees it during shutdown when
RUBY_FREE_AT_EXIT is set.

    STACK OF 1 INSTANCE OF 'ROOT LEAK: &lt;calloc in ruby_init_setproctitle&gt;':
    5   dyld                                  0x18b7090e0 start + 2360
    4   ruby                                  0x10000e3a8 main + 100  main.c:58
    3   ruby                                  0x1000b4dfc ruby_options + 180  eval.c:121
    2   ruby                                  0x1001c5f70 ruby_process_options + 200  ruby.c:3014
    1   ruby                                  0x10035c9fc ruby_init_setproctitle + 76  setproctitle.c:105
    0   libsystem_malloc.dylib                0x18b8c7b78 _malloc_zone_calloc_instrumented_or_legacy + 100
</pre>
</div>
</content>
</entry>
<entry>
<title>Free everything at shutdown</title>
<updated>2023-12-07T20:52:35+00:00</updated>
<author>
<name>Adam Hess</name>
<email>adamhess1991@gmail.com</email>
</author>
<published>2023-10-12T18:15:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6816e8efcff3be75f8020cd1b0ea57d3cd664bbc'/>
<id>6816e8efcff3be75f8020cd1b0ea57d3cd664bbc</id>
<content type='text'>
when the RUBY_FREE_ON_SHUTDOWN environment variable is set, manually free memory at shutdown.

Co-authored-by: Nobuyoshi Nakada &lt;nobu@ruby-lang.org&gt;
Co-authored-by: Peter Zhu &lt;peter@peterzhu.ca&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
when the RUBY_FREE_ON_SHUTDOWN environment variable is set, manually free memory at shutdown.

Co-authored-by: Nobuyoshi Nakada &lt;nobu@ruby-lang.org&gt;
Co-authored-by: Peter Zhu &lt;peter@peterzhu.ca&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Dump backtraces to an arbitrary stream when using libprocstat</title>
<updated>2023-09-26T00:02:37+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-09-26T00:02:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5eef125afe0c2b02dd4fc92a393bad95768fd330'/>
<id>5eef125afe0c2b02dd4fc92a393bad95768fd330</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove duplicate `#include &lt;string.h&gt;` [ci skip]</title>
<updated>2023-08-27T14:21:20+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-08-27T14:21:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=78c5bb1136f7db559f14ba44eb04503b1493672d'/>
<id>78c5bb1136f7db559f14ba44eb04503b1493672d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Make dtoa.c buildable alone</title>
<updated>2023-07-14T09:35:23+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-07-14T05:33:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=bc8cc68aeff7ae3be1353f4077633cda4d30b54b'/>
<id>bc8cc68aeff7ae3be1353f4077633cda4d30b54b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
