<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/process.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>Avoid file descriptor leak</title>
<updated>2024-12-18T02:10:05+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2024-11-28T17:38:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c07fb791504cdfa32ff1be165758fcc624b26c2d'/>
<id>c07fb791504cdfa32ff1be165758fcc624b26c2d</id>
<content type='text'>
`extra_fd` was leaked if `fd_set_cloexec` fails -- I can't think of any
chance of that happening here, but just in case.

Coverity Scan found this issue.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`extra_fd` was leaked if `fd_set_cloexec` fails -- I can't think of any
chance of that happening here, but just in case.

Coverity Scan found this issue.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add missing fiber nil check to avoid slow rb_check_funcall()</title>
<updated>2024-12-09T21:20:01+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2024-12-09T20:48:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0c9c6efc20dd2fefbebb8a6a0d39952ffd425e33'/>
<id>0c9c6efc20dd2fefbebb8a6a0d39952ffd425e33</id>
<content type='text'>
Check for nil like other callers of rb_fiber_scheduler_current().
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Check for nil like other callers of rb_fiber_scheduler_current().
</pre>
</div>
</content>
</entry>
<entry>
<title>Place all non-default GC API behind USE_SHARED_GC</title>
<updated>2024-11-25T13:05:23+00:00</updated>
<author>
<name>Matt Valentine-House</name>
<email>matt@eightbitraptor.com</email>
</author>
<published>2024-11-22T13:30:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=551be8219e8a4c5b0021716b047976d66feb3048'/>
<id>551be8219e8a4c5b0021716b047976d66feb3048</id>
<content type='text'>
So that it doesn't get included in the generated binaries for builds
that don't support loading shared GC modules

Co-Authored-By: Peter Zhu &lt;peter@peterzhu.ca&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
So that it doesn't get included in the generated binaries for builds
that don't support loading shared GC modules

Co-Authored-By: Peter Zhu &lt;peter@peterzhu.ca&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Direct access to `fptr-&gt;fd` should prefer to use the `internal/io.h`. (#11793)"</title>
<updated>2024-10-04T08:25:43+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2024-10-04T08:25:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=86e8a36e77a9946aeb179c73a232a793867951bb'/>
<id>86e8a36e77a9946aeb179c73a232a793867951bb</id>
<content type='text'>
This reverts commit 6ea0dcc9781931129e77540097712f6196d49fde that was accidentally merged.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 6ea0dcc9781931129e77540097712f6196d49fde that was accidentally merged.</pre>
</div>
</content>
</entry>
<entry>
<title>Direct access to `fptr-&gt;fd` should prefer to use the `internal/io.h`. (#11793)</title>
<updated>2024-10-04T07:44:23+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2024-10-04T07:44:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6ea0dcc9781931129e77540097712f6196d49fde'/>
<id>6ea0dcc9781931129e77540097712f6196d49fde</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix bug at fork on FreeBSD</title>
<updated>2024-09-19T09:08:12+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-09-19T08:23:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=dc8c382266b056fa51408806478218f5230fbce2'/>
<id>dc8c382266b056fa51408806478218f5230fbce2</id>
<content type='text'>
The main thread in a forked process appears not to own the read-write
lock.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The main thread in a forked process appears not to own the read-write
lock.
</pre>
</div>
</content>
</entry>
<entry>
<title>Adjust indent [ci skip]</title>
<updated>2024-09-19T05:33:32+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-09-19T05:33:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c193ca52180360a3cb24648ffedd1b2181989e9d'/>
<id>c193ca52180360a3cb24648ffedd1b2181989e9d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Constify `struct getpwnam_r_args::login`</title>
<updated>2024-09-13T00:28:51+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-09-13T00:28:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d80a81c1526cc01a4cbd2e2bb3e0feae5bd9c800'/>
<id>d80a81c1526cc01a4cbd2e2bb3e0feae5bd9c800</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Release GVL for get{pwnam,pwuid,grgid,grnam}_r calls in process.c</title>
<updated>2024-09-12T14:24:02+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2024-07-18T19:08:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ad761ad2d0a63270fbd243a477dc962446a5116e'/>
<id>ad761ad2d0a63270fbd243a477dc962446a5116e</id>
<content type='text'>
Do not release GVL around get{pwuid,pwnam,grgid,grnam} calls,
as doing so is not thread-safe.  Another C extension could have
a concurrent call, and derefencing the returned pointer from
these calls could result in a segfault.

Have rb_home_dir_of call rb_getpwdirnam_for_login if available,
so it can use getpwnam_r and release GVL in a thread-safe manner.

This is related to GVL releasing work in [Bug #20587].
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Do not release GVL around get{pwuid,pwnam,grgid,grnam} calls,
as doing so is not thread-safe.  Another C extension could have
a concurrent call, and derefencing the returned pointer from
these calls could result in a segfault.

Have rb_home_dir_of call rb_getpwdirnam_for_login if available,
so it can use getpwnam_r and release GVL in a thread-safe manner.

This is related to GVL releasing work in [Bug #20587].
</pre>
</div>
</content>
</entry>
<entry>
<title>Proof of Concept: Allow to prevent fork from happening in known fork unsafe API</title>
<updated>2024-09-05T09:43:46+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2024-05-29T14:46:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=63cbe3f6ac9feb44a2e43b1f853e2ca7e049316c'/>
<id>63cbe3f6ac9feb44a2e43b1f853e2ca7e049316c</id>
<content type='text'>
[Feature #20590]

For better of for worse, fork(2) remain the primary provider of
parallelism in Ruby programs. Even though it's frowned uppon in
many circles, and a lot of literature will simply state that only
async-signal safe APIs are safe to use after `fork()`, in practice
most APIs work well as long as you are careful about not forking
while another thread is holding a pthread mutex.

One of the APIs that is known cause fork safety issues is `getaddrinfo`.
If you fork while another thread is inside `getaddrinfo`, a mutex
may be left locked in the child, with no way to unlock it.

I think we could reduce the impact of these problem by preventing
in for the most notorious and common cases, by locking around
`fork(2)` and known unsafe APIs with a read-write lock.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Feature #20590]

For better of for worse, fork(2) remain the primary provider of
parallelism in Ruby programs. Even though it's frowned uppon in
many circles, and a lot of literature will simply state that only
async-signal safe APIs are safe to use after `fork()`, in practice
most APIs work well as long as you are careful about not forking
while another thread is holding a pthread mutex.

One of the APIs that is known cause fork safety issues is `getaddrinfo`.
If you fork while another thread is inside `getaddrinfo`, a mutex
may be left locked in the child, with no way to unlock it.

I think we could reduce the impact of these problem by preventing
in for the most notorious and common cases, by locking around
`fork(2)` and known unsafe APIs with a read-write lock.
</pre>
</div>
</content>
</entry>
</feed>
