Skip to content

Thread name with null crashes with "Illegal instruction" #32475

Description

@diwic

Trying the following example on playpen (notice the \0 inside the thread name)

fn main() {
    std::thread::Builder::new().name("chi\0ld1".to_string()).spawn(|| {
        println!("Hello, world!");
    }).unwrap().join().unwrap();
}

Playpen output:

thread '<unnamed>' panicked at 'thread name may not contain interior null bytes', ../src/libstd/sys/unix/thread.rs:90
note: Run with `RUST_BACKTRACE=1` for a backtrace.
fatal runtime error: Could not unwind stack, error = 5
playpen: application terminated abnormally with signal 4 (Illegal instruction)

Both on stable and nightly.

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