<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/ext/objspace/objspace_dump.c, branch v3_4_9</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>objspace_dump: Skip invalid CME when dumping CCs</title>
<updated>2026-03-07T05:17:15+00:00</updated>
<author>
<name>John Hawthorn</name>
<email>john@hawthorn.email</email>
</author>
<published>2026-02-10T02:39:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=153fa85994f3f06c93e2b10726c98b6f3b824225'/>
<id>153fa85994f3f06c93e2b10726c98b6f3b824225</id>
<content type='text'>
When a CC is invalidated only the klass field is set to 0. After it's
invalidated it isn't safe to access the CME, as it may have been freed.

I made a similar change in Ruby 4.0 in
640a2f1dc77c0ecf226dbd71cf7a1eb876a1f037, but assumed it was due to the
changes we'd made to callcaches making klass a weak-reference.

Co-authored-by: Christian Bruckmayer &lt;christian.bruckmayer@shopify.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When a CC is invalidated only the klass field is set to 0. After it's
invalidated it isn't safe to access the CME, as it may have been freed.

I made a similar change in Ruby 4.0 in
640a2f1dc77c0ecf226dbd71cf7a1eb876a1f037, but assumed it was due to the
changes we'd made to callcaches making klass a weak-reference.

Co-authored-by: Christian Bruckmayer &lt;christian.bruckmayer@shopify.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Prefix asan_poison_object with rb</title>
<updated>2024-12-19T14:14:34+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2024-12-18T17:01:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a58675386c10f4183116056bc0cf289548883ac0'/>
<id>a58675386c10f4183116056bc0cf289548883ac0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>objspace_dump: Use FILE* to avoid crashing in mark functions</title>
<updated>2024-12-09T21:08:35+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2024-12-07T03:49:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=476d655053b0e3ea447dc6549b821d18636c6603'/>
<id>476d655053b0e3ea447dc6549b821d18636c6603</id>
<content type='text'>
We observed crashes from rb_io_bufwrite() thread switching (through
rb_thread_check_ints()) in the middle of rb_execution_context_mark(). By
the time rb_execution_context_mark() gets a timeslice again, it read
garbage from a frame that was already popped in another thread, crashing
the process in SEGV. Other mark functions probably have their own ways
of breaking, but clearly, the usual IO code do too much for this
perilous pseudo GC context.

Use `FILE*` like before 5001cc47169614ea07d87651c95c2ee185e374e0
("Optimize ObjectSpace.dump_all"). Also, add type checking for
the private _dump methods.

Co-authored-by: Peter Zhu &lt;peter@peterzhu.ca&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We observed crashes from rb_io_bufwrite() thread switching (through
rb_thread_check_ints()) in the middle of rb_execution_context_mark(). By
the time rb_execution_context_mark() gets a timeslice again, it read
garbage from a frame that was already popped in another thread, crashing
the process in SEGV. Other mark functions probably have their own ways
of breaking, but clearly, the usual IO code do too much for this
perilous pseudo GC context.

Use `FILE*` like before 5001cc47169614ea07d87651c95c2ee185e374e0
("Optimize ObjectSpace.dump_all"). Also, add type checking for
the private _dump methods.

Co-authored-by: Peter Zhu &lt;peter@peterzhu.ca&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ObjectSpace.dump: handle Module#set_temporary_name</title>
<updated>2024-11-12T19:21:27+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2024-11-12T18:52:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ee1cd1656fc667840282a4e9c3f2cc5e3154e50e'/>
<id>ee1cd1656fc667840282a4e9c3f2cc5e3154e50e</id>
<content type='text'>
[Bug #20892]

Until the introduction of that method, it was impossible for a
Module name not to be valid JSON, hence it wasn't going through
the slower escaping function.

This assumption no longer hold.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Bug #20892]

Until the introduction of that method, it was impossible for a
Module name not to be valid JSON, hence it wasn't going through
the slower escaping function.

This assumption no longer hold.
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement chilled strings</title>
<updated>2024-03-19T08:26:49+00:00</updated>
<author>
<name>Étienne Barrié</name>
<email>etienne.barrie@gmail.com</email>
</author>
<published>2023-12-01T10:33:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=12be40ae6be78ac41e8e3f3c313cc6f63e7fa6c4'/>
<id>12be40ae6be78ac41e8e3f3c313cc6f63e7fa6c4</id>
<content type='text'>
[Feature #20205]

As a path toward enabling frozen string literals by default in the future,
this commit introduce "chilled strings". From a user perspective chilled
strings pretend to be frozen, but on the first attempt to mutate them,
they lose their frozen status and emit a warning rather than to raise a
`FrozenError`.

Implementation wise, `rb_compile_option_struct.frozen_string_literal` is
no longer a boolean but a tri-state of `enabled/disabled/unset`.

When code is compiled with frozen string literals neither explictly enabled
or disabled, string literals are compiled with a new `putchilledstring`
instruction. This instruction is identical to `putstring` except it marks
the String with the `STR_CHILLED (FL_USER3)` and `FL_FREEZE` flags.

Chilled strings have the `FL_FREEZE` flag as to minimize the need to check
for chilled strings across the codebase, and to improve compatibility with
C extensions.

Notes:
  - `String#freeze`: clears the chilled flag.
  - `String#-@`: acts as if the string was mutable.
  - `String#+@`: acts as if the string was mutable.
  - `String#clone`: copies the chilled flag.

Co-authored-by: Jean Boussier &lt;byroot@ruby-lang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Feature #20205]

As a path toward enabling frozen string literals by default in the future,
this commit introduce "chilled strings". From a user perspective chilled
strings pretend to be frozen, but on the first attempt to mutate them,
they lose their frozen status and emit a warning rather than to raise a
`FrozenError`.

Implementation wise, `rb_compile_option_struct.frozen_string_literal` is
no longer a boolean but a tri-state of `enabled/disabled/unset`.

When code is compiled with frozen string literals neither explictly enabled
or disabled, string literals are compiled with a new `putchilledstring`
instruction. This instruction is identical to `putstring` except it marks
the String with the `STR_CHILLED (FL_USER3)` and `FL_FREEZE` flags.

Chilled strings have the `FL_FREEZE` flag as to minimize the need to check
for chilled strings across the codebase, and to improve compatibility with
C extensions.

Notes:
  - `String#freeze`: clears the chilled flag.
  - `String#-@`: acts as if the string was mutable.
  - `String#+@`: acts as if the string was mutable.
  - `String#clone`: copies the chilled flag.

Co-authored-by: Jean Boussier &lt;byroot@ruby-lang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Move FL_SINGLETON to FL_USER1</title>
<updated>2024-03-06T18:11:41+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>byroot@ruby-lang.org</email>
</author>
<published>2024-03-06T16:04:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b4a69351ec7d6f0a5e34e3bb586053814be352c0'/>
<id>b4a69351ec7d6f0a5e34e3bb586053814be352c0</id>
<content type='text'>
This frees FL_USER0 on both T_MODULE and T_CLASS.

Note: prior to this, FL_SINGLETON was never set on T_MODULE,
so checking for `FL_SINGLETON` without first checking that
`FL_TYPE` was `T_CLASS` was valid. That's no longer the case.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This frees FL_USER0 on both T_MODULE and T_CLASS.

Note: prior to this, FL_SINGLETON was never set on T_MODULE,
so checking for `FL_SINGLETON` without first checking that
`FL_TYPE` was `T_CLASS` was valid. That's no longer the case.
</pre>
</div>
</content>
</entry>
<entry>
<title>objspace_dump.c: dump call cache ids with dump_append_id</title>
<updated>2023-11-22T09:24:35+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>byroot@ruby-lang.org</email>
</author>
<published>2023-11-22T08:16:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6391ae9ebc0b7a6668e57aa9f3c7b76ff83fab70'/>
<id>6391ae9ebc0b7a6668e57aa9f3c7b76ff83fab70</id>
<content type='text'>
Not all `ID` have an associated string.

Fixes a SEGFAULT in ObjectSpace.dump_all spec.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Not all `ID` have an associated string.

Fixes a SEGFAULT in ObjectSpace.dump_all spec.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Revert "Remove SHAPE_CAPACITY_CHANGE shapes""</title>
<updated>2023-11-13T23:26:36+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2023-11-10T21:17:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=68869e9bd921e4021a9ee8eee5a36377dd2b2a90'/>
<id>68869e9bd921e4021a9ee8eee5a36377dd2b2a90</id>
<content type='text'>
This reverts commit 5f3fb4f4e397735783743fe52a7899b614bece20.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 5f3fb4f4e397735783743fe52a7899b614bece20.
</pre>
</div>
</content>
</entry>
<entry>
<title>Record more info from CALLCACHE in heap dumps</title>
<updated>2023-11-13T23:03:11+00:00</updated>
<author>
<name>John Hawthorn</name>
<email>john@hawthorn.email</email>
</author>
<published>2023-10-13T17:31:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b41270842aae73bf59e17fb1d175a4ff557f0e87'/>
<id>b41270842aae73bf59e17fb1d175a4ff557f0e87</id>
<content type='text'>
This records the called_id and klass from imemo_callcache objects in
heap dumps.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This records the called_id and klass from imemo_callcache objects in
heap dumps.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Remove SHAPE_CAPACITY_CHANGE shapes"</title>
<updated>2023-11-10T16:27:49+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2023-11-10T16:27:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5f3fb4f4e397735783743fe52a7899b614bece20'/>
<id>5f3fb4f4e397735783743fe52a7899b614bece20</id>
<content type='text'>
This reverts commit f6910a61122931e4193bcc0fad18d839c319b720.

We're seeing crashes in the test suite of Shopify's core monolith after
this change.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit f6910a61122931e4193bcc0fad18d839c319b720.

We're seeing crashes in the test suite of Shopify's core monolith after
this change.
</pre>
</div>
</content>
</entry>
</feed>
