Skip to content

Is it immediate UB to cancel a thread and deallocate it's stack #405

Closed
@chorman0773

Description

@chorman0773

System APIs pthread_exit and pthread_cancel are able to terminate a thread and deallocate it's stack without running destructors.

Because of APIs like Pin, this cannot be sound for Rust code. Is there any reason that this should be considered undefined behaviour immediately (if any rust frame is on its stack), or just unsound in the face of stack-pinning. Additionally, is there anything else beyond Pin that would cause this to be unsound (if it is defined).

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