Skip to content

install_fatal_error_handler is unsound. #710

Description

@ErisianArchitect

Describe the Bug

pub unsafe fn install_fatal_error_handler(handler: extern "C" fn(*const ::libc::c_char)) {

This function is unsound, unless the error handler calls abort. If the error handler panics, then the panic will unwind into the C++ stack frames, which is unsound and would cause undefined behavior.

I'm not entirely sure if we can make this sound. We can notify users of the behavior and tell them that they should abort and not return from the function.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions