<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git, branch v3_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>v3.3.4</title>
<updated>2024-07-08T23:28:22+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-07-08T23:28:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=be1089c8ec5ba40e09b1553e36b3174bf4014d9d'/>
<id>be1089c8ec5ba40e09b1553e36b3174bf4014d9d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) fc33559c: [Backport #20570]</title>
<updated>2024-07-08T23:08:42+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-07-08T23:08:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=17e21d815583ef7d6be03f29e90a219602497626'/>
<id>17e21d815583ef7d6be03f29e90a219602497626</id>
<content type='text'>
	clear `kw_flag` if given hash is nil

	https://bugs.ruby-lang.org/issues/20570 is caused I missed to
	clear the `kw_flag` even if `keyword_hash` is nil.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	clear `kw_flag` if given hash is nil

	https://bugs.ruby-lang.org/issues/20570 is caused I missed to
	clear the `kw_flag` even if `keyword_hash` is nil.
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 75aaeb35b82da26359b9418d2963384d0c55839c: [Backport #20239]</title>
<updated>2024-07-08T23:04:30+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-07-08T23:04:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=df8a08fb6a1f173a9c25db15fbe390096f39c2ff'/>
<id>df8a08fb6a1f173a9c25db15fbe390096f39c2ff</id>
<content type='text'>
	[Bug #20239] Fix overflow at down-casting
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[Bug #20239] Fix overflow at down-casting
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) fba8aff7, d8c6e91748871ab2287d7703347847fe18a292d2: [Backport #20592]</title>
<updated>2024-07-08T22:58:13+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-07-08T22:58:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9d583dd43a24354e8ae58c089cf091c1243e6e60'/>
<id>9d583dd43a24354e8ae58c089cf091c1243e6e60</id>
<content type='text'>
	[Bug #20592] Fix segfault when sending NULL to freeaddrinfo

	On alpine freeaddrinfo does not accept NULL pointer

	Fix dangling `else`
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[Bug #20592] Fix segfault when sending NULL to freeaddrinfo

	On alpine freeaddrinfo does not accept NULL pointer

	Fix dangling `else`
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 2dd46bb82ffc4dff01d7ea70922f0e407acafb4e: [Backport #20468]</title>
<updated>2024-07-08T22:55:17+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-07-08T22:55:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8a2e41d34b135046957e1195a5d4f4967a82a965'/>
<id>8a2e41d34b135046957e1195a5d4f4967a82a965</id>
<content type='text'>
	[Bug #20468] Fix safe navigation in `for` variable
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[Bug #20468] Fix safe navigation in `for` variable
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 01b13886: [Backport #20562]</title>
<updated>2024-07-08T22:42:06+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-07-08T22:42:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a40645e115e6cd6328bb302dfc78b16f6ad45938'/>
<id>a40645e115e6cd6328bb302dfc78b16f6ad45938</id>
<content type='text'>
	[Bug #20562] Categorize `RUBY_FREE_AT_EXIT` warning as experimental
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[Bug #20562] Categorize `RUBY_FREE_AT_EXIT` warning as experimental
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix malformed JSON in macOS CI</title>
<updated>2024-07-08T22:40:28+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-07-08T22:40:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9a8454ea5ca2bb4d6540d5c43b8e91e199ed1a8a'/>
<id>9a8454ea5ca2bb4d6540d5c43b8e91e199ed1a8a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Refine macOS CI (#11107)</title>
<updated>2024-07-05T15:13:11+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2024-07-05T15:13:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f811f79b3aa5d1fba3a9a631a802aa1d41fa5dc4'/>
<id>f811f79b3aa5d1fba3a9a631a802aa1d41fa5dc4</id>
<content type='text'>
Update macos runners with latest environments.

* Use macos-14 instead of macos-arm-oss
* Removed macos-11 and added macos-13</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update macos runners with latest environments.

* Use macos-14 instead of macos-arm-oss
* Removed macos-11 and added macos-13</pre>
</div>
</content>
</entry>
<entry>
<title>[Backport #11036] Add explicit compiler fence when pushing frames to ensure safe profiling (#11090)</title>
<updated>2024-07-03T16:56:00+00:00</updated>
<author>
<name>Ivo Anjo</name>
<email>ivo.anjo@datadoghq.com</email>
</author>
<published>2024-07-03T16:56:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b2be36ef3349ebdab5423ea3337c03bcc3319b60'/>
<id>b2be36ef3349ebdab5423ea3337c03bcc3319b60</id>
<content type='text'>
**What does this PR do?**

This PR tweaks the `vm_push_frame` function to add an explicit compiler
fence (`atomic_signal_fence`) to ensure profilers that use signals
to interrupt applications (stackprof, vernier, pf2, Datadog profiler)
can safely sample from the signal handler.

This is a backport of #11036 to Ruby 3.3 .

**Motivation:**

The `vm_push_frame` was specifically tweaked in
https://github.com/ruby/ruby/pull/3296 to initialize the a frame
before updating the `cfp` pointer.

But since there's nothing stopping the compiler from reordering
the initialization of a frame (`*cfp =`) with the update of the cfp
pointer (`ec-&gt;cfp = cfp`) we've been hesitant to rely on this on
the Datadog profiler.

In practice, after some experimentation + talking to folks, this
reordering does not seem to happen.

But since modern compilers have a way for us to exactly tell them
not to do the reordering (`atomic_signal_fence`), this seems even
better.

I've actually extracted `vm_push_frame` into the "Compiler Explorer"
website, which you can use to see the assembly output of this function
across many compilers and architectures: https://godbolt.org/z/3oxd1446K

On that link you can observe two things across many compilers:
1. The compilers are not reordering the writes
2. The barrier does not change the generated assembly output
   (== has no cost in practice)

**Additional Notes:**

The checks added in `configure.ac` define two new macros:
* `HAVE_STDATOMIC_H`
* `HAVE_DECL_ATOMIC_SIGNAL_FENCE`

Since Ruby generates an arch-specific `config.h` header with
these macros upon installation, this can be used by profilers
and other libraries to test if Ruby was compiled with the fence enabled.

**How to test the change?**

As I mentioned above, you can check https://godbolt.org/z/3oxd1446K
to confirm the compiled output of `vm_push_frame` does not change
in most compilers (at least all that I've checked on that site).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
**What does this PR do?**

This PR tweaks the `vm_push_frame` function to add an explicit compiler
fence (`atomic_signal_fence`) to ensure profilers that use signals
to interrupt applications (stackprof, vernier, pf2, Datadog profiler)
can safely sample from the signal handler.

This is a backport of #11036 to Ruby 3.3 .

**Motivation:**

The `vm_push_frame` was specifically tweaked in
https://github.com/ruby/ruby/pull/3296 to initialize the a frame
before updating the `cfp` pointer.

But since there's nothing stopping the compiler from reordering
the initialization of a frame (`*cfp =`) with the update of the cfp
pointer (`ec-&gt;cfp = cfp`) we've been hesitant to rely on this on
the Datadog profiler.

In practice, after some experimentation + talking to folks, this
reordering does not seem to happen.

But since modern compilers have a way for us to exactly tell them
not to do the reordering (`atomic_signal_fence`), this seems even
better.

I've actually extracted `vm_push_frame` into the "Compiler Explorer"
website, which you can use to see the assembly output of this function
across many compilers and architectures: https://godbolt.org/z/3oxd1446K

On that link you can observe two things across many compilers:
1. The compilers are not reordering the writes
2. The barrier does not change the generated assembly output
   (== has no cost in practice)

**Additional Notes:**

The checks added in `configure.ac` define two new macros:
* `HAVE_STDATOMIC_H`
* `HAVE_DECL_ATOMIC_SIGNAL_FENCE`

Since Ruby generates an arch-specific `config.h` header with
these macros upon installation, this can be used by profilers
and other libraries to test if Ruby was compiled with the fence enabled.

**How to test the change?**

As I mentioned above, you can check https://godbolt.org/z/3oxd1446K
to confirm the compiled output of `vm_push_frame` does not change
in most compilers (at least all that I've checked on that site).</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug #20598] Fix corruption of internal encoding string (#11069)</title>
<updated>2024-06-28T20:04:49+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2024-06-28T20:04:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=291cc913503475a204c93a53a2f470c8cc6bfca2'/>
<id>291cc913503475a204c93a53a2f470c8cc6bfca2</id>
<content type='text'>
Fix corruption of internal encoding string

[Bug #20598]

Just like [Bug #20595], Encoding#name_list and Encoding#aliases can have
their strings corrupted when Encoding.default_internal is set to nil.

Co-authored-by: Matthew Valentine-House &lt;matt@eightbitraptor.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix corruption of internal encoding string

[Bug #20598]

Just like [Bug #20595], Encoding#name_list and Encoding#aliases can have
their strings corrupted when Encoding.default_internal is set to nil.

Co-authored-by: Matthew Valentine-House &lt;matt@eightbitraptor.com&gt;</pre>
</div>
</content>
</entry>
</feed>
