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

Improve error message in common re_renderer crash #3070

Merged
merged 3 commits into from
Aug 22, 2023

Conversation

emilk
Copy link
Member

@emilk emilk commented Aug 22, 2023

Here is a reproduce:

--- a/examples/rust/clock/src/main.rs
+++ b/examples/rust/clock/src/main.rs
@@ -77,7 +77,7 @@ fn run(rec_stream: &RecordingStream, args: &Args) -> anyhow::Result<()> {
             .with_component(&[color])?
             .send(rec_stream)?;
         MsgSender::new(format!("world/{name}_hand"))
-            .with_component(&[Vector3D::from(pos)])?
+            .with_component(&[Vector3D::from(pos); 65537])?
             .with_component(&[color])?
             .with_component(&[Radius(width * 0.5)])?
             .send(rec_stream)?;

We are hitting LineDrawData::MAX_NUM_STRIPS.

It's really bad if it is the case that hitting an upper limit crashes the viewer 😭


In 0.8.1 we have 21 users crashing in re_renderer-0.8.0/src/allocator/cpu_write_gpu_read_belt.rs:87
Callstack:

   8: <re_renderer::line_strip_builder::LineStripBuilder as core::ops::drop::Drop>::drop
   9: re_space_view_spatial::parts::arrows3d::Arrows3DPart::process_entity_view
  10: re_space_view_spatial::parts::entity_iterator::process_entity_views
  11: <re_space_view_spatial::parts::arrows3d::Arrows3DPart as re_viewer_context::space_view::view_part_system::ViewPartSystem>::execute
  12: re_viewer_context::space_view::space_view_class::<impl re_viewer_context::space_view::dyn_space_view_class::DynSpaceViewClass for T>::ui
  13: core::ops::function::FnOnce::call_once{{vtable.shim}}

Arrows3DPart is using LineBatchBuilder.
LineBatchBuilder::add_segment returns a LineStripBuilder
LineStripBuilder::drop calls CpuWriteGpuReadBuffer::extend which calls
CpuWriteGpuReadBuffer::push which crashes because the CpuWriteGpuReadBuffer is full

Checklist

@emilk emilk requested a review from Wumpf August 22, 2023 14:40
@emilk emilk changed the title Emilk/investigate arrow3d crash Investigate common re_renderer crash Aug 22, 2023
@emilk emilk added this to the 0.9 milestone Aug 22, 2023
@rerun-io rerun-io deleted a comment from github-actions bot Aug 22, 2023
@emilk emilk added 🔺 re_renderer affects re_renderer itself 💣 crash crash, deadlock/freeze, do-no-start labels Aug 22, 2023
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yikes >.<

@github-actions
Copy link

Size changes

Name Previous Current Change
plots.rrd 184.32 kiB 194.56 kiB -5.26%

@emilk emilk changed the title Investigate common re_renderer crash Improve error message in common re_renderer crash Aug 22, 2023
@emilk emilk merged commit 6db856a into main Aug 22, 2023
@emilk emilk deleted the emilk/investigate-arrow3d-crash branch August 22, 2023 20:17
jleibs pushed a commit that referenced this pull request Aug 31, 2023
Here is a reproduce:

```diff
--- a/examples/rust/clock/src/main.rs
+++ b/examples/rust/clock/src/main.rs
@@ -77,7 +77,7 @@ fn run(rec_stream: &RecordingStream, args: &Args) -> anyhow::Result<()> {
             .with_component(&[color])?
             .send(rec_stream)?;
         MsgSender::new(format!("world/{name}_hand"))
-            .with_component(&[Vector3D::from(pos)])?
+            .with_component(&[Vector3D::from(pos); 65537])?
             .with_component(&[color])?
             .with_component(&[Radius(width * 0.5)])?
             .send(rec_stream)?;
```

We are hitting `LineDrawData::MAX_NUM_STRIPS`.

It's really bad if it is the case that hitting an upper limit crashes
the viewer 😭


----

In 0.8.1 we have 21 users crashing in
`re_renderer-0.8.0/src/allocator/cpu_write_gpu_read_belt.rs:87`
Callstack:

```
   8: <re_renderer::line_strip_builder::LineStripBuilder as core::ops::drop::Drop>::drop
   9: re_space_view_spatial::parts::arrows3d::Arrows3DPart::process_entity_view
  10: re_space_view_spatial::parts::entity_iterator::process_entity_views
  11: <re_space_view_spatial::parts::arrows3d::Arrows3DPart as re_viewer_context::space_view::view_part_system::ViewPartSystem>::execute
  12: re_viewer_context::space_view::space_view_class::<impl re_viewer_context::space_view::dyn_space_view_class::DynSpaceViewClass for T>::ui
  13: core::ops::function::FnOnce::call_once{{vtable.shim}}
```

`Arrows3DPart` is using `LineBatchBuilder`.
`LineBatchBuilder::add_segment` returns a `LineStripBuilder`
`LineStripBuilder::drop` calls `CpuWriteGpuReadBuffer::extend` which
calls
`CpuWriteGpuReadBuffer::push` which crashes because the
`CpuWriteGpuReadBuffer` is full

### 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 [demo.rerun.io](https://demo.rerun.io/pr/{{
pr.number }}) (if applicable)

