Multiple Bevy::App instances cause crashes
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
## Bevy version and features
0.16.1
## What you did
Create a basic bevy Main function, Run `App::new()` twice.
```
fn main() {
let app = App::new();
app.add_plugins(DefaultPlugins);
App::new()
.add_plugins(DefaultPlugins)
.run();
}
```
## What went wrong
The precense of two app's crashes with multiple conflicts
- what were you expecting?
At minimum, a conflict should only be possible if both were app.run()
- what actually happened?
Crashed
## Additional information
```
Finished `dev` profile [unoptimized + debuginfo] target(s) in 21.31s
Running `target/debug/conjoined_compilation_multiprocess_model -e`
2025-09-07T04:13:29.927318Z INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux (Ubuntu 22.04)", kernel: "6.8.0-79-generic", cpu: "AMD Ryzen 7 7700X 8-Core Processor", core_count: "8", memory: "62.0 GiB" }
2025-09-07T04:13:29.963684Z INFO bevy_render::renderer: AdapterInfo { name: "AMD Radeon Graphics (RADV NAVI21)", vendor: 4098, device: 29605, device_type: DiscreteGpu, driver: "radv", driver_info: "Mesa 23.2.1-1ubuntu3.1~22.04.3", backend: Vulkan }
2025-09-07T04:13:30.274605Z ERROR bevy_log: Could not set global logger and tracing subscriber as they are already set. Consider disabling LogPlugin.
2025-09-07T04:13:30.275797Z INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux (Ubuntu 22.04)", kernel: "6.8.0-79-generic", cpu: "AMD Ryzen 7 7700X 8-Core Processor", core_count: "8", memory: "62.0 GiB" }
2025-09-07T04:13:30.276302Z INFO bevy_app::terminal_ctrl_c_handler: Skipping installing `Ctrl+C` handler as one was already installed. Please call `TerminalCtrlCHandlerPlugin::gracefully_exit` in your own `Ctrl+C` handler if you want Bevy to gracefully exit on `Ctrl+C`.
thread 'main' panicked at /home/rin/.cargo/git/checkouts/bevy-50d7e162b728c6c6/a036b65/crates/bevy_winit/src/lib.rs:131:14:
Failed to build event loop: RecreationAttempt
```
- Current known causes:
- [ ] Terminal_ctrl_c_handler Fails
- [ ] Bevy_log Fails
- [ ] Diagnostics appear to run twice
Contributor guide
Assessment
This issue has not been assessed yet.