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

Crash when supplying too large mesh #3928

Closed
Wumpf opened this issue Oct 19, 2023 · 4 comments · Fixed by #5053
Closed

Crash when supplying too large mesh #3928

Wumpf opened this issue Oct 19, 2023 · 4 comments · Fixed by #5053
Labels
🪳 bug Something isn't working 💣 crash crash, deadlock/freeze, do-no-start 🔺 re_renderer affects re_renderer itself

Comments

@Wumpf
Copy link
Member

Wumpf commented Oct 19, 2023

Similar to too large textures previously, we have issues with too large buffers. Easiest way to get a too large buffer is to supply a too large mesh through any api.

Just as before we need more extensive vetting of user supplied data and need to tell wgpu to allow the largest possible buffer.

@Wumpf Wumpf added 🪳 bug Something isn't working 🔺 re_renderer affects re_renderer itself 💣 crash crash, deadlock/freeze, do-no-start labels Oct 19, 2023
@Wumpf Wumpf added this to the 0.11 C++ polish milestone Oct 19, 2023
@emilk emilk assigned emilk and unassigned emilk Oct 25, 2023
@emilk
Copy link
Member

emilk commented Oct 25, 2023

I tested this:

    rec.log(
        "big",
        &rerun::Mesh3D::new(vec![[0.0, 0.0, 0.0]; 1_000_000_000]),
    )?;

and got no crash, at least not on the native viewer.

It seems like the limit is pretty large, and this issue is more theoretical than the texture size limit

@Wumpf
Copy link
Member Author

Wumpf commented Oct 26, 2023

@roym899 do you remember how you got this issue? I missed to write the down the exact circumstances

@Wumpf
Copy link
Member Author

Wumpf commented Oct 26, 2023

default max buffer size is speced at 256mb https://www.w3.org/TR/webgpu/#limits
so yeah it gotta be a very large mesh, but it can happen :)

@emilk emilk removed this from the 0.11 milestone Nov 21, 2023
@Wumpf
Copy link
Member Author

Wumpf commented Jan 25, 2024

Looks like we can also hit this limit when supplying a lot of plot data. The crash then happens when egui tries to resize its staging buffer for uploading the data

thread 'ThreadId(1)' panicked at 'Failed to create staging buffer for index data'
egui-wgpu/src/renderer.rs:834

Wumpf added a commit that referenced this issue Feb 6, 2024
…uffers) (#5053)

### What

We already did this for textures, was overdue to do it for buffers as
well.

* fixes #3928
* fixes #5051


### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using newly built examples:
[app.rerun.io](https://app.rerun.io/pr/5053/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/5053/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[app.rerun.io](https://app.rerun.io/pr/5053/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG

- [PR Build Summary](https://build.rerun.io/pr/5053)
- [Docs
preview](https://rerun.io/preview/3d6c0ddd06db9e8500fd715637e6cbf30c08ab06/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/3d6c0ddd06db9e8500fd715637e6cbf30c08ab06/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪳 bug Something isn't working 💣 crash crash, deadlock/freeze, do-no-start 🔺 re_renderer affects re_renderer itself
Projects
None yet
2 participants