<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/missing, branch v4.0.2</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Fix a possible memory leak in dtoa</title>
<updated>2025-12-24T05:05:41+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-12-24T02:30:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=44693ee32990fdd609e91ebb2970b3110b3f08e5'/>
<id>44693ee32990fdd609e91ebb2970b3110b3f08e5</id>
<content type='text'>
Fix GH-15061
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix GH-15061
</pre>
</div>
</content>
</entry>
<entry>
<title>dtoa.c: Check integer underflow</title>
<updated>2025-09-10T07:45:25+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-09-10T03:57:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=624538ba927b3d5fa021af0df3c8c29b11ef14f7'/>
<id>624538ba927b3d5fa021af0df3c8c29b11ef14f7</id>
<content type='text'>
Reported at https://hackerone.com/reports/3288162

This underflow does not occur in Ruby because:

* This function is `static` and not accessible other than from ruby
  internal.

* Ruby uses mode 0 when calling this function directly.

* For `%f` in vsnprintf.c using mode 3, this parameter comes from the
  precision, but negative precision is meaningless and ignored.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reported at https://hackerone.com/reports/3288162

This underflow does not occur in Ruby because:

* This function is `static` and not accessible other than from ruby
  internal.

* Ruby uses mode 0 when calling this function directly.

* For `%f` in vsnprintf.c using mode 3, this parameter comes from the
  precision, but negative precision is meaningless and ignored.
</pre>
</div>
</content>
</entry>
<entry>
<title>dtoa.c: Check memory allocation failures</title>
<updated>2025-09-10T06:34:30+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-09-09T15:52:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f047174cf16c42843807c8430d18a83d2aa6175e'/>
<id>f047174cf16c42843807c8430d18a83d2aa6175e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>dtoa.c: Extract macro to update 5powers Bigint cache atomically</title>
<updated>2025-09-10T06:34:30+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-09-09T15:26:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d0c966adcd8cd04830e75c6b720c0c38427b3419'/>
<id>d0c966adcd8cd04830e75c6b720c0c38427b3419</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>dtoa.c: Add shortcut if arguments are zero</title>
<updated>2025-09-10T06:34:29+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-09-09T15:23:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0887d82406c9a9701acd235e8f510480cea9f218'/>
<id>0887d82406c9a9701acd235e8f510480cea9f218</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove spinlock in dtoa's Balloc, use xmalloc</title>
<updated>2025-04-07T23:56:44+00:00</updated>
<author>
<name>John Hawthorn</name>
<email>john@hawthorn.email</email>
</author>
<published>2025-03-27T01:23:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b3b1d7b2952037727abfa66236d43e434003524a'/>
<id>b3b1d7b2952037727abfa66236d43e434003524a</id>
<content type='text'>
The spinlock here performs poorly when there are multiple Ractors. The
improvement on single threaded performance doesn't seem that
significant, so I think we should just use malloc.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The spinlock here performs poorly when there are multiple Ractors. The
improvement on single threaded performance doesn't seem that
significant, so I think we should just use malloc.
</pre>
</div>
</content>
</entry>
<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>
</feed>
