<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/thread.c, branch v3_3_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[3.3] Fix deadlock on th-&gt;interrupt_lock after fork</title>
<updated>2026-02-05T06:48:56+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2026-02-04T12:12:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=91f0a5a11006d7d6ba72c4d9128ae909c3adaaf8'/>
<id>91f0a5a11006d7d6ba72c4d9128ae909c3adaaf8</id>
<content type='text'>
[Bug #21860]

If a thread was holding this lock before fork, it will not exist in the
child process. We should re-initialize these locks as we do with the VM
locks when forking.

Co-Authored-By: John Hawthorn &lt;john@hawthorn.email&gt;
Co-authored-by: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Bug #21860]

If a thread was holding this lock before fork, it will not exist in the
child process. We should re-initialize these locks as we do with the VM
locks when forking.

Co-Authored-By: John Hawthorn &lt;john@hawthorn.email&gt;
Co-authored-by: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 62430c19c9f1ab49429cebe65f30588472648c95: [Backport #21342]</title>
<updated>2025-10-05T10:10:48+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2025-10-05T10:10:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=05f93fe6dc6f99fd2f728dd3c85dca944f1f4ba1'/>
<id>05f93fe6dc6f99fd2f728dd3c85dca944f1f4ba1</id>
<content type='text'>
	Message not found for revision: 62430c19c9f1ab49429cebe65f30588472648c95
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Message not found for revision: 62430c19c9f1ab49429cebe65f30588472648c95
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 0d6263bd416338a339651fb97fe4d62701704c4b: [Backport #21220]</title>
<updated>2025-05-17T06:21:08+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2025-05-17T06:21:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b1b6752fbeb2d23dbea639bd4b331c9e8b56f49c'/>
<id>b1b6752fbeb2d23dbea639bd4b331c9e8b56f49c</id>
<content type='text'>
	Fix coverage measurement for negative line numbers

	Fixes [Bug #21220]

	Co-Authored-By: Mike Bourgeous &lt;mike@mikebourgeous.com&gt;
	Co-Authored-By: Jean Boussier &lt;jean.boussier@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Fix coverage measurement for negative line numbers

	Fixes [Bug #21220]

	Co-Authored-By: Mike Bourgeous &lt;mike@mikebourgeous.com&gt;
	Co-Authored-By: Jean Boussier &lt;jean.boussier@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Ensure fiber scheduler is woken up when close interrupts read</title>
<updated>2024-09-23T16:25:10+00:00</updated>
<author>
<name>KJ Tsanaktsidis</name>
<email>ktsanaktsidis@zendesk.com</email>
</author>
<published>2024-09-13T07:40:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5b6009870dff883a8e71a05e60f175cea1d00d55'/>
<id>5b6009870dff883a8e71a05e60f175cea1d00d55</id>
<content type='text'>
If one thread is reading and another closes that socket, the close
blocks waiting for the read to abort cleanly. This ensures that Ruby is
totally done with the file descriptor _BEFORE_ we tell the OS to close
and potentially re-use it.

When the read is correctly terminated, the close should be unblocked.
That currently works if closing is happening on a thread, but if it's
happening on a fiber with a fiber scheduler, it does NOT work.

This patch ensures that if the close happened in a fiber scheduled
thread, that the scheduler is notified that the fiber is unblocked.

[Bug #20723]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If one thread is reading and another closes that socket, the close
blocks waiting for the read to abort cleanly. This ensures that Ruby is
totally done with the file descriptor _BEFORE_ we tell the OS to close
and potentially re-use it.

When the read is correctly terminated, the close should be unblocked.
That currently works if closing is happening on a thread, but if it's
happening on a fiber with a fiber scheduler, it does NOT work.

This patch ensures that if the close happened in a fiber scheduled
thread, that the scheduler is notified that the fiber is unblocked.

[Bug #20723]
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 055613fd868a8c94e43893f8c58a00cdd2a81f6d,127d7a35df10ee2bc99f44b888972b2c5361d84f,e2a9b87126d59e4766479a7aa12cf7a648f46506: [Backport #20447]</title>
<updated>2024-05-30T18:13:15+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-05-30T18:13:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b13cf49036f0a454063cde25807785adc00f8995'/>
<id>b13cf49036f0a454063cde25807785adc00f8995</id>
<content type='text'>
	Fix pointer incompatiblity

	Since the subsecond part is discarded, WIDEVAL to VALUE conversion is
	needed.

	Some functions are not used when `THREAD_MODEL=none`

	`rb_thread_sched_destroy` is not used now at all
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Fix pointer incompatiblity

	Since the subsecond part is discarded, WIDEVAL to VALUE conversion is
	needed.

	Some functions are not used when `THREAD_MODEL=none`

	`rb_thread_sched_destroy` is not used now at all
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) a7ff264477105b5dc0ade6facad4176a1b73df0b: [Backport #20393]</title>
<updated>2024-05-29T18:46:33+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-05-29T18:46:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6e46a363a8f29d93cf6992805ee67d029cea030f'/>
<id>6e46a363a8f29d93cf6992805ee67d029cea030f</id>
<content type='text'>
	Don't clear pending interrupts in the parent process. (#10365)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Don't clear pending interrupts in the parent process. (#10365)
</pre>
</div>
</content>
</entry>
<entry>
<title>Suppress -Wclobbered warnings</title>
<updated>2024-05-29T17:57:43+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-05-29T17:57:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=22c1e5f126db8e057bdb48d91aa5ae449e019226'/>
<id>22c1e5f126db8e057bdb48d91aa5ae449e019226</id>
<content type='text'>
Co-authored-by: Nobuyoshi Nakada &lt;nobu@ruby-lang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: Nobuyoshi Nakada &lt;nobu@ruby-lang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 78d9fe69479d32214a52ad7291c3973f1b6b7f6f: [Backport #20286]</title>
<updated>2024-05-29T17:02:15+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-05-29T17:02:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a8b2317d16fa172edd3cd7e6fcb3bc694287d109'/>
<id>a8b2317d16fa172edd3cd7e6fcb3bc694287d109</id>
<content type='text'>
	Ensure that exiting thread invokes end-of-life behaviour. (#10039)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Ensure that exiting thread invokes end-of-life behaviour. (#10039)
</pre>
</div>
</content>
</entry>
<entry>
<title>Backport bug #20493 to Ruby 3.3 (#10798)</title>
<updated>2024-05-28T20:17:24+00:00</updated>
<author>
<name>KJ Tsanaktsidis</name>
<email>ktsanaktsidis@zendesk.com</email>
</author>
<published>2024-05-28T20:17:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b6c07acedb3ca56471754a082b3db20bb863c92e'/>
<id>b6c07acedb3ca56471754a082b3db20bb863c92e</id>
<content type='text'>
Inline RB_VM_SAVE_MACHINE_CONTEXT into BLOCKING_REGION

There's an exhaustive explanation of this in the linked redmine bug, but
the short version is as follows:

blocking_region_begin can spill callee-saved registers to the stack for
its own use. That means they're not saved to ec-&gt;machine by the call to
setjmp, since by that point they're already on the stack and new,
different values are in the real registers. ec-&gt;machine's end-of-stack
pointer is also bumped to accomodate this, BUT, after
blocking_region_begin returns, that points past the end of the stack!

As far as C is concerned, that's fine; the callee-saved registers are
restored when blocking_region_begin returns. But, if another thread
triggers GC, it is relying on finding references to Ruby objects by
walking the stack region pointed to by ec-&gt;machine.

If the C code in exec; subsequently does things that use that stack
memory, then the value will be overwritten and the GC might prematurely
collect something it shouldn't.

[Bug #20493]</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Inline RB_VM_SAVE_MACHINE_CONTEXT into BLOCKING_REGION

There's an exhaustive explanation of this in the linked redmine bug, but
the short version is as follows:

blocking_region_begin can spill callee-saved registers to the stack for
its own use. That means they're not saved to ec-&gt;machine by the call to
setjmp, since by that point they're already on the stack and new,
different values are in the real registers. ec-&gt;machine's end-of-stack
pointer is also bumped to accomodate this, BUT, after
blocking_region_begin returns, that points past the end of the stack!

As far as C is concerned, that's fine; the callee-saved registers are
restored when blocking_region_begin returns. But, if another thread
triggers GC, it is relying on finding references to Ruby objects by
walking the stack region pointed to by ec-&gt;machine.

If the C code in exec; subsequently does things that use that stack
memory, then the value will be overwritten and the GC might prematurely
collect something it shouldn't.

[Bug #20493]</pre>
</div>
</content>
</entry>
<entry>
<title>accept `RB_WAITFD_IN | RB_WAITFD_OUT` for waiting events</title>
<updated>2023-12-24T05:53:46+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2023-12-24T05:20:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=541371e286d2f139c49e7805f6f229618eb63144'/>
<id>541371e286d2f139c49e7805f6f229618eb63144</id>
<content type='text'>
Assrsion was `events == RB_WAITFD_IN || events == RB_WAITFD_OUT`
but it should accept `RB_WAITFD_IN | RB_WAITFD_OUT`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Assrsion was `events == RB_WAITFD_IN || events == RB_WAITFD_OUT`
but it should accept `RB_WAITFD_IN | RB_WAITFD_OUT`.
</pre>
</div>
</content>
</entry>
</feed>