- [PR Build Summary](https://build.rerun.io/pr/{{ pr.number }})
- [Docs preview](https://rerun.io/preview/{{
"pr:%s"|format(pr.branch)|encode_uri_component }}/docs)
- [Examples preview](https://rerun.io/preview/{{
"pr:%s"|format(pr.branch)|encode_uri_component }}/examples)
- [Recent benchmark results](https://ref.rerun.io/dev/bench/)
- [Wasm size tracking](https://ref.rerun.io/dev/sizes/)
jleibs pushed a commit that referenced this pull request Aug 31, 2023
Here is a reproduce:

```diff
--- a/examples/rust/clock/src/main.rs
+++ b/examples/rust/clock/src/main.rs
@@ -77,7 +77,7 @@ fn run(rec_stream: &RecordingStream, args: &Args) -> anyhow::Result<()> {
             .with_component(&[color])?
             .send(rec_stream)?;
         MsgSender::new(format!("world/{name}_hand"))
-            .with_component(&[Vector3D::from(pos)])?
+            .with_component(&[Vector3D::from(pos); 65537])?
             .with_component(&[color])?
             .with_component(&[Radius(width * 0.5)])?
             .send(rec_stream)?;
```

We are hitting `LineDrawData::MAX_NUM_STRIPS`.

It's really bad if it is the case that hitting an upper limit crashes
the viewer 😭


----

In 0.8.1 we have 21 users crashing in
`re_renderer-0.8.0/src/allocator/cpu_write_gpu_read_belt.rs:87`
Callstack:

```
   8: <re_renderer::line_strip_builder::LineStripBuilder as core::ops::drop::Drop>::drop
   9: re_space_view_spatial::parts::arrows3d::Arrows3DPart::process_entity_view
  10: re_space_view_spatial::parts::entity_iterator::process_entity_views
  11: <re_space_view_spatial::parts::arrows3d::Arrows3DPart as re_viewer_context::space_view::view_part_system::ViewPartSystem>::execute
  12: re_viewer_context::space_view::space_view_class::<impl re_viewer_context::space_view::dyn_space_view_class::DynSpaceViewClass for T>::ui
  13: core::ops::function::FnOnce::call_once{{vtable.shim}}
```

`Arrows3DPart` is using `LineBatchBuilder`.
`LineBatchBuilder::add_segment` returns a `LineStripBuilder`
`LineStripBuilder::drop` calls `CpuWriteGpuReadBuffer::extend` which
calls
`CpuWriteGpuReadBuffer::push` which crashes because the
`CpuWriteGpuReadBuffer` is full

### 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 [demo.rerun.io](https://demo.rerun.io/pr/{{
pr.number }}) (if applicable)

- [PR Build Summary](https://build.rerun.io/pr/{{ pr.number }})
- [Docs preview](https://rerun.io/preview/{{
"pr:%s"|format(pr.branch)|encode_uri_component }}/docs)
- [Examples preview](https://rerun.io/preview/{{
"pr:%s"|format(pr.branch)|encode_uri_component }}/examples)
- [Recent benchmark results](https://ref.rerun.io/dev/bench/)
- [Wasm size tracking](https://ref.rerun.io/dev/sizes/)
jleibs pushed a commit that referenced this pull request Aug 31, 2023
Here is a reproduce:

```diff
--- a/examples/rust/clock/src/main.rs
+++ b/examples/rust/clock/src/main.rs
@@ -77,7 +77,7 @@ fn run(rec_stream: &RecordingStream, args: &Args) -> anyhow::Result<()> {
             .with_component(&[color])?
             .send(rec_stream)?;
         MsgSender::new(format!("world/{name}_hand"))
-            .with_component(&[Vector3D::from(pos)])?
+            .with_component(&[Vector3D::from(pos); 65537])?
             .with_component(&[color])?
             .with_component(&[Radius(width * 0.5)])?
             .send(rec_stream)?;
```

We are hitting `LineDrawData::MAX_NUM_STRIPS`.

It's really bad if it is the case that hitting an upper limit crashes
the viewer 😭


----

In 0.8.1 we have 21 users crashing in
`re_renderer-0.8.0/src/allocator/cpu_write_gpu_read_belt.rs:87`
Callstack:

```
   8: <re_renderer::line_strip_builder::LineStripBuilder as core::ops::drop::Drop>::drop
   9: re_space_view_spatial::parts::arrows3d::Arrows3DPart::process_entity_view
  10: re_space_view_spatial::parts::entity_iterator::process_entity_views
  11: <re_space_view_spatial::parts::arrows3d::Arrows3DPart as re_viewer_context::space_view::view_part_system::ViewPartSystem>::execute
  12: re_viewer_context::space_view::space_view_class::<impl re_viewer_context::space_view::dyn_space_view_class::DynSpaceViewClass for T>::ui
  13: core::ops::function::FnOnce::call_once{{vtable.shim}}
```

`Arrows3DPart` is using `LineBatchBuilder`.
`LineBatchBuilder::add_segment` returns a `LineStripBuilder`
`LineStripBuilder::drop` calls `CpuWriteGpuReadBuffer::extend` which
calls
`CpuWriteGpuReadBuffer::push` which crashes because the
`CpuWriteGpuReadBuffer` is full

### 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 [demo.rerun.io](https://demo.rerun.io/pr/{{
pr.number }}) (if applicable)

- [PR Build Summary](https://build.rerun.io/pr/{{ pr.number }})
- [Docs preview](https://rerun.io/preview/{{
"pr:%s"|format(pr.branch)|encode_uri_component }}/docs)
- [Examples preview](https://rerun.io/preview/{{
"pr:%s"|format(pr.branch)|encode_uri_component }}/examples)
- [Recent benchmark results](https://ref.rerun.io/dev/bench/)
- [Wasm size tracking](https://ref.rerun.io/dev/sizes/)
@jleibs jleibs mentioned this pull request Aug 31, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💣 crash crash, deadlock/freeze, do-no-start 🔺 re_renderer affects re_renderer itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants