Skip to content

thread::spawn with function with no return result type causes SIGSEGV #39432

Closed
@LunaBorowska

Description

@LunaBorowska

Messages are never printed, the program just crashes.

This only happens in release mode.

What I did?

Ran following program in release mode.

use std::thread;

fn worker() -> ! {
    loop {
        println!("Printing messages");
    }
}

fn main() {
    thread::spawn(worker);
    loop {
        thread::park();
    }
}

What was expected?

Flood of "Printing messages" messages.

What happened instead.

SIGSEGV

Meta

This was confirmed to happen on stable (on IRC and in playpen), however I don't have stable installed.

rustc 1.16.0-nightly (df8debf6d 2017-01-25)
binary: rustc
commit-hash: df8debf6d9afc431adbbd8311dcaf2b70eb9762e
commit-date: 2017-01-25
host: x86_64-unknown-linux-gnu
release: 1.16.0-nightly
LLVM version: 3.9

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