[ruby-core:88773] Re: [Ruby trunk Bug#15050] GC after forking with fibers crashes

From: Eric Wong <normalperson@...>
Date: 2018-08-31 06:14:19 UTC
List: ruby-core #88773
Koichi Sasada <[email protected]> wrote:
> On 2018/08/31 12:50, Eric Wong wrote:
> > > [Bug #15041] hits something wrong?
> > > (sorry I needed to ask earlier)
> > 
> > No, it's not wrong; but it is an incomplete fix.   There
> > seems to be several problems related to fork + Fiber
> 
> Sorry my question is wrong.
> 
> What is the problem [Bug #15041] want to solve?

Switching fiber can crash in child process.  r64589 test change
shows it:

```
-      Fiber.new{ pid = fork {} }.resume
+      Fiber.new do
+        pid = fork do
+          Fiber.new {}.transfer
+        end
+      end.resume
```

> I remember that there are several implicit assumption on root fiber and so
> on. I think changing this attribute is bad idea now.

I think we need to change to avoid crashes.  We change vm->main_thread
at fork, too.  Maybe I'can investigate late next week.

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread