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

Layout code panics #5649

Closed
teh-cmc opened this issue Mar 22, 2024 · 2 comments · Fixed by #5650
Closed

Layout code panics #5649

teh-cmc opened this issue Mar 22, 2024 · 2 comments · Fixed by #5650
Assignees
Labels
💣 crash crash, deadlock/freeze, do-no-start 📺 re_viewer affects re_viewer itself
Milestone

Comments

@teh-cmc
Copy link
Member

teh-cmc commented Mar 22, 2024

Didn't do anything particular... I'll come up with a repro later hopefully.

This happened deep into the data APIs branches, which are lagging a bit behind latest main:

7cfa13c3c6738382a4094ba601b5acd19fa6ec4d Show visible time range on all entities of a space view that supports it (#5564)
thread 'main' panicked at 'assertion failed: child_size.x >= 0.0 && child_size.y >= 0.0'
egui/src/layout.rs:600
stack backtrace:
   6: core::panicking::panic_fmt
             at core/src/panicking.rs:72:14
   7: core::panicking::panic
             at core/src/panicking.rs:127:5
   8: egui::layout::Layout::next_frame_ignore_wrap
             at egui/src/layout.rs:600:9
   9: egui::layout::Layout::next_widget_space_ignore_wrap_justify
             at egui/src/layout.rs:658:21
  10: egui::placer::Placer::next_widget_space_ignore_wrap_justify
             at egui/src/placer.rs:214:9
      egui::placer::Placer::set_max_width
             at egui/src/placer.rs:221:20
      egui::ui::Ui::set_max_width
             at egui/src/ui.rs:512:9
  11: re_viewer::ui::welcome_screen::welcome_section::onboarding_content_ui::{{closure}}::{{closure}}::{{closure}}::{{closure}}
             at re_viewer/src/ui/welcome_screen/welcome_section.rs:244:29
      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:2007:9
  13: egui::ui::Ui::with_layout_dyn
             at egui/src/ui.rs:2068:21
  14: egui::ui::Ui::vertical
             at egui/src/ui.rs:1996:9
      re_viewer::ui::welcome_screen::welcome_section::onboarding_content_ui::{{closure}}::{{closure}}::{{closure}}
             at re_viewer/src/ui/welcome_screen/welcome_section.rs:242:25
      core::ops::function::FnOnce::call_once{{vtable.shim}}
             at core/src/ops/function.rs:250:5
  15: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at alloc/src/boxed.rs:2007:9
  16: egui::grid::Grid::show_dyn::{{closure}}::{{closure}}
             at egui/src/grid.rs:450:25
      core::ops::function::FnOnce::call_once{{vtable.shim}}
             at core/src/ops/function.rs:250:5
  17: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at alloc/src/boxed.rs:2007:9
      egui::ui::Ui::allocate_ui_with_layout_dyn
             at egui/src/ui.rs:946:19
  18: egui::ui::Ui::horizontal_with_main_wrap_dyn
             at egui/src/ui.rs:1978:9
  19: egui::ui::Ui::horizontal
             at egui/src/ui.rs:1906:9
      egui::grid::Grid::show_dyn::{{closure}}
             at egui/src/grid.rs:430:16
      egui::ui::Ui::allocate_ui_at_rect
             at egui/src/ui.rs:967:19
  20: egui::grid::Grid::show_dyn
             at egui/src/grid.rs:428:9
  21: egui::grid::Grid::show
             at egui/src/grid.rs:395:9
      re_viewer::ui::welcome_screen::welcome_section::onboarding_content_ui::{{closure}}::{{closure}}
             at re_viewer/src/ui/welcome_screen/welcome_section.rs:225:13
      core::ops::function::FnOnce::call_once{{vtable.shim}}
             at core/src/ops/function.rs:250:5
  22: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at alloc/src/boxed.rs:2007:9
  23: egui::ui::Ui::with_layout_dyn
             at egui/src/ui.rs:2068:21
  24: egui::ui::Ui::vertical
             at egui/src/ui.rs:1996:9
      re_viewer::ui::welcome_screen::welcome_section::onboarding_content_ui::{{closure}}
             at re_viewer/src/ui/welcome_screen/welcome_section.rs:217:9
      core::ops::function::FnOnce::call_once{{vtable.shim}}
             at core/src/ops/function.rs:250:5
  25: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at alloc/src/boxed.rs:2007:9
      egui::ui::Ui::allocate_ui_with_layout_dyn
             at egui/src/ui.rs:946:19
  26: egui::ui::Ui::horizontal_with_main_wrap_dyn
             at egui/src/ui.rs:1978:9
  27: egui::ui::Ui::horizontal
             at egui/src/ui.rs:1906:9
      re_viewer::ui::welcome_screen::welcome_section::onboarding_content_ui
             at re_viewer/src/ui/welcome_screen/welcome_section.rs:209:5
      re_viewer::ui::welcome_screen::welcome_section::welcome_section_ui::{{closure}}
             at re_viewer/src/ui/welcome_screen/welcome_section.rs:118:9
      core::ops::function::FnOnce::call_once{{vtable.shim}}
             at core/src/ops/function.rs:250:5
  28: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at alloc/src/boxed.rs:2007:9
  29: egui::ui::Ui::with_layout_dyn
             at egui/src/ui.rs:2068:21
  30: egui::ui::Ui::vertical
             at egui/src/ui.rs:1996:9
      re_viewer::ui::welcome_screen::welcome_section::welcome_section_ui
             at re_viewer/src/ui/welcome_screen/welcome_section.rs:116:5
      re_viewer::ui::welcome_screen::WelcomeScreen::ui::{{closure}}::{{closure}}
             at re_viewer/src/ui/welcome_screen/mod.rs:48:21
      core::ops::function::FnOnce::call_once{{vtable.shim}}
             at core/src/ops/function.rs:250:5
  31: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at alloc/src/boxed.rs:2007:9
      egui::containers::frame::Frame::show_dyn
             at egui/src/containers/frame.rs:270:19
  32: egui::containers::frame::Frame::show
             at egui/src/containers/frame.rs:261:9
      re_viewer::ui::welcome_screen::WelcomeScreen::ui::{{closure}}
             at re_viewer/src/ui/welcome_screen/mod.rs:38:17
      egui::containers::scroll_area::ScrollArea::show::{{closure}}
             at egui/src/containers/scroll_area.rs:654:61
      core::ops::function::FnOnce::call_once{{vtable.shim}}
             at core/src/ops/function.rs:250:5
  33: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at alloc/src/boxed.rs:2007:9
      egui::containers::scroll_area::ScrollArea::show_viewport_dyn
             at egui/src/containers/scroll_area.rs:726:21
  34: egui::containers::scroll_area::ScrollArea::show
             at egui/src/containers/scroll_area.rs:654:9
      re_viewer::ui::welcome_screen::WelcomeScreen::ui
             at re_viewer/src/ui/welcome_screen/mod.rs:34:9
  35: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at alloc/src/boxed.rs:2007:9
  36: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at alloc/src/boxed.rs:2007:9
      egui::containers::frame::Frame::show_dyn
             at egui/src/containers/frame.rs:270:19
  37: egui::containers::frame::Frame::show
             at egui/src/containers/frame.rs:261:9
      egui::containers::panel::CentralPanel::show_inside_dyn
             at egui/src/containers/panel.rs:1037:15
  38: egui::containers::panel::CentralPanel::show_inside
             at egui/src/containers/panel.rs:1022:9
      re_viewer::app_state::AppState::show::{{closure}}
             at re_viewer/src/app_state.rs:366:17
      core::ops::function::FnOnce::call_once{{vtable.shim}}
             at core/src/ops/function.rs:250:5
  39: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at alloc/src/boxed.rs:2007:9
  40: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at alloc/src/boxed.rs:2007:9
      egui::containers::frame::Frame::show_dyn
             at egui/src/containers/frame.rs:270:19
  41: egui::containers::frame::Frame::show
             at egui/src/containers/frame.rs:261:9
      egui::containers::panel::CentralPanel::show_inside_dyn
             at egui/src/containers/panel.rs:1037:15
  42: egui::containers::panel::CentralPanel::show_inside
             at egui/src/containers/panel.rs:1022:9
      re_viewer::app_state::AppState::show
             at re_viewer/src/app_state.rs:321:9
  43: re_viewer::app::App::ui::{{closure}}
             at re_viewer/src/app.rs:882:25
      core::ops::function::FnOnce::call_once{{vtable.shim}}
             at core/src/ops/function.rs:250:5
  44: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at alloc/src/boxed.rs:2007:9
  45: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at alloc/src/boxed.rs:2007:9
      egui::containers::frame::Frame::show_dyn
             at egui/src/containers/frame.rs:270:19
  46: egui::containers::frame::Frame::show
             at egui/src/containers/frame.rs:261:9
      egui::containers::panel::CentralPanel::show_inside_dyn
             at egui/src/containers/panel.rs:1037:15
  47: egui::containers::panel::CentralPanel::show_dyn
             at egui/src/containers/panel.rs:1065:30
  48: egui::containers::panel::CentralPanel::show
             at egui/src/containers/panel.rs:1049:9
      re_viewer::app::App::ui
             at re_viewer/src/app.rs:831:9
      <re_viewer::app::App as eframe::epi::App>::update
             at re_viewer/src/app.rs:1355:9
  49: <extend_viewer_ui::MyApp as eframe::epi::App>::update
             at extend_viewer_ui/src/main.rs:84:9
  50: eframe::native::epi_integration::EpiIntegration::update::{{closure}}
             at eframe/src/native/epi_integration.rs:286:17
      egui::context::Context::run
             at egui/src/context.rs:750:9
  51: eframe::native::epi_integration::EpiIntegration::update
             at eframe/src/native/epi_integration.rs:279:27
  52: eframe::native::wgpu_integration::WgpuWinitRunning::run_ui_and_paint
             at eframe/src/native/wgpu_integration.rs:634:27
      <eframe::native::wgpu_integration::WgpuWinitApp as eframe::native::winit_integration::WinitApp>::run_ui_and_paint
             at eframe/src/native/wgpu_integration.rs:397:13
  53: eframe::native::run::run_and_return::{{closure}}
             at eframe/src/native/run.rs:99:17
      core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
             at core/src/ops/function.rs:294:13
  54: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
             at core/src/ops/function.rs:294:13
      winit::platform_impl::platform::x11::EventLoop<T>::single_iteration
             at winit-0.29.9/src/platform_impl/linux/x11/mod.rs:608:17
      winit::platform_impl::platform::x11::EventLoop<T>::poll_events_with_timeout
             at winit-0.29.9/src/platform_impl/linux/x11/mod.rs:547:9
      winit::platform_impl::platform::x11::EventLoop<T>::pump_events
             at winit-0.29.9/src/platform_impl/linux/x11/mod.rs:453:13
      winit::platform_impl::platform::x11::EventLoop<T>::run_on_demand
             at winit-0.29.9/src/platform_impl/linux/x11/mod.rs:414:19
      winit::platform_impl::platform::EventLoop<T>::run_on_demand
             at winit-0.29.9/src/platform_impl/linux/mod.rs:821:56
  55: <winit::event_loop::EventLoop<T> as winit::platform::run_on_demand::EventLoopExtRunOnDemand>::run_on_demand
             at winit-0.29.9/src/platform/run_on_demand.rs:80:9
      eframe::native::run::run_and_return
             at eframe/src/native/run.rs:76:5
      eframe::native::run::run_wgpu::{{closure}}
             at eframe/src/native/run.rs:423:13
      eframe::native::run::with_event_loop::{{closure}}
             at eframe/src/native/run.rs:58:12
      std::thread::local::LocalKey<T>::try_with
             at std/src/thread/local.rs:270:16
      std::thread::local::LocalKey<T>::with
             at std/src/thread/local.rs:246:9
      eframe::native::run::with_event_loop
             at eframe/src/native/run.rs:48:16
      eframe::native::run::run_wgpu
             at eframe/src/native/run.rs:421:16
      eframe::run_native
             at eframe/src/lib.rs:268:13
  56: extend_viewer_ui::main::{{closure}}
             at extend_viewer_ui/src/main.rs:43:5
      tokio::runtime::park::CachedParkThread::block_on::{{closure}}
             at tokio-1.28.1/src/runtime/park.rs:283:63
      tokio::runtime::coop::with_budget
             at tokio-1.28.1/src/runtime/coop.rs:107:5
      tokio::runtime::coop::budget
             at tokio-1.28.1/src/runtime/coop.rs:73:5
      tokio::runtime::park::CachedParkThread::block_on
             at tokio-1.28.1/src/runtime/park.rs:283:31
  57: tokio::runtime::context::BlockingRegionGuard::block_on
             at tokio-1.28.1/src/runtime/context.rs:315:13
      tokio::runtime::scheduler::multi_thread::MultiThread::block_on
             at tokio-1.28.1/src/runtime/scheduler/multi_thread/mod.rs:68:14
  58: tokio::runtime::runtime::Runtime::block_on
             at tokio-1.28.1/src/runtime/runtime.rs:304:45
@teh-cmc teh-cmc added 📺 re_viewer affects re_viewer itself 💣 crash crash, deadlock/freeze, do-no-start labels Mar 22, 2024
@emilk emilk added this to the 0.15 milestone Mar 22, 2024
@emilk
Copy link
Member

emilk commented Mar 22, 2024

It’s hard to tell, but this is actually a assert that is only on debug builds. Still, it indicates that there is some UI that is smaller than zero, which probably means a layout bug

@Wumpf
Copy link
Member

Wumpf commented Mar 22, 2024

looking at the code a bit that figures out the min width that the assert is stumbling on, isn't bounded despite a bound being defined - pushing a speculative fix that will make clear what I mean

@Wumpf Wumpf self-assigned this Mar 22, 2024
Wumpf added a commit that referenced this issue Mar 22, 2024
…ebug assertion (#5650)

### What

* Fixes #5649

~This is a speculative fix, didn't have a repro.~ From the callstack we
know that a certain `ui.set_max_width(column_width - 8.0);` might have
gotten a too small width. Looking at how `column_width` is produced this
may very well happen if for some reason there's very little
`available_width`.

### 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/5650/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/5650/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/5650/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
* [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/5650)
- [Docs
preview](https://rerun.io/preview/4207de64817bf7002b8ff271b8a875ab63f62b23/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/4207de64817bf7002b8ff271b8a875ab63f62b23/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
💣 crash crash, deadlock/freeze, do-no-start 📺 re_viewer affects re_viewer itself
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants