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

Attempting to render empty linestrips causes a crash #9089

Closed
Elabajaba opened this issue Jul 9, 2023 · 0 comments · Fixed by #9101
Closed

Attempting to render empty linestrips causes a crash #9089

Elabajaba opened this issue Jul 9, 2023 · 0 comments · Fixed by #9101
Labels
A-Gizmos Visual editor and debug gizmos C-Bug An unexpected or incorrect behavior P-Crash A sudden unexpected crash
Milestone

Comments

@Elabajaba
Copy link
Contributor

Elabajaba commented Jul 9, 2023

Bevy version

Bevy 0.11

What you did

Have a system that unconditionally runs gizmos.linestrip_2d(path, Color::YELLOW);, where path is an iterator over a list of points that can be empty.

What went wrong

It crashes with

thread 'main' panicked at 'Buffer slices can not be empty', C:\Users\elabajaba\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.16.2\src\lib.rs:2362:39
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in exclusive system `bevy_render::renderer::render_system`!

Additional information

I tested it on both vulkan and dx12.

It used to work on bevy main. #8910 is when it started crashing.

@Elabajaba Elabajaba added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jul 9, 2023
Elabajaba added a commit to Elabajaba/bevy_pathmesh that referenced this issue Jul 9, 2023
@Selene-Amanita Selene-Amanita added P-Crash A sudden unexpected crash A-Gizmos Visual editor and debug gizmos and removed S-Needs-Triage This issue needs to be labelled labels Jul 9, 2023
github-merge-queue bot pushed a commit to vleue/vleue_navigator that referenced this issue Jul 10, 2023
* bevy main

* fix gltf example by enabling features required for TonyMcMapface

* bevy 0.11

* don't render empty lines to avoid crash bevyengine/bevy#9089

* polyanya 0.4
@alice-i-cecile alice-i-cecile added this to the 0.11.1 milestone Jul 11, 2023
@cart cart modified the milestones: 0.11.1, 0.12 Aug 10, 2023
github-merge-queue bot pushed a commit that referenced this issue Aug 15, 2023
# Objective

Fix #9089

## Solution

Don't try to draw lines with less than 2 vertices. These would not be
visible either way.

---------

Co-authored-by: François <mockersf@gmail.com>
cart pushed a commit that referenced this issue Aug 17, 2023
# Objective

Fix #9089

## Solution

Don't try to draw lines with less than 2 vertices. These would not be
visible either way.

---------

Co-authored-by: François <mockersf@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Gizmos Visual editor and debug gizmos C-Bug An unexpected or incorrect behavior P-Crash A sudden unexpected crash
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants