bevyengine / bevyengine/bevy

Panic rendering sprite

Open
#3,376 8 comments 0 reactions 0 assignees View on GitHub
A-Assets A-Rendering C-Bug
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
4d 8m
Merged PRs (30d)
147

Description

## Bevy version

main#e018ac838d164ce00a8c8fec3748787aaddb0e05

## Operating system & version

Linux 5.10.83-1-MANJARO #1 SMP PREEMPT Wed Dec 1 14:46:38 UTC 2021 x86_64 GNU/Linux

## What you did

It happens extremely itermittently, seems to be a timing issue.

Occasionally while spawning sprites this line will panic:
https://github.com/bevyengine/bevy/blob/main/crates/bevy_sprite/src/render/mod.rs#L526

## What you expected to happen

It should probably log a warning rather than killing the app.

## What actually happened

The app panicked.

## Additional information

Seems to happen consistently on my debug builds and not on my release build. I expect the optimizations change the timing and fix the bug.

Maybe this should be another issue, but I noticed there are [~150 unwraps in the bevy codebase](https://github.com/bevyengine/bevy/search?q=unwrap).

Might be useful to address each of these scenarios and revisit whether it's worth killing the app, and if so, attach an appropriate error message indicating what happened.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.