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

Sending a blueprint withan empty barchart crashes the viewer #6681

Closed
jleibs opened this issue Jun 29, 2024 · 8 comments · Fixed by emilk/egui#4741 or #6683
Closed

Sending a blueprint withan empty barchart crashes the viewer #6681

jleibs opened this issue Jun 29, 2024 · 8 comments · Fixed by emilk/egui#4741 or #6683
Assignees
Labels
🪳 bug Something isn't working 💣 crash crash, deadlock/freeze, do-no-start 🦟 regression A thing that used to work in an earlier release
Milestone

Comments

@jleibs
Copy link
Member

jleibs commented Jun 29, 2024

Repro:

import rerun.blueprint as rrb
import rerun as rr

rr.init("rerun_example_crash", spawn=True)

uhoh = rrb.Blueprint(
    rrb.BarChartView(contents=["fft"]),
)

rr.send_blueprint(uhoh)

Crashes on 0.17 but does not crash on 0.16.1.

Both on native (linux) and web.

Stack trace:

[2024-06-29T00:10:36Z DEBUG re_viewer::app] Opening a new recording: 5ffa5d9c-6d50-4315-a3ad-9ce66665807f
[2024-06-29T00:10:36Z DEBUG re_viewer::app] Data source tcp://127.0.0.1:55288 has finished
[2024-06-29T00:10:36Z DEBUG re_viewer::app] Data source tcp://127.0.0.1:55286 has finished
[2024-06-29T00:10:36Z DEBUG re_viewer::app] Opening a new recording: 5ffa5d9c-6d50-4315-a3ad-9ce66665807f
[2024-06-29T00:10:36Z DEBUG re_entity_db::store_bundle] Creating new store: 704db980-ef70-4f92-b73a-74df056c06ce
[2024-06-29T00:10:36Z DEBUG re_viewer::app] Activating blueprint that was loaded from TCP server, port 9876
[2024-06-29T00:10:36Z DEBUG re_viewer_context::store_hub] Switching default blueprint for rerun_example_crash to 704db980-ef70-4f92-b73a-74df056c06ce
[2024-06-29T00:10:36Z DEBUG re_viewer_context::store_hub] Cloning 704db980-ef70-4f92-b73a-74df056c06ce as 50d716a6-e0fb-4cf3-8597-b8ab33f78f28 the active blueprint for rerun_example_crash to 704db980-ef70-4f92-b73a-74df056c06ceam is closed
[2024-06-29T00:10:36Z DEBUG re_viewer::app] Data source tcp://127.0.0.1:55296 has finished
During handling of the above exception, another exception occurred:
thread 'main' panicked at 'assertion failed: max > min'
egui_plot/src/lib.rs:1766
stack backtrace:
   6: core::panicking::panic_fmt
             at core/src/panicking.rs:72:14
   7: core::panicking::panic
             at core/src/panicking.rs:144:5
   8: egui_plot::fill_marks_between
             at egui_plot/src/lib.rs:1766:5
      egui_plot::generate_marks
             at egui_plot/src/lib.rs:1736:5
   9: egui_plot::log_grid_spacer::{{closure}}
             at egui_plot/src/lib.rs:1434:9
  10: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
             at alloc/src/boxed.rs:2029:9
      egui_plot::Plot::show_dyn
             at egui_plot/src/lib.rs:1147:13
  11: egui_plot::Plot::show
             at egui_plot/src/lib.rs:728:9
      <re_space_view_bar_chart::space_view_class::BarChartSpaceView as re_viewer_context::space_view::space_view_class::SpaceViewClass>::ui::{{closure}}
             at re_space_view_bar_chart/src/space_view_class.rs:169:17
      core::ops::function::FnOnce::call_once{{vtable.shim}}
             at core/src/ops/function.rs:250:5
  12: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at alloc/src/boxed.rs:2015:9
  13: egui::ui::Ui::scope_dyn
             at egui/src/ui.rs:2005:19
  14: egui::ui::Ui::scope
             at egui/src/ui.rs:1991:9
  15: <re_space_view_bar_chart::space_view_class::BarChartSpaceView as re_viewer_context::space_view::space_view_class::SpaceViewClass>::ui
             at re_space_view_bar_chart/src/space_view_class.rs:154:9
@jleibs jleibs added 🪳 bug Something isn't working 💣 crash crash, deadlock/freeze, do-no-start labels Jun 29, 2024
@jleibs jleibs added this to the 0.17 milestone Jun 29, 2024
@jleibs jleibs added the 🦟 regression A thing that used to work in an earlier release label Jun 29, 2024
@jleibs
Copy link
Member Author

jleibs commented Jun 29, 2024

Things to investigate:

  • egui_plots has been updated
  • aspects of fallback values have been changed that could cause us to be sending different data to egui_plots in this case.

@Wumpf
Copy link
Member

Wumpf commented Jun 29, 2024

that's a debug assertion only, fixed it for the time series chart already but didn't realize there it was new

@emilk
Copy link
Member

emilk commented Jun 30, 2024

We also hit a debug_assertion just loading the plots example

@emilk
Copy link
Member

emilk commented Jun 30, 2024

fixed it for the time series chart already but didn't realize there it was new

@Wumpf is referring to https://github.com/rerun-io/rerun/pull/6639/files

I don't really understand why scalar_axis.component_or_fallback::<Range1D> returns an inverted range though

@emilk emilk self-assigned this Jun 30, 2024
@emilk
Copy link
Member

emilk commented Jun 30, 2024

I believe this has something to do with empty plots, and how to pick bounds for such plots

@Wumpf
Copy link
Member

Wumpf commented Jun 30, 2024

Doesn't have to be inverted, a zero size range is enough to trigger the assertion. (A user may though provide an inverted range, we have to guard for that as well)

@emilk
Copy link
Member

emilk commented Jun 30, 2024

When I run check_all_components_ui.py, scalar_axis.component_or_fallback::<Range1D> returns the range (3.0000000000000004, 3.0) - I wan't to understand why.

@emilk
Copy link
Member

emilk commented Jun 30, 2024

I suspect this is to blame:

*range.start_mut() = next_up_f64(range.end());

I'll clean this up

emilk added a commit that referenced this issue Jul 1, 2024
### What
With this update, we now format numbers in `DragValues` using
`re_format`, i.e. with thousands separators. This makes large editable
components easier to read, and makes our UI more consistent.


![image](https://github.com/rerun-io/rerun/assets/1148717/c7f3367e-45d7-4967-9bfe-6ac1cd98c0ad)

* Also closes #6681
* Also includes a better fix for
#6639

### 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 examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6683?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6683?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
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/6683)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
emilk added a commit to emilk/egui_plot that referenced this issue Jul 15, 2024
We would sometimes hit a `debug_assert` when plots were empty

* Closes rerun-io/rerun#6681
hacknus pushed a commit to hacknus/egui that referenced this issue Oct 30, 2024
We would sometimes hit a `debug_assert` when plots were empty

* Closes rerun-io/rerun#6681
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 🦟 regression A thing that used to work in an earlier release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants