Skip to content

Using spawn_bundle with an empty vector causes a sigsegv on destruction. #2294

@MJohnson459

Description

@MJohnson459

Bevy version

bevy v0.5.0 (https://github.com/bevyengine/bevy.git?branch=main#05209475)

Operating system & version

Ubuntu 18.04

What you did

use bevy::prelude::*;

fn startup(mut cmd: Commands) {
    let v: Vec<(String,)> = Vec::new();
    cmd.spawn_batch(v);
}

#[test]
fn test_segv() {
    let mut builder = App::build();
    builder.add_startup_system(startup.system());

    let mut app = builder.app;
    app.update();
} // <-- segfault here

What actually happened

process didn't exit successfully: `target/debug/examples/segv-ec3698e577c470a4 test_segv --exact --nocapture` (signal: 11, SIGSEGV: invalid memory reference)

Additional information

Discussion in discord starts here:
https://discord.com/channels/691052431525675048/742884593551802431/849604240765878302

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorP-CrashA sudden unexpected crashP-HighThis is particularly urgent, and deserves immediate attention

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions