Skip to content

Bug: Spawn a thread with a empty loop, program will coredump when compile with optimizations #46076

Closed
@biluohc

Description

@biluohc

I found the bug because of i need a hand warmer.
My system is openSUSE 42.3(Linux 4.4.92 x86-64).
My rustc is 1.23.0-nightly and 1.21.0.
My code is follows:

fn main() {
    let handle = std::thread::spawn(||loop {});
    handle.join().unwrap()
}

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