Skip to content

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

Closed
@brson

Description

@brson

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

Metadata

Metadata

Assignees

Labels

A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsI-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions