<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/objspace/test_ractor.rb, branch v3_2_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>merge revision(s) 7bd7aee02e303de27d2cddfc5ef47e612d6782cb: [Backport #18464]</title>
<updated>2023-06-25T06:20:43+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2023-06-25T06:20:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b422c3523c419b88c6da23a4022ae8864f411b84'/>
<id>b422c3523c419b88c6da23a4022ae8864f411b84</id>
<content type='text'>
	Fix interpreter crash caused by RUBY_INTERNAL_EVENT_NEWOBJ + Ractors

	When a Ractor is created whilst a tracepoint for
	RUBY_INTERNAL_EVENT_NEWOBJ is active, the interpreter crashes. This is
	because during the early setup of the Ractor, the stdio objects are
	created, which allocates Ruby objects, which fires the tracepoint.
	However, the tracepoint machinery tries to dereference the control frame
	(ec-&gt;cfp-&gt;pc), which isn't set up yet and so crashes with a null pointer
	dereference.

	Fix this by not firing GC tracepoints if cfp isn't yet set up.
	---
	 gc.c                         |  1 +
	 test/objspace/test_ractor.rb | 17 +++++++++++++++++
	 2 files changed, 18 insertions(+)
	 create mode 100644 test/objspace/test_ractor.rb
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Fix interpreter crash caused by RUBY_INTERNAL_EVENT_NEWOBJ + Ractors

	When a Ractor is created whilst a tracepoint for
	RUBY_INTERNAL_EVENT_NEWOBJ is active, the interpreter crashes. This is
	because during the early setup of the Ractor, the stdio objects are
	created, which allocates Ruby objects, which fires the tracepoint.
	However, the tracepoint machinery tries to dereference the control frame
	(ec-&gt;cfp-&gt;pc), which isn't set up yet and so crashes with a null pointer
	dereference.

	Fix this by not firing GC tracepoints if cfp isn't yet set up.
	---
	 gc.c                         |  1 +
	 test/objspace/test_ractor.rb | 17 +++++++++++++++++
	 2 files changed, 18 insertions(+)
	 create mode 100644 test/objspace/test_ractor.rb
</pre>
</div>
</content>
</entry>
</feed>
