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

A destructor that fails when run from the cycle collector will do terrible things #2047

Closed
brson opened this issue Mar 23, 2012 · 3 comments
Closed
Assignees
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Milestone

Comments

@brson
Copy link
Contributor

brson commented Mar 23, 2012

Failing inside a destructor is broken to begin with, but failing from within the cycle collector is even worse:

  1. The cycle collector won't catch the failure and continue
  2. The cycle collector jumps from the C stack to the Rust stack to run the destructor but does not do the proper maintenance if the destructor throws
  3. The logic that prevents failure in crust functions is in effect because of reentry into the Rust stack, so the runtime will abort
  4. The final cycle collection happens outside of any try-catch block so the runtime will abort
@catamorphism
Copy link
Contributor

Also see: #910

@brson
Copy link
Contributor Author

brson commented Oct 23, 2012

This needs to be revisited now that the cc is done in Rust code. The situation may not be as bad.

@pcwalton
Copy link
Contributor

The cycle collector has been nuked from orbit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Projects
None yet
Development

No branches or pull requests

3 participants