New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fiber-related crash after full GC #3063

Closed
kazuho opened this Issue Dec 27, 2015 · 2 comments

Comments

Projects
None yet
1 participant
@kazuho
Contributor

kazuho commented Dec 27, 2015

The code snippet below crashes with assertion failure: (f->tt == MRB_TT_FIBER), function fiber_check, file /mydev/3p/mruby/mrbgems/mruby-fiber/src/fiber.c, line 140..

# create fiber
f = Fiber.new do
  me = Fiber.current
  Fiber.yield(
    Proc.new do
      me.resume
    end
  )
end

# obtain proc that refers to the fiber through env
f = f.resume

# GC
GC.start

# call the proc
f.call
@kazuho

This comment has been minimized.

Show comment
Hide comment
@kazuho

kazuho Dec 27, 2015

Contributor

FWIW assertion failure disappears once the the expression that creates the proc into a separate method, like:

def create_resumer()
  me = Fiber.current
  Proc.new do
    me.resume
  end
end

# create fiber
f = Fiber.new do
  Fiber.yield(create_resumer())
end

# obtain proc that refers to the fiber through env
f = f.resume

# GC
GC.start

# call the proc
f.call
Contributor

kazuho commented Dec 27, 2015

FWIW assertion failure disappears once the the expression that creates the proc into a separate method, like:

def create_resumer()
  me = Fiber.current
  Proc.new do
    me.resume
  end
end

# create fiber
f = Fiber.new do
  Fiber.yield(create_resumer())
end

# obtain proc that refers to the fiber through env
f = f.resume

# GC
GC.start

# call the proc
f.call

kazuho added a commit to h2o/h2o that referenced this issue Dec 27, 2015

@matz matz closed this in 3531fe1 Dec 30, 2015

@kazuho

This comment has been minimized.

Show comment
Hide comment
@kazuho

kazuho Dec 30, 2015

Contributor

Thank you for the fix!

Contributor

kazuho commented Dec 30, 2015

Thank you for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment