-
Notifications
You must be signed in to change notification settings - Fork 256
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
Encountered a panic #136
Comments
I'm also facing the same issue, any news on it? |
I've been developing my application ever since and did not encounter this issue again. It only happened twice on the day i bootstrapped my project. |
Hi! Sorry, it took me long to respond. Yeah, I'd appreciate additional details on how to reproduce it. I left the What's the platform you tried running the examples on? Did you minimise the window or just "alt-tabbed"? Any chance you launched another 3d app that runs in real fullscreen mode? (I'm just making random guesses on how I'll also ask around in Bevy's Discord, apparently, apps cannot assume that swapchain textures are always available. |
I can't reproduce it. I've been working on it daily for >2 weeks switching between Linux and Windows now and it worked stable ever since. It happened while i was browsing the web browser and doing other stuff with the application opened on another monitor. The application ran in windowed mode. It must have been minutes after the application start when it suddenly closed. If i recall correctly i wasn't even touching the PC watching something on youtube. I can surely say i did not have anything open in fullscreen mode.
To me this error seems to either be extremely rare or a random hiccup on my end. Maybe something silly like a driver update which was gone after a reboot. I don't know about the specific issue @zihadmahiuddin had however. Are there any more specific details you'd like to have? |
I also got the same error from the same line. https://github.com/mvlabat/bevy_egui/blob/main/src/egui_node.rs#L332, this is the line btw. I tried changing it to something like this but that only made the panic disappear but it doesn't function properly. let Some(swap_chain_texture) = extracted_window.swap_chain_texture.as_ref() else {
return Ok(());
}; I'm not using this crate directly but through this crate By the way, another thing is that for me it was crashing at startup, I didn't have to leave it on for some time or anything like that. Let me know if you need anything else from me. |
Hi, I was trying out the I'm on I used this code which I got from a tutorial use bevy::prelude::*;
use bevy_inspector_egui::WorldInspectorPlugin;
pub const HEIGHT: f32 = 720.0;
pub const WIDTH: f32 = 1280.0;
fn main() {
App::new()
.insert_resource(ClearColor(Color::BLACK))
.add_startup_system(spawn_basic_scene)
.add_startup_system(spawn_camera)
.add_plugins(DefaultPlugins.set(WindowPlugin {
window: WindowDescriptor {
width: WIDTH,
height: HEIGHT,
title: "testing".to_string(),
resizable: false,
..Default::default()
},
..default()
}))
.add_plugin(WorldInspectorPlugin::new())
.run();
}
fn spawn_basic_scene(
mut commands: Commands,
mut meshes: ResMut<Assets<Mesh>>,
mut materials: ResMut<Assets<StandardMaterial>>,
) {
commands.spawn(PbrBundle {
mesh: meshes.add(Mesh::from(shape::Plane { size: 5.0 })),
material: materials.add(Color::rgb(0.3, 0.5, 0.3).into()),
..default()
});
commands.spawn(PbrBundle {
mesh: meshes.add(Mesh::from(shape::Cube { size: 1.0 })),
material: materials.add(Color::rgb(0.67, 0.84, 0.92).into()),
transform: Transform::from_xyz(0.0, 0.5, 0.0),
..default()
});
}
fn spawn_camera(mut commands: Commands) {
commands.spawn(Camera3dBundle {
transform: Transform::from_xyz(-2.0, 2.5, 5.0).looking_at(Vec3::ZERO, Vec3::Y),
..default()
});
} Heres the stack trace: hopalong_orbits_generator on main [?] is 📦 v0.1.0 via 🦀 v1.66.0 took 3s
❯ RUST_BACKTRACE=1 cargo run
Finished dev [optimized + debuginfo] target(s) in 0.17s
Running `target/debug/hopalong_orbits_generator`
2022-12-25T18:28:21.422351Z INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 1
2022-12-25T18:28:21.442944Z INFO bevy_render::renderer: AdapterInfo { name: "AMD Radeon RX 580 Series", vendor: 4098, device: 26591, device_type: DiscreteGpu, driver: "AMD open-source driver", driver_info: "2022.Q4.4 (LLPC)", backend: Vulkan }
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/aditeya/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/bevy_egui-0.18.0/src/egui_node.rs:332:34
stack backtrace:
0: rust_begin_unwind
at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:575:5
1: core::panicking::panic_fmt
at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panicking.rs:65:14
2: core::panicking::panic
at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panicking.rs:115:5
3: <bevy_egui::egui_node::EguiNode as bevy_render::render_graph::node::Node>::run
4: bevy_render::renderer::graph_runner::RenderGraphRunner::run_graph
at /home/aditeya/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/bevy_render-0.9.1/src/renderer/graph_runner.rs:188:21
5: bevy_render::renderer::graph_runner::RenderGraphRunner::run
at /home/aditeya/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/bevy_render-0.9.1/src/renderer/graph_runner.rs:68:9
6: bevy_render::renderer::render_system
at /home/aditeya/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/bevy_render-0.9.1/src/renderer/mod.rs:29:21
7: core::ops::function::FnMut::call_mut
at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/ops/function.rs:166:5
8: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/ops/function.rs:297:13
9: <Func as bevy_ecs::system::exclusive_function_system::ExclusiveSystemParamFunction<(),()>>::run::call_inner
at /home/aditeya/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/bevy_ecs-0.9.1/src/system/exclusive_function_system.rs:193:21
10: <Func as bevy_ecs::system::exclusive_function_system::ExclusiveSystemParamFunction<(),()>>::run
at /home/aditeya/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/bevy_ecs-0.9.1/src/system/exclusive_function_system.rs:196:17
11: <bevy_ecs::system::exclusive_function_system::ExclusiveFunctionSystem<Param,Marker,F> as bevy_ecs::system::system::System>::run
at /home/aditeya/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/bevy_ecs-0.9.1/src/system/exclusive_function_system.rs:102:9
12: <bevy_ecs::schedule::stage::SystemStage as bevy_ecs::schedule::stage::Stage>::run
at /home/aditeya/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/bevy_ecs-0.9.1/src/schedule/stage.rs:853:29
13: <bevy_render::RenderPlugin as bevy_app::plugin::Plugin>::build::{{closure}}
at /home/aditeya/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/bevy_render-0.9.1/src/lib.rs:300:21
14: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/alloc/src/boxed.rs:2001:9
15: bevy_app::app::App::update
at /home/aditeya/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/bevy_app-0.9.1/src/app.rs:154:13
16: bevy_winit::winit_runner_with::{{closure}}
at /home/aditeya/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/bevy_winit-0.9.1/src/lib.rs:600:21
17: winit::platform_impl::platform::sticky_exit_callback
18: winit::platform_impl::platform::x11::EventLoop<T>::run_return::single_iteration
at /home/aditeya/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/winit-0.27.5/src/platform_impl/linux/x11/mod.rs:363:17
19: winit::platform_impl::platform::x11::EventLoop<T>::run_return
at /home/aditeya/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/winit-0.27.5/src/platform_impl/linux/x11/mod.rs:488:27
20: winit::platform_impl::platform::x11::EventLoop<T>::run
at /home/aditeya/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/winit-0.27.5/src/platform_impl/linux/x11/mod.rs:503:25
21: winit::platform_impl::platform::EventLoop<T>::run
at /home/aditeya/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/winit-0.27.5/src/platform_impl/linux/mod.rs:755:56
22: winit::event_loop::EventLoop<T>::run
at /home/aditeya/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/winit-0.27.5/src/event_loop.rs:278:9
23: bevy_winit::run
at /home/aditeya/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/bevy_winit-0.9.1/src/lib.rs:263:5
24: bevy_winit::winit_runner_with
at /home/aditeya/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/bevy_winit-0.9.1/src/lib.rs:645:9
25: bevy_winit::winit_runner
at /home/aditeya/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/bevy_winit-0.9.1/src/lib.rs:303:5
26: core::ops::function::Fn::call
at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/ops/function.rs:78:5
27: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/alloc/src/boxed.rs:2001:9
28: bevy_app::app::App::run
at /home/aditeya/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/bevy_app-0.9.1/src/app.rs:168:9
29: hopalong_orbits_generator::main
at ./src/main.rs:8:5
30: core::ops::function::FnOnce::call_once
at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/ops/function.rs:251:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. |
I've ran into a panic on linux/gnu running
cargo run --release
:The UI Code is pretty minimal in a fresh project:
The bevy version is
"0.9"
and bevy_egui is"0.17.1"
.The crash happened after letting the application run for a few minutes and leaving it unattended.
The text was updated successfully, but these errors were encountered: