Skip to content
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
Closed

fiber-related crash after full GC #3063

kazuho opened this issue Dec 27, 2015 · 2 comments

Comments

@kazuho
Copy link
Contributor

@kazuho 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
Copy link
Contributor Author

@kazuho 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 as completed in 3531fe1 Dec 30, 2015
@kazuho
Copy link
Contributor Author

@kazuho 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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant