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

App::update crashes with default plugins due to pipelined rendering #7412

Closed
alice-i-cecile opened this issue Jan 29, 2023 · 3 comments
Closed
Labels
A-Rendering Drawing game state to the screen A-Tasks Tools for parallel and async work C-Bug An unexpected or incorrect behavior P-Crash A sudden unexpected crash P-High This is particularly urgent, and deserves immediate attention
Milestone

Comments

@alice-i-cecile
Copy link
Member

Bevy version

9d52aae

What you did

Run

fn main() {
    App::new().add_plugins(DefaultPlugins).update();
}

What went wrong

Two different errors, depending on the run:

  1. thread 'main' panicked at 'resource does not exist: bevy_render::ExtractStage', /home/alice/Documents/Code/bevy/crates/bevy_ecs/src/world/mod.rs:1311:32 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

  2. thread 'main' panicked at 'called Option::unwrap()on aNonevalue', crates/bevy_render/src/pipelined_rendering.rs:143:84 note: run withRUST_BACKTRACE=1environment variable to display a backtrace thread 'main' panicked at 'calledOption::unwrap()on aNone value', /home/alice/Documents/Code/bevy/crates/bevy_tasks/src/task_pool.rs:354:49

Additional context

This failure does not occur with App::run instead.

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen P-Crash A sudden unexpected crash P-High This is particularly urgent, and deserves immediate attention A-Tasks Tools for parallel and async work labels Jan 29, 2023
@alice-i-cecile alice-i-cecile added this to the 0.10 milestone Jan 29, 2023
@alice-i-cecile alice-i-cecile changed the title App::update crashes with default plugins due to pipelined rendering App::update crashes with default plugins due to pipelined rendering Jan 29, 2023
@hymm
Copy link
Contributor

hymm commented Jan 29, 2023

This is because only App.run calls the setup functions that are used by pipelined rendering. Is this just necessary for testing?

If it is we could add a setup/build function that you can call explicitly to run that step.

@alice-i-cecile
Copy link
Member Author

I can replicate this on #7267.

Yes, I primarily want this for testing and teaching purposes. Walking one-frame-at-a-time through the app is very useful for catching bugs.

Right, that explanation makes sense. I think ultimately we should go back to AppBuilder, for this and other reasons.
I'm unsure if that's the right fix for this immediately though: it's fairly controversial and invasive.

@hymm
Copy link
Contributor

hymm commented Jan 29, 2023

I think ultimately we should go back to AppBuilder

I agree here. There's a bunch of stuff for improving plugins that can only really be done with a finalizing build step.

I'm unsure if that's the right fix for this immediately though: it's fairly controversial and invasive.

Also agree here. I'm not sure I want to try to get something like this in before 0.10.

I think adding a method you can call explicitly for testing isn't ideal, but it should work as a temporary workaround for 0.10.

@bors bors bot closed this as completed in eeb67ee Feb 9, 2023
myreprise1 pushed a commit to myreprise1/bevy that referenced this issue Feb 11, 2023
# Objective

- Fixes bevyengine#7412
- Fixes bevyengine#7576 

## Solution

- Add a setup function to app, so users can call the plugin `setup` methods before calling `update`.

## Changelog

- add a setup function to app
myreprise1 pushed a commit to myreprise1/bevy that referenced this issue Feb 11, 2023
# Objective

- Fixes bevyengine#7412
- Fixes bevyengine#7576 

## Solution

- Add a setup function to app, so users can call the plugin `setup` methods before calling `update`.

## Changelog

- add a setup function to app
myreprise1 pushed a commit to myreprise1/bevy that referenced this issue Feb 15, 2023
# Objective

- Fixes bevyengine#7412
- Fixes bevyengine#7576 

## Solution

- Add a setup function to app, so users can call the plugin `setup` methods before calling `update`.

## Changelog

- add a setup function to app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen A-Tasks Tools for parallel and async work C-Bug An unexpected or incorrect behavior P-Crash A sudden unexpected crash P-High This is particularly urgent, and deserves immediate attention
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants