Bug #15041
closed[PATCH] cont.c: set th->root_fiber to current fiber at fork
Description
cont.c: set th->root_fiber to current fiber at fork
Otherwise, th->root_fiber can point to an invalid Fiber,
because Fibers do not live across fork. So consider
whatever Fiber is running the root fiber.
Files
Updated by ko1 (Koichi Sasada) about 6 years ago
(I'm not sure why fork removes other fibers, but)
I think it is okay. let's try.
Updated by normalperson (Eric Wong) about 6 years ago
- Status changed from Open to Closed
Applied in changeset trunk|r64589.
cont.c: set th->root_fiber to current fiber at fork
Otherwise, th->root_fiber can point to an invalid Fiber,
because Fibers do not live across fork. So consider
whatever Fiber is running the root fiber.
[ruby-core:88723] [Bug #15041]
Updated by normalperson (Eric Wong) about 6 years ago
ko1@atdot.net wrote:
(I'm not sure why fork removes other fibers, but)
fib = Fiber.new { puts " HI" }
fork { fib.resume }
Process.waitall
Shows me: `resume': fiber called across stack rewinding barrier (FiberError)
If we reimplement Fiber entirely with Ruby bytecode, then we
can we can jump around anywhere (and migrate fibers across
threads). But we lose C extension compatibility.
I think it is okay. let's try.
OK, r64589
Updated by ko1 (Koichi Sasada) about 6 years ago
On 2018/08/29 17:09, Eric Wong wrote:
Shows me: `resume': fiber called across stack rewinding barrier (FiberError)
Yes, I tried similar code.
Not sure why...
Nobu?
--
// SASADA Koichi at atdot dot net
Updated by nagachika (Tomoyuki Chikanaga) almost 6 years ago
- Backport changed from 2.3: REQUIRED, 2.4: REQUIRED, 2.5: REQUIRED to 2.3: REQUIRED, 2.4: REQUIRED, 2.5: DONE
ruby_2_5 r66818 merged revision(s) 64589,64593.
Updated by usa (Usaku NAKAMURA) almost 6 years ago
- Backport changed from 2.3: REQUIRED, 2.4: REQUIRED, 2.5: DONE to 2.3: REQUIRED, 2.4: DONE, 2.5: DONE
ruby_2_4 r66968 merged revision(s) 64589,64593.
Updated by usa (Usaku NAKAMURA) almost 6 years ago
- Backport changed from 2.3: REQUIRED, 2.4: DONE, 2.5: DONE to 2.3: REQUIRED, 2.4: REQUIRED, 2.5: DONE