Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panics are getting hard to understand #8215

Closed
mockersf opened this issue Mar 25, 2023 · 4 comments · Fixed by #8219
Closed

Panics are getting hard to understand #8215

mockersf opened this issue Mar 25, 2023 · 4 comments · Fixed by #8219
Labels
A-ECS Entities, components, systems, and events A-Tasks Tools for parallel and async work C-Usability A targeted quality-of-life change that makes Bevy easier to use

Comments

@mockersf
Copy link
Member

mockersf commented Mar 25, 2023

Bevy version

current main (4f16d6e)

What you did

use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_systems(Update, panicking_system)
        .run();
}

fn panicking_system() {
    panic!("oooh scary");
}

What went wrong

It's hard to understand which panic I should care about. Well not quite in this specific case as I put an explicit message, but it usually is. It can be even worse if the panic is from inside Bevy code.

   Compiling panicking v0.1.0
    Finished release [optimized] target(s) in 2.04s
     Running `target/release/panicking`
2023-03-25T22:50:20.189287Z  INFO bevy_render::renderer: AdapterInfo { name: "Apple M1 Max", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }
2023-03-25T22:50:20.317469Z  INFO bevy_winit::system: Creating new window "Bevy App" (0v0)
2023-03-25T22:50:20.392074Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "MacOS 13.1 ", kernel: "22.2.0", cpu: "Apple M1 Max", core_count: "10", memory: "64.0 GiB" }
thread 'Compute Task Pool (3)' panicked at 'oooh scary', main.rs:14:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'Compute Task Pool (3)' panicked at 'A system has panicked so the executor cannot continue.: RecvError', crates/bevy_ecs/src/schedule/executor/multi_threaded.rs:194:60
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', bevy/crates/bevy_tasks/src/task_pool.rs:376:49
thread 'Compute Task Pool (3)' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', crates/bevy_render/src/pipelined_rendering.rs:110:77
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', bevy/crates/bevy_tasks/src/task_pool.rs:376:49
@mockersf mockersf added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Mar 25, 2023
@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Tasks Tools for parallel and async work and removed C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Mar 25, 2023
@alice-i-cecile
Copy link
Member

Yeah, the panic messages are significantly degraded in 0.10 following the new approach to tasks and scheduling.

@nicopap
Copy link
Contributor

nicopap commented Mar 26, 2023

It is also a lot harder to decrypt backtraces with RUST_BACKTRACE=1 since you have to figure out which one is relevant.

@rparrett
Copy link
Contributor

Related? #8152

@JonahPlusPlus
Copy link
Contributor

Made a simple PR that fixes this issue: #8219. It seems that fixing the panic in the multi-threaded scheduler also fixes the other panic messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events A-Tasks Tools for parallel and async work C-Usability A targeted quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants