-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Wireframe plugin causes segmentation violation #1717
Comments
Given the nondeterminism, I wonder if this is a system ordering issue. |
@mockersf Awesome! Sorry I did not see this. I will try updating to that fix revision and see how it goes. |
OK I updated to 785aad9 and I'm getting what appears to be the same stack: STACK TRACE
|
@bonsairobo I wasn't able to compile the example - I will try again later, but can you put some |
Oh yea I guess there is a broken dependency in bevy right now. I will do a little debugging later today hopefully when I can build bevy again. |
Sorry I had a busy end of my week. But I just did a little debugging. There does not appear to be a correlation between the system ordering and the crash. When it crashes:
When it succeeds:
|
While trying to remove parts of my game to reach a minimum reproducer, here is what I found: use bevy::{
prelude::*,
render::wireframe::{Wireframe, WireframePlugin},
wgpu::{WgpuFeature, WgpuFeatures, WgpuOptions},
};
fn main() {
App::build()
.insert_resource(Msaa { samples: 4 })
.insert_resource(WgpuOptions {
features: WgpuFeatures {
features: vec![WgpuFeature::NonFillPolygonMode],
},
..Default::default()
})
.add_plugins(DefaultPlugins)
.add_plugin(WireframePlugin)
.add_startup_system(setup.system())
.run();
}
fn setup(mut commands: Commands, mut meshes: ResMut<Assets<Mesh>>, asset_server: Res<AssetServer>) {
commands.spawn_scene(asset_server.load("models/AlienCake/cakeBirthday.glb#Scene0"));
commands
.spawn_bundle(PbrBundle {
mesh: meshes.add(Mesh::from(shape::Cube { size: 1.0 })),
transform: Transform::from_xyz(0.0, 0.5, 0.0),
..Default::default()
})
.insert(Wireframe);
commands.spawn_bundle(PerspectiveCameraBundle {
transform: Transform::from_xyz(-2.0, 2.5, 5.0).looking_at(Vec3::ZERO, Vec3::Y),
..Default::default()
});
} This code crashes almost every time for me.
|
I ran into this issue as well and what i gathered so far is that after a resize of the buffer array it sometimes still tried to use the old buffer, which causes the panic. The order of the draw systems (after the buffer resize) doesn't matter. I've seen it crash either way. when I comment out this line in : render_resource_bindings#L146 I don't get the panic anymore. |
@bonsairobo: Is this still an issue? This was before the 0.6 render rework was done. If it isn't reproducible, please close this issue. |
not reproducible for me 🎉 |
Although I haven't tried upgrading |
Bevy version
rev = d9fb61d
Operating system & version
Arch Linux
What you did
I have an example running on top of bevy here: https://github.com/bonsairobo/building-blocks/tree/main/examples/lod_terrain
If you go to
lod_terrain.rs
and uncomment the wireframe stuff, then run the example, it will occasionally crash with a segfault.What you expected to happen
Not crashing. And it does occasionally run without error. This is a nondeterministic bug.
What actually happened
Crashed with error:
Additional information
STACK TRACE
The text was updated successfully, but these errors were encountered: