Skip to content

Use std::quick_exit when exiting #1396

Description

@Aidan63

I can't remember the exact details at this point, but during hxcoro development we ran into a problem on cpp when integrating libuv. Roughly, after the program had successfully ran the runtime starts to tear down thread local stuff by running destructors and some gcc specific "on exit" callbacks in libuv. This caused a race with the hxcpp GC being unloaded causing a segfault on program exit.

I think we should start using std::quick_exit, both when the user calls Sys.exit and when the program completes gracefully. This will prevent the destructors of any thread local stuff being called, which is fine as we're about to exit anyway. If there is something we want to run we can use std::at_quick_exit.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions