Project

General

Profile

Actions

Bug #15041

closed

[PATCH] cont.c: set th->root_fiber to current fiber at fork

Added by normalperson (Eric Wong) over 6 years ago. Updated almost 6 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:88722]

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) over 6 years ago

(I'm not sure why fork removes other fibers, but)
I think it is okay. let's try.

Actions #2

Updated by normalperson (Eric Wong) over 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) over 6 years ago

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) over 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.

Actions #7

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
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0