Skip to content

Segfault while adding a state #2464

@64kramsystem

Description

@64kramsystem

Bevy version

0.5.0

Operating system & version

Ubuntu 20.04 MATE, tested on two separate machines (Nvidia/Intel).

Rust: rustc 1.55.0-nightly (432e145bd 2021-07-10)
Other Rust tested: rustc 1.53.0 (53cb7b09b 2021-06-17)

What you did

Listing follows. Note that this is incorrect logic, but I believe that this should not segfault regardless.

The segfault reproduces 100% of the times, on two machines, both on stable and nightly.

use bevy::prelude::*;

#[derive(Debug, Clone, Eq, PartialEq, Hash)]
pub enum AppState {
    MainMenu,
    InGame,
}

fn main() {
    App::build()
        .add_plugins(DefaultPlugins)
        .add_state(AppState::MainMenu)
        .add_state(AppState::InGame)
        .run();
}

What you expected to happen

Panic, but no segfault.

What actually happened

Stack trace, ending with:

[1]    12345 segmentation fault  cargo run

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-WindowingPlatform-agnostic interface layer to run your app inC-BugAn unexpected or incorrect behaviorO-LinuxSpecific to the Linux desktop operating systemS-Needs-InvestigationThis issue requires detective work to figure out what's going wrong

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions