Skip to content

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

Closed
@diwic

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.

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