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

Example 3d/pbr.rs panics #16959

Closed
mdickopp opened this issue Dec 24, 2024 · 1 comment · Fixed by #16976
Closed

Example 3d/pbr.rs panics #16959

mdickopp opened this issue Dec 24, 2024 · 1 comment · Fixed by #16976
Labels
A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior C-Examples An addition or correction to our examples S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it!
Milestone

Comments

@mdickopp
Copy link
Contributor

mdickopp commented Dec 24, 2024

Bevy version

main branch, commit f9c8f51

The issue does not occur with v0.15.0.

What you did

Ran example 3d/pbr.rs with command cargo run --example pbr.

What went wrong

A window appeared for a fraction of a second, then the program panicked with:

thread 'main' panicked at /home/martin/incomplete/bevy/crates/bevy_ecs/src/system/function_system.rs:216:28:
pbr::environment_map_load_finish could not access system parameter Single<Entity, With<EnvironmentMapLabel>>

Additional information

Full output:

2024-12-24T20:03:24.283465Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux  Debian GNU/Linux", kernel: "6.12.5-amd64", cpu: "Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz", core_count: "8", memory: "31.3 GiB" }
2024-12-24T20:03:24.327546Z  INFO bevy_render::renderer: AdapterInfo { name: "AMD Radeon RX 590 Series (RADV POLARIS10)", vendor: 4098, device: 26591, device_type: DiscreteGpu, driver: "radv", driver_info: "Mesa 24.2.8-1", backend: Vulkan }
2024-12-24T20:03:24.914706Z  INFO bevy_winit::system: Creating new window "App" (0v1#4294967296)
2024-12-24T20:03:24.914823Z  INFO winit::platform_impl::linux::x11::window: Guessed window scale factor: 1
thread 'main' panicked at /home/martin/incomplete/bevy/crates/bevy_ecs/src/system/function_system.rs:216:28:
pbr::environment_map_load_finish could not access system parameter Single<Entity, With<EnvironmentMapLabel>>
stack backtrace:
   0: rust_begin_unwind
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/panicking.rs:665:5
   1: core::panicking::panic_fmt
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/core/src/panicking.rs:74:14
   2: bevy_ecs::system::function_system::ParamWarnPolicy::try_warn
             at ./crates/bevy_ecs/src/system/function_system.rs:216:28
   3: bevy_ecs::system::function_system::SystemMeta::try_warn_param
             at ./crates/bevy_ecs/src/system/function_system.rs:137:9
   4: <bevy_ecs::system::query::Single<D,F> as bevy_ecs::system::system_param::SystemParam>::validate_param
             at ./crates/bevy_ecs/src/system/system_param.rs:421:13
   5: <(P0,P1,P2,P3) as bevy_ecs::system::system_param::SystemParam>::validate_param
             at ./crates/bevy_ecs/src/system/system_param.rs:2045:19
   6: <bevy_ecs::system::function_system::FunctionSystem<Marker,F> as bevy_ecs::system::system::System>::validate_param_unsafe
             at ./crates/bevy_ecs/src/system/function_system.rs:832:33
   7: <bevy_ecs::system::schedule_system::ScheduleSystem as bevy_ecs::system::system::System>::validate_param_unsafe
             at ./crates/bevy_ecs/src/system/schedule_system.rs:127:57
   8: bevy_ecs::schedule::executor::multi_threaded::ExecutorState::should_run
             at ./crates/bevy_ecs/src/schedule/executor/multi_threaded.rs:577:41
   9: bevy_ecs::schedule::executor::multi_threaded::ExecutorState::spawn_system_tasks
             at ./crates/bevy_ecs/src/schedule/executor/multi_threaded.rs:421:22
  10: bevy_ecs::schedule::executor::multi_threaded::ExecutorState::tick
             at ./crates/bevy_ecs/src/schedule/executor/multi_threaded.rs:371:13
  11: bevy_ecs::schedule::executor::multi_threaded::Context::tick_executor
             at ./crates/bevy_ecs/src/schedule/executor/multi_threaded.rs:311:13
  12: <bevy_ecs::schedule::executor::multi_threaded::MultiThreadedExecutor as bevy_ecs::schedule::executor::SystemExecutor>::run::{{closure}}
             at ./crates/bevy_ecs/src/schedule/executor/multi_threaded.rs:231:17
  13: bevy_tasks::task_pool::TaskPool::scope_with_executor_inner
             at ./crates/bevy_tasks/src/task_pool.rs:401:9
  14: bevy_tasks::task_pool::TaskPool::scope_with_executor::{{closure}}
             at ./crates/bevy_tasks/src/task_pool.rs:336:17
  15: std::thread::local::LocalKey<T>::try_with
             at /home/martin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:283:12
  16: std::thread::local::LocalKey<T>::with
             at /home/martin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:260:9
  17: bevy_tasks::task_pool::TaskPool::scope_with_executor
             at ./crates/bevy_tasks/src/task_pool.rs:332:9
  18: <bevy_ecs::schedule::executor::multi_threaded::MultiThreadedExecutor as bevy_ecs::schedule::executor::SystemExecutor>::run
             at ./crates/bevy_ecs/src/schedule/executor/multi_threaded.rs:223:9
  19: bevy_ecs::schedule::schedule::Schedule::run
             at ./crates/bevy_ecs/src/schedule/schedule.rs:391:9
  20: bevy_ecs::world::World::try_run_schedule::{{closure}}
             at ./crates/bevy_ecs/src/world/mod.rs:3639:55
  21: bevy_ecs::world::World::try_schedule_scope
             at ./crates/bevy_ecs/src/world/mod.rs:3572:21
  22: bevy_ecs::world::World::try_run_schedule
             at ./crates/bevy_ecs/src/world/mod.rs:3639:9
  23: bevy_app::main_schedule::Main::run_main::{{closure}}
             at ./crates/bevy_app/src/main_schedule.rs:280:25
  24: bevy_ecs::world::World::try_resource_scope
             at ./crates/bevy_ecs/src/world/mod.rs:2722:22
  25: bevy_ecs::world::World::resource_scope
             at ./crates/bevy_ecs/src/world/mod.rs:2684:9
  26: bevy_app::main_schedule::Main::run_main
             at ./crates/bevy_app/src/main_schedule.rs:278:9
  27: core::ops::function::FnMut::call_mut
             at /home/martin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:166:5
  28: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
             at /home/martin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:294:13
  29: <Func as bevy_ecs::system::exclusive_function_system::ExclusiveSystemParamFunction<fn(F0) .> Out>>::run::call_inner
             at ./crates/bevy_ecs/src/system/exclusive_function_system.rs:245:21
  30: <Func as bevy_ecs::system::exclusive_function_system::ExclusiveSystemParamFunction<fn(F0) .> Out>>::run
             at ./crates/bevy_ecs/src/system/exclusive_function_system.rs:248:17
  31: <bevy_ecs::system::exclusive_function_system::ExclusiveFunctionSystem<Marker,F> as bevy_ecs::system::system::System>::run::{{closure}}
             at ./crates/bevy_ecs/src/system/exclusive_function_system.rs:129:23
  32: bevy_ecs::world::World::last_change_tick_scope
             at ./crates/bevy_ecs/src/world/mod.rs:3076:9
  33: <bevy_ecs::system::exclusive_function_system::ExclusiveFunctionSystem<Marker,F> as bevy_ecs::system::system::System>::run
             at ./crates/bevy_ecs/src/system/exclusive_function_system.rs:121:9
  34: <bevy_ecs::system::schedule_system::ScheduleSystem as bevy_ecs::system::system::System>::run
             at ./crates/bevy_ecs/src/system/schedule_system.rs:93:17
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Encountered a panic in system `bevy_app::main_schedule::Main::run_main`!
@mdickopp mdickopp added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Dec 24, 2024
@BenjaminBrienen BenjaminBrienen added C-Examples An addition or correction to our examples S-Needs-Investigation This issue requires detective work to figure out what's going wrong and removed S-Needs-Triage This issue needs to be labelled labels Dec 25, 2024
@mdickopp
Copy link
Contributor Author

The first commit that causes the panic is 460de77, but it just turns a warning into a panic. The first commit that displays

2024-12-25T09:34:39.919799Z  WARN bevy_ecs::system::function_system: pbr::environment_map_load_finish did not run because it requested inaccessible system parameter Single<Entity, With<EnvironmentMapLabel>>

is 17e5048.

@BenjaminBrienen BenjaminBrienen added S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it! A-ECS Entities, components, systems, and events and removed S-Needs-Investigation This issue requires detective work to figure out what's going wrong labels Dec 25, 2024
@mockersf mockersf added this to the 0.15.1 milestone Dec 26, 2024
github-merge-queue bot pushed a commit that referenced this issue Dec 27, 2024
# Objective

- Fixes #16959
- The `pbr.rs` example in the 3d section panicked because of the changes
in #16638, that was not supposed to happen

## Solution

- For now it's sufficient to introduce a `never_param_warn` call when
adding the fallible system into the app

## Testing

- Tested on my machine via `cargo r --example pbr`, it built and ran
successfully

---------

Co-authored-by: Freya Pines <[email protected]>
Co-authored-by: François Mockers <[email protected]>
mockersf added a commit that referenced this issue Jan 3, 2025
# Objective

- Fixes #16959
- The `pbr.rs` example in the 3d section panicked because of the changes
in #16638, that was not supposed to happen

## Solution

- For now it's sufficient to introduce a `never_param_warn` call when
adding the fallible system into the app

## Testing

- Tested on my machine via `cargo r --example pbr`, it built and ran
successfully

---------

Co-authored-by: Freya Pines <[email protected]>
Co-authored-by: François Mockers <[email protected]>
ecoskey pushed a commit to ecoskey/bevy that referenced this issue Jan 6, 2025
# Objective

- Fixes bevyengine#16959
- The `pbr.rs` example in the 3d section panicked because of the changes
in bevyengine#16638, that was not supposed to happen

## Solution

- For now it's sufficient to introduce a `never_param_warn` call when
adding the fallible system into the app

## Testing

- Tested on my machine via `cargo r --example pbr`, it built and ran
successfully

---------

Co-authored-by: Freya Pines <[email protected]>
Co-authored-by: François Mockers <[email protected]>
mrchantey pushed a commit to mrchantey/bevy that referenced this issue Feb 4, 2025
# Objective

- Fixes bevyengine#16959
- The `pbr.rs` example in the 3d section panicked because of the changes
in bevyengine#16638, that was not supposed to happen

## Solution

- For now it's sufficient to introduce a `never_param_warn` call when
adding the fallible system into the app

## Testing

- Tested on my machine via `cargo r --example pbr`, it built and ran
successfully

---------

Co-authored-by: Freya Pines <[email protected]>
Co-authored-by: François Mockers <[email protected]>
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 C-Bug An unexpected or incorrect behavior C-Examples An addition or correction to our examples S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants