BVE-Reborn / rend3

MAINTENCE MODE ---- Easy to use, customizable, efficient 3D renderer library built on wgpu.
https://rend3.rs
Apache License 2.0
1.08k stars 59 forks source link

Index error panic #546

Open John-Nagle opened 11 months ago

John-Nagle commented 11 months ago
05:56:48 [ERROR] =========> Panic assertion failed: (i == 0 || self.free_ranges[i - 1].end < range.start) &&\n    (i >= self.free_ranges.len() || range.end < self.free_ranges[i].start) at file /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/range-alloc-0.1.3/src/lib.rs, line 133 in thread main.
Backtrace:
 libcommon::common::commonutils::catch_panic::{{closure}}
             at /home/john/projects/sl/SL-test-viewer/libcommon/src/common/commonutils.rs:215:25
 range_alloc::RangeAllocator<T>::free_range
             at /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/range-alloc-0.1.3/src/lib.rs:133:9
 rend3::managers::mesh::MeshManager::remove
             at /home/john/.cargo/git/checkouts/rend3-e03f89403de3386a/9065f1e/rend3/src/managers/mesh.rs:220:13
 rend3::renderer::eval::evaluate_instructions
             at /home/john/.cargo/git/checkouts/rend3-e03f89403de3386a/9065f1e/rend3/src/renderer/eval.rs:134:21
 rend3::renderer::Renderer::evaluate_instructions
             at /home/john/.cargo/git/checkouts/rend3-e03f89403de3386a/9065f1e/rend3/src/renderer/mod.rs:457:9
 <sharpview::AppUi as rend3_framework::App>::handle_event
             at /home/john/projects/sl/SL-test-viewer/sharpview/src/main.rs:555:39
 rend3_framework::async_start::{{closure}}::{{closure}}
             at /home/john/.cargo/git/checkouts/rend3-e03f89403de3386a/9065f1e/rend3-framework/src/lib.rs:338:9
 winit::platform_impl::platform::sticky_exit_callback
             at /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.28.7/src/platform_impl/linux/mod.rs:884:9
 winit::platform_impl::platform::x11::EventLoop<T>::run_return::single_iteration
             at /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.28.7/src/platform_impl/linux/x11/mod.rs:375:21
 winit::platform_impl::platform::x11::EventLoop<T>::run_return
             at /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.28.7/src/platform_impl/linux/x11/mod.rs:483:27

Until recently, I didn't change the meshes for existing objects much. Now, I'm creating and releasing meshes and objects at a high rate as the viewpoint moves around, for level of detail management purposes. So Rend3 is being exercised in a new way.

John-Nagle commented 11 months ago
06:07:16 [ERROR] =========> Panic assertion failed: (i == 0 || self.free_ranges[i - 1].end < range.start) &&\n    (i >= self.free_ranges.len() || range.end < self.free_ranges[i].start) at file /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/range-alloc-0.1.3/src/lib.rs, line 133 in thread main.
Backtrace:
 libcommon::common::commonutils::catch_panic::{{closure}}
             at /home/john/projects/sl/SL-test-viewer/libcommon/src/common/commonutils.rs:215:25
 range_alloc::RangeAllocator<T>::free_range
             at /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/range-alloc-0.1.3/src/lib.rs:133:9
 rend3::managers::mesh::MeshManager::remove
             at /home/john/.cargo/git/checkouts/rend3-e03f89403de3386a/9065f1e/rend3/src/managers/mesh.rs:220:13
 rend3::renderer::eval::evaluate_instructions
             at /home/john/.cargo/git/checkouts/rend3-e03f89403de3386a/9065f1e/rend3/src/renderer/eval.rs:134:21
 rend3::renderer::Renderer::evaluate_instructions
             at /home/john/.cargo/git/checkouts/rend3-e03f89403de3386a/9065f1e/rend3/src/renderer/mod.rs:457:9
 <sharpview::AppUi as rend3_framework::App>::handle_event
             at /home/john/projects/sl/SL-test-viewer/sharpview/src/main.rs:555:39
 rend3_framework::async_start::{{closure}}::{{closure}}
             at /home/john/.cargo/git/checkouts/rend3-e03f89403de3386a/9065f1e/rend3-framework/src/lib.rs:338:9
 winit::platform_impl::platform::sticky_exit_callback
             at /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.28.7/src/platform_impl/linux/mod.rs:884:9
 winit::platform_impl::platform::x11::EventLoop<T>::run_return::single_iteration
             at /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.28.7/src/platform_impl/linux/x11/mod.rs:375:21
 winit::platform_impl::platform::x11::EventLoop<T>::run_return
             at /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.28.7/src/platform_impl/linux/x11/mod.rs:483:27

Another one of the same. It's intermittent, but not a one-off.

Rend3 rev = "9065f1e"

John-Nagle commented 11 months ago
08:07:47 [ERROR] =========> Panic assertion failed: (i == 0 || self.free_ranges[i - 1].end < range.start) &&\n    (i >= self.free_ranges.len() || range.end < self.free_ranges[i].start) at file /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/range-alloc-0.1.3/src/lib.rs, line 133 in thread main.
Backtrace:
 libcommon::common::commonutils::catch_panic::{{closure}}
             at /home/john/projects/sl/SL-test-viewer/libcommon/src/common/commonutils.rs:215:25
 range_alloc::RangeAllocator<T>::free_range
             at /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/range-alloc-0.1.3/src/lib.rs:133:9
 rend3::managers::mesh::MeshManager::remove
             at /home/john/.cargo/git/checkouts/rend3-e03f89403de3386a/a68c76a/rend3/src/managers/mesh.rs:217:13
 rend3::renderer::eval::evaluate_instructions
             at /home/john/.cargo/git/checkouts/rend3-e03f89403de3386a/a68c76a/rend3/src/renderer/eval.rs:133:21
 rend3::renderer::Renderer::evaluate_instructions
             at /home/john/.cargo/git/checkouts/rend3-e03f89403de3386a/a68c76a/rend3/src/renderer/mod.rs:482:9
 <sharpview::AppUi as rend3_framework::App>::handle_redraw
             at /home/john/projects/sl/SL-test-viewer/sharpview/src/main.rs:662:31
 rend3_framework::async_start::{{closure}}::{{closure}}
             at /home/john/.cargo/git/checkouts/rend3-e03f89403de3386a/a68c76a/rend3-framework/src/lib.rs:354:17
 winit::platform_impl::platform::x11::EventLoop<T>::single_iteration
             at /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.8/src/platform_impl/linux/x11/mod.rs:608:17
 winit::platform_impl::platform::x11::EventLoop<T>::poll_events_with_timeout
             at /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.8/src/platform_impl/linux/x11/mod.rs:547:9
 winit::platform_impl::platform::x11::EventLoop<T>::pump_events
             at /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.8/src/platform_impl/linux/x11/mod.rs:453:13

This time with the fully arcanized version. rev = "a68c76a".

John-Nagle commented 10 months ago

These occur frequently now in complex scenes. rev = "a68c76a", which I now know is not arcanized.

John-Nagle commented 9 months ago

Still fails in arcanized version rev = "c7c2d85":

Panic assertion failed: (i == 0 || self.free_ranges[i - 1].end < range.start) && (i >= self.free_ranges.len() || range.end < self.free_ranges[i].start) at file /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/range-alloc-0.1.3/src/lib.rs, line 133 in thread main. Backtrace: libcommon::common::commonutils::catch_panic::{{closure}} at /home/john/projects/sl/SL-test-viewer/libcommon/src/common/commonutils.rs:215:25 range_alloc::RangeAllocator::free_range at /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/range-alloc-0.1.3/src/lib.rs:133:9 rend3::managers::mesh::MeshManager::remove at /home/john/.cargo/git/checkouts/rend3-e03f89403de3386a/c7c2d85/rend3/src/managers/mesh.rs:217:13 rend3::renderer::eval::evaluate_instructions at /home/john/.cargo/git/checkouts/rend3-e03f89403de3386a/c7c2d85/rend3/src/renderer/eval.rs:137:21 rend3::renderer::Renderer::evaluate_instructions at /home/john/.cargo/git/checkouts/rend3-e03f89403de3386a/c7c2d85/rend3/src/renderer/mod.rs:482:9

::handle_redraw at /home/john/projects/sl/SL-test-viewer/sharpview/src/main.rs:656:31 rend3_framework::async_start::{{closure}}::{{closure}} at /home/john/.cargo/git/checkouts/rend3-e03f89403de3386a/c7c2d85/rend3-framework/src/lib.rs:355:17 winit::platform_impl::platform::x11::EventLoop::single_iteration at /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/linux/x11/mod.rs:608:17 winit::platform_impl::platform::x11::EventLoop::poll_events_with_timeout at /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/linux/x11/mod.rs:547:9 winit::platform_impl::platform::x11::EventLoop::pump_events at /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/linux/x11/mod.rs:453:13
John-Nagle commented 6 months ago

https://github.com/gfx-rs/range-alloc/issues/1 seems to fix this. Survived 8 hours of testing so far. Never got past 2.5 hours before. I'll let it run overnight.