vengi-voxel / vengi

free and open source voxel art tools - editor, thumbnailer and format converter
http://vengi-voxel.github.io/vengi/
Other
1.05k stars 87 forks source link

VOXEDIT: assert in redo action #479

Open mgerhardy opened 3 days ago

mgerhardy commented 3 days ago

imported chr_knight2 - undo until only one node is left in the scene, redo to trigger the assert

INFO: (0) Load file Knight 2.vengi with 9 model nodes and 0 point nodes
ERROR: (0) No node for id 4 found in the scene graph - returning root node
ERROR: (0) Stack trace (most recent call last):
ERROR: (0) #24   Object "", at 0xffffffffffffffff, in 
ERROR: (0) #23   Object "/home/mgerhardy/dev/oss/engine/build/voxedit/vengi-voxedit", at 0x55bb8ee2fcf0, in _start
ERROR: (0) #22   Source "../csu/libc-start.c:360", in __libc_start_main_impl
ERROR: (0) #21   Source "../sysdeps/nptl/libc_start_call_main.h:58", in __libc_start_call_main
ERROR: (0) #20   Source "/home/mgerhardy/dev/oss/engine/src/tools/voxedit/VoxEditMain.cpp:16", in main
ERROR: (0)          13:     const voxelcollection::CollectionManagerPtr &collectionMgr =
ERROR: (0)          14:         core::make_shared<voxelcollection::CollectionManager>(filesystem, texturePool);
ERROR: (0)          15:     VoxEdit app(filesystem, timeProvider, sceneMgr, collectionMgr, texturePool);
ERROR: (0)       >  16:     return app.startMainLoop(argc, argv);
ERROR: (0)          17: }
ERROR: (0) #19   Source "/home/mgerhardy/dev/oss/engine/src/modules/app/App.cpp:204", in startMainLoop
ERROR: (0)         201:     emscripten_set_main_loop(runFrameEmscripten, 0, 1);
ERROR: (0)         202: #else
ERROR: (0)         203:     while (AppState::InvalidAppState != _curState) {
ERROR: (0)       > 204:         onFrame();
ERROR: (0)         205:     }
ERROR: (0)         206: #endif
ERROR: (0)         207:     return _exitCode;
ERROR: (0) #18   Source "/home/mgerhardy/dev/oss/engine/src/modules/app/App.cpp:372", in onFrame
ERROR: (0)         369:                 core_trace_scoped(AppOnBeforeRunning);
ERROR: (0)         370:                 onBeforeRunning();
ERROR: (0)         371:             }
ERROR: (0)       > 372:             const AppState state = onRunning();
ERROR: (0)         373:             if (_nextState != AppState::Cleanup && _nextState != AppState::Destroy) {
ERROR: (0)         374:                 _nextState = state;
ERROR: (0)         375:             }
ERROR: (0) #17   Source "/home/mgerhardy/dev/oss/engine/src/tools/voxedit/VoxEdit.cpp:536", in onRunning
ERROR: (0)         533: }
ERROR: (0)         534: 
ERROR: (0)         535: app::AppState VoxEdit::onRunning() {
ERROR: (0)       > 536:     app::AppState state = Super::onRunning();
ERROR: (0)         537:     if (state != app::AppState::Running) {
ERROR: (0)         538:         return state;
ERROR: (0)         539:     }
ERROR: (0) #16   Source "/home/mgerhardy/dev/oss/engine/src/modules/ui/IMGUIApp.cpp:635", in onRunning
ERROR: (0)         632:     const bool renderUI = _renderUI->boolVal();
ERROR: (0)         633:     if (renderUI) {
ERROR: (0)         634:         core_trace_scoped(IMGUIAppOnRenderUI);
ERROR: (0)       > 635:         onRenderUI();
ERROR: (0)         636:         if (_showConsole) {
ERROR: (0)         637:             _console.render(_lastExecutedCommand);
ERROR: (0)         638:         }
ERROR: (0) #15   Source "/home/mgerhardy/dev/oss/engine/src/tools/voxedit/VoxEdit.cpp:532", in onRenderUI
ERROR: (0)         529:     if (_sceneMgr->update(_nowSeconds)) {
ERROR: (0)         530:         _mainWindow->onNewScene();
ERROR: (0)         531:     }
ERROR: (0)       > 532:     _mainWindow->update();
ERROR: (0)         533: }
ERROR: (0)         534: 
ERROR: (0)         535: app::AppState VoxEdit::onRunning() {
ERROR: (0) #14   Source "/home/mgerhardy/dev/oss/engine/src/tools/voxedit/modules/voxedit-ui/MainWindow.cpp:1014", in update
ERROR: (0)        1011:     ImGui::DockSpace(dockIdMain);
ERROR: (0)        1012: 
ERROR: (0)        1013:     leftWidget();
ERROR: (0)       >1014:     mainWidget();
ERROR: (0)        1015:     rightWidget();
ERROR: (0)        1016: 
ERROR: (0)        1017:     registerPopups();
ERROR: (0) #13   Source "/home/mgerhardy/dev/oss/engine/src/tools/voxedit/modules/voxedit-ui/MainWindow.cpp:430", in mainWidget
ERROR: (0)         427:     }
ERROR: (0)         428:     command::CommandExecutionListener &listener = _app->commandListener();
ERROR: (0)         429:     for (size_t i = 0; i < _scenes.size(); ++i) {
ERROR: (0)       > 430:         _scenes[i]->update(&listener);
ERROR: (0)         431:     }
ERROR: (0)         432: #if ENABLE_RENDER_PANEL
ERROR: (0)         433:     _renderPanel.update(TITLE_RENDER, _sceneMgr->sceneGraph());
ERROR: (0) #12   Source "/home/mgerhardy/dev/oss/engine/src/tools/voxedit/modules/voxedit-ui/Viewport.cpp:412", in update
ERROR: (0)         409:     if (ImGui::Begin(name.c_str(), nullptr, sceneWindowFlags)) {
ERROR: (0)         410:         _visible = true;
ERROR: (0)         411:         renderMenuBar(listener);
ERROR: (0)       > 412:         renderViewport();
ERROR: (0)         413:     }
ERROR: (0)         414:     ImGui::End();
ERROR: (0) #11   Source "/home/mgerhardy/dev/oss/engine/src/tools/voxedit/modules/voxedit-ui/Viewport.cpp:218", in renderViewport
ERROR: (0)         215:     if (setupFrameBuffer(contentSize)) {
ERROR: (0)         216:         _camera.update(_app->deltaFrameSeconds());
ERROR: (0)         217: 
ERROR: (0)       > 218:         renderToFrameBuffer();
ERROR: (0)         219:         renderViewportImage(contentSize);
ERROR: (0)         220:         const bool modifiedRegion = renderGizmo(camera(), headerSize, contentSize);
ERROR: (0) #10   Source "/home/mgerhardy/dev/oss/engine/src/tools/voxedit/modules/voxedit-ui/Viewport.cpp:783", in renderToFrameBuffer
ERROR: (0)         780: void Viewport::renderToFrameBuffer() {
ERROR: (0)         781:     core_trace_scoped(EditorSceneRenderFramebuffer);
ERROR: (0)         782:     video::clearColor(core::Color::Clear());
ERROR: (0)       > 783:     _sceneMgr->render(_renderContext, camera());
ERROR: (0)         784: }
ERROR: (0)         785: 
ERROR: (0)         786: } // namespace voxedit
ERROR: (0) #9    Source "/home/mgerhardy/dev/oss/engine/src/tools/voxedit/modules/voxedit-util/SceneManager.cpp:1555", in render
ERROR: (0)        1553:     const bool renderScene = (renderMask & RenderScene) != 0u;
ERROR: (0)        1554:     if (renderScene) {
ERROR: (0)       >1555:         _sceneRenderer->renderScene(renderContext, camera);
ERROR: (0)        1556:     }
ERROR: (0)        1557:     const bool renderUI = (renderMask & RenderUI) != 0u;
ERROR: (0)        1558:     if (renderUI) {
ERROR: (0) #8    Source "/home/mgerhardy/dev/oss/engine/src/tools/voxedit/modules/voxedit-util/SceneRenderer.cpp:295", in renderScene
ERROR: (0)         292:     renderContext.grayInactive = _grayInactive->boolVal();
ERROR: (0)         293: 
ERROR: (0)         294:     video::ScopedState depthTest(video::State::DepthTest, true);
ERROR: (0)       > 295:     updateAABBMesh(renderContext.sceneMode, *renderContext.sceneGraph, renderContext.frame);
ERROR: (0)         296:     updateBoneMesh(renderContext.sceneMode, *renderContext.sceneGraph, renderContext.frame);
ERROR: (0)         297:     _volumeRenderer.render(renderContext, camera, _renderShadow->boolVal(), false);
ERROR: (0)         298:     extractVolume(*renderContext.sceneGraph);
ERROR: (0) #7    Source "/home/mgerhardy/dev/oss/engine/src/tools/voxedit/modules/voxedit-util/SceneRenderer.cpp:197", in updateAABBMesh
ERROR: (0)         194:         const voxel::Region &region = sceneGraph.resolveRegion(node);
ERROR: (0)         195:         const glm::vec3 pivot = node.pivot();
ERROR: (0)         196:         const scenegraph::FrameTransform &transform = sceneGraph.transformForFrame(node, frameIdx);
ERROR: (0)       > 197:         const math::OBB<float>& obb = toOBB(true, region, pivot, transform);
ERROR: (0)         198:         // TODO: make this an aabb and use the transform matrix from the rawvolumerenderer
ERROR: (0)         199:         _shapeBuilder.obb(obb);
ERROR: (0)         200:     }
ERROR: (0) #6    Source "/home/mgerhardy/dev/oss/engine/src/tools/voxedit/modules/voxedit-util/SceneUtil.cpp:18", in toOBB
ERROR: (0)          15: }
ERROR: (0)          16: 
ERROR: (0)          17: math::OBB<float> toOBB(bool sceneMode, const voxel::Region &region, const glm::vec3 &normalizedPivot, const scenegraph::FrameTransform &transform) {
ERROR: (0)       >  18:     core_assert(region.isValid());
ERROR: (0)          19:     if (sceneMode) {
ERROR: (0)          20:         const glm::vec3 pivot =
ERROR: (0)          21:             (normalizedPivot - 0.5f) * glm::vec3(region.getDimensionsInVoxels()) - region.getLowerCornerf();
ERROR: (0) #5    Source "/home/mgerhardy/dev/oss/engine/src/modules/core/Assert.cpp:51", in core_report_assert
ERROR: (0)          48: }
ERROR: (0)          49: 
ERROR: (0)          50: bool core_report_assert(AssertData &data, const char *file, int line, const char *function) {
ERROR: (0)       >  51:     const SDL_AssertState state = SDL_ReportAssertion((SDL_AssertData *)&data, function, file, line);
ERROR: (0)          52:     if (state == SDL_ASSERTION_RETRY) {
ERROR: (0)          53:         return true;
ERROR: (0)          54:     }
ERROR: (0) #4    Object "/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.3000.3", at 0x7feb20435e2b, in 
ERROR: (0) #3    Source "/home/mgerhardy/dev/oss/engine/src/modules/core/Assert.cpp:28", in coreAssertionHandler
ERROR: (0)          26: static SDL_assert_state coreAssertionHandler(const SDL_assert_data *data, void *userdata) {
ERROR: (0)          27:     if (data->trigger_count <= 1 && data->always_ignore == 0) {
ERROR: (0)       >  28:         core_stacktrace();
ERROR: (0)          29:     }
ERROR: (0)          30:     const SDL_AssertState state = SDL_GetDefaultAssertionHandler()(data, userdata);
ERROR: (0)          31:     if (state == SDL_ASSERTION_RETRY) {
ERROR: (0) #2    Source "/home/mgerhardy/dev/oss/engine/src/modules/core/Assert.cpp:113", in core_stacktrace
ERROR: (0)         110: #elif defined(HAVE_BACKWARD)
ERROR: (0)         111:     std::ostringstream os;
ERROR: (0)         112:     backward::StackTrace st;
ERROR: (0)       > 113:     st.load_here(32);
ERROR: (0)         114:     backward::Printer printer;
ERROR: (0)         115:     printer.print(st, os);
ERROR: (0)         116:     std::string str = os.str();
ERROR: (0) #1    Source "/home/mgerhardy/dev/oss/engine/contrib/libs/backward/backward.h:879", in load_here
ERROR: (0)         876:       return 0;
ERROR: (0)         877:     }
ERROR: (0)         878:     _stacktrace.resize(depth);
ERROR: (0)       > 879:     size_t trace_cnt = details::unwind(callback(*this), depth);
ERROR: (0)         880:     _stacktrace.resize(trace_cnt);
ERROR: (0)         881:     skip_n_firsts(0);
ERROR: (0)         882:     return size();
ERROR: (0) #0    Source "/home/mgerhardy/dev/oss/engine/contrib/libs/backward/backward.h:861", in unwind<backward::StackTraceImpl<backward::system_tag::linux_tag>::callback>
ERROR: (0)         859: template <typename F> size_t unwind(F f, size_t depth) {
ERROR: (0)         860:   Unwinder<F> unwinder;
ERROR: (0)       > 861:   return unwinder(f, depth);
ERROR: (0)         862: }
ERROR: (0)         863: 
ERROR: (0)         864: } // namespace details
WARN: 

Assertion failure at toOBB (/home/mgerhardy/dev/oss/engine/src/tools/voxedit/modules/voxedit-util/SceneUtil.cpp:18), triggered 1 time:
  'region.isValid()'
mgerhardy commented 3 days ago

This one is in undo after rotating three time around y (but with unpublished code that also modified the transforms)

INFO: (0) Load file Robo.vengi with 10 model nodes and 0 point nodes
ERROR: (0) Stack trace (most recent call last):
ERROR: (0) #31   Source "/home/mgerhardy/dev/oss/engine/src/modules/app/App.cpp:204", in startMainLoop
ERROR: (0)         201:     emscripten_set_main_loop(runFrameEmscripten, 0, 1);
ERROR: (0)         202: #else
ERROR: (0)         203:     while (AppState::InvalidAppState != _curState) {
ERROR: (0)       > 204:         onFrame();
ERROR: (0)         205:     }
ERROR: (0)         206: #endif
ERROR: (0)         207:     return _exitCode;
ERROR: (0) #30   Source "/home/mgerhardy/dev/oss/engine/src/modules/app/App.cpp:372", in onFrame
ERROR: (0)         369:                 core_trace_scoped(AppOnBeforeRunning);
ERROR: (0)         370:                 onBeforeRunning();
ERROR: (0)         371:             }
ERROR: (0)       > 372:             const AppState state = onRunning();
ERROR: (0)         373:             if (_nextState != AppState::Cleanup && _nextState != AppState::Destroy) {
ERROR: (0)         374:                 _nextState = state;
ERROR: (0)         375:             }
ERROR: (0) #29   Source "/home/mgerhardy/dev/oss/engine/src/tools/voxedit/VoxEdit.cpp:536", in onRunning
ERROR: (0)         533: }
ERROR: (0)         534: 
ERROR: (0)         535: app::AppState VoxEdit::onRunning() {
ERROR: (0)       > 536:     app::AppState state = Super::onRunning();
ERROR: (0)         537:     if (state != app::AppState::Running) {
ERROR: (0)         538:         return state;
ERROR: (0)         539:     }
ERROR: (0) #28   Source "/home/mgerhardy/dev/oss/engine/src/modules/ui/IMGUIApp.cpp:594", in onRunning
ERROR: (0)         592: app::AppState IMGUIApp::onRunning() {
ERROR: (0)         593:     core_trace_scoped(IMGUIAppOnRunning);
ERROR: (0)       > 594:     app::AppState state = Super::onRunning();
ERROR: (0)         595: 
ERROR: (0)         596:     if (state != app::AppState::Running) {
ERROR: (0)         597:         return state;
ERROR: (0) #27   Source "/home/mgerhardy/dev/oss/engine/src/modules/video/WindowedApp.cpp:139", in onRunning
ERROR: (0)         136:         }
ERROR: (0)         137:     }
ERROR: (0)         138:     while (SDL_PollEvent(&event)) {
ERROR: (0)       > 139:         quit |= handleSDLEvent(event);
ERROR: (0)         140:     }
ERROR: (0)         141: 
ERROR: (0)         142:     if (quit) {
ERROR: (0) #26   Source "/home/mgerhardy/dev/oss/engine/src/modules/ui/IMGUIApp.cpp:146", in handleSDLEvent
ERROR: (0)         143: }
ERROR: (0)         144: 
ERROR: (0)         145: bool IMGUIApp::handleSDLEvent(SDL_Event &event) {
ERROR: (0)       > 146:     const bool state = Super::handleSDLEvent(event);
ERROR: (0)         147:     if (event.type != SDL_MOUSEMOTION && event.type != SDL_MOUSEWHEEL && event.type != SDL_MOUSEBUTTONUP &&
ERROR: (0)         148:         event.type != SDL_MOUSEBUTTONDOWN && event.type != SDL_TEXTINPUT && event.type != SDL_KEYUP &&
ERROR: (0)         149:         event.type != SDL_KEYDOWN) {
ERROR: (0) #25   Source "/home/mgerhardy/dev/oss/engine/src/modules/video/WindowedApp.cpp:95", in handleSDLEvent
ERROR: (0)          92:         // fallthrough
ERROR: (0)          93:     default: {
ERROR: (0)          94:         core_trace_scoped(WindowedAppEventHandler);
ERROR: (0)       >  95:         const bool running = core::Singleton<video::EventHandler>::getInstance().handleEvent(event);
ERROR: (0)          96:         if (!running) {
ERROR: (0)          97:             return true;
ERROR: (0)          98:         }
ERROR: (0) #24   Source "/home/mgerhardy/dev/oss/engine/src/modules/video/EventHandler.cpp:60", in handleEvent
ERROR: (0)          57:         keyRelease((int32_t) event.key.keysym.sym, (int16_t) event.key.keysym.mod);
ERROR: (0)          58:         break;
ERROR: (0)          59:     case SDL_KEYDOWN:
ERROR: (0)       >  60:         keyPress((int32_t) event.key.keysym.sym, (int16_t) event.key.keysym.mod);
ERROR: (0)          61:         break;
ERROR: (0)          62:     case SDL_MOUSEMOTION: {
ERROR: (0)          63:         if (event.motion.which == SDL_TOUCH_MOUSEID) {
ERROR: (0) #23   Source "/home/mgerhardy/dev/oss/engine/src/modules/video/EventHandler.cpp:343", in keyPress
ERROR: (0)         341: void EventHandler::keyPress(int32_t key, int16_t modifier) {
ERROR: (0)         342:     for (IEventObserver* observer : _observers) {
ERROR: (0)       > 343:         observer->onKeyPress(key, modifier);
ERROR: (0)         344:     }
ERROR: (0)         345: }
ERROR: (0) #22   Source "/home/mgerhardy/dev/oss/engine/src/modules/ui/IMGUIApp.cpp:119", in onKeyPress
ERROR: (0)         116: }
ERROR: (0)         117: 
ERROR: (0)         118: bool IMGUIApp::onKeyPress(int32_t key, int16_t modifier) {
ERROR: (0)       > 119:     if (!Super::onKeyPress(key, modifier) ||
ERROR: (0)         120:         (core::bindingContext() == core::BindingContext::UI && key == SDLK_ESCAPE)) {
ERROR: (0)         121:         SDL_Event ev{};
ERROR: (0)         122:         ev.type = SDL_KEYDOWN;
ERROR: (0) #21   Source "/home/mgerhardy/dev/oss/engine/src/modules/video/WindowedApp.cpp:245", in onKeyPress
ERROR: (0)         242: }
ERROR: (0)         243: 
ERROR: (0)         244: bool WindowedApp::onKeyPress(int32_t key, int16_t modifier) {
ERROR: (0)       > 245:     return handleKeyPress(key, modifier);
ERROR: (0)         246: }
ERROR: (0)         247: 
ERROR: (0)         248: core::String WindowedApp::getKeyBindingsString(const char *cmd) const {
ERROR: (0) #20   Source "/home/mgerhardy/dev/oss/engine/src/modules/video/WindowedApp.cpp:214", in handleKeyPress
ERROR: (0)         211: }
ERROR: (0)         212: 
ERROR: (0)         213: bool WindowedApp::handleKeyPress(int32_t key, int16_t modifier, uint16_t count) {
ERROR: (0)       > 214:     return _keybindingHandler.execute(key, modifier, true, nowSeconds(), count);
ERROR: (0)         215: }
ERROR: (0)         216: 
ERROR: (0)         217: bool WindowedApp::onMouseWheel(float x, float y) {
ERROR: (0) #19   Source "/home/mgerhardy/dev/oss/engine/src/modules/util/KeybindingHandler.cpp:469", in execute
ERROR: (0)         466:                 }
ERROR: (0)         467:             }
ERROR: (0)         468:         }
ERROR: (0)       > 469:         const bool retVal = executeCommands(key, modifier, nowSeconds, count);
ERROR: (0)         470:         if (retVal) {
ERROR: (0)         471:             _pressedModifierMask |= (uint32_t)code;
ERROR: (0)         472:         }
ERROR: (0) #18   Source "/home/mgerhardy/dev/oss/engine/src/modules/util/KeybindingHandler.cpp:111", in executeCommands
ERROR: (0)         109: bool KeyBindingHandler::executeCommands(int32_t key, int16_t modifier, double nowSeconds, uint16_t count) {
ERROR: (0)         110:     // first try to find an exact match of key and current held modifiers
ERROR: (0)       > 111:     if (executeCommandsForBinding(_bindings, key, modifier, nowSeconds, count)) {
ERROR: (0)         112:         return true;
ERROR: (0)         113:     }
ERROR: (0)         114:     // if no such exact match was found, try to remove those modifiers that should be ignored because they e.g. have their own bound command
ERROR: (0) #17   Source "/home/mgerhardy/dev/oss/engine/src/modules/util/KeybindingHandler.cpp:99", in executeCommandsForBinding
ERROR: (0)          96:             Log::trace("Failed to execute the tracking command %s", command.c_str());
ERROR: (0)          97:             continue;
ERROR: (0)          98:         }
ERROR: (0)       >  99:         if (command::Command::execute(command)) {
ERROR: (0)         100:             Log::trace("The command was executed");
ERROR: (0)         101:             handled = true;
ERROR: (0)         102:         } else {
ERROR: (0) #16   Source "/home/mgerhardy/dev/oss/engine/src/modules/command/Command.cpp:154", in execute
ERROR: (0)         151:             args.push_back(commandTokenizer.next());
ERROR: (0)         152:             Log::trace("arg: '%s'", args.back().c_str());
ERROR: (0)         153:         }
ERROR: (0)       > 154:         if (execute(c, args)) {
ERROR: (0)         155:             ++executed;
ERROR: (0)         156:         }
ERROR: (0)         157:     }
ERROR: (0) #15   Source "/home/mgerhardy/dev/oss/engine/src/modules/command/Command.cpp:195", in execute
ERROR: (0)         192:         cmd = i->second;
ERROR: (0)         193:     }
ERROR: (0)         194:     Log::trace("execute %s with %i arguments", command.c_str(), (int)args.size());
ERROR: (0)       > 195:     cmd._func(args);
ERROR: (0)         196:     return true;
ERROR: (0)         197: }
ERROR: (0) #14   Source "/usr/include/c++/13/bits/std_function.h:591", in operator()
ERROR: (0)         588:       {
ERROR: (0)         589:     if (_M_empty())
ERROR: (0)         590:       __throw_bad_function_call();
ERROR: (0)       > 591:     return _M_invoker(_M_functor, std::forward<_ArgTypes>(__args)...);
ERROR: (0)         592:       }
ERROR: (0)         593: 
ERROR: (0)         594: #if __cpp_rtti
ERROR: (0) #13   Source "/usr/include/c++/13/bits/std_function.h:290", in _M_invoke
ERROR: (0)         287:       static _Res
ERROR: (0)         288:       _M_invoke(const _Any_data& __functor, _ArgTypes&&... __args)
ERROR: (0)         289:       {
ERROR: (0)       > 290:     return std::__invoke_r<_Res>(*_Base::_M_get_pointer(__functor),
ERROR: (0)         291:                      std::forward<_ArgTypes>(__args)...);
ERROR: (0)         292:       }
ERROR: (0) #12   Source "/usr/include/c++/13/bits/invoke.h:111", in __invoke_r<void, voxedit::SceneManager::construct()::<lambda(const command::CmdArgs&)>&, const core::DynamicArray<core::String, 32>&>
ERROR: (0)         108:       using __type = typename __result::type;
ERROR: (0)         109:       using __tag = typename __result::__invoke_type;
ERROR: (0)         110:       if constexpr (is_void_v<_Res>)
ERROR: (0)       > 111:     std::__invoke_impl<__type>(__tag{}, std::forward<_Callable>(__fn),
ERROR: (0)         112:                     std::forward<_Args>(__args)...);
ERROR: (0)         113:       else
ERROR: (0)         114:     return std::__invoke_impl<__type>(__tag{},
ERROR: (0) #11   Source "/usr/include/c++/13/bits/invoke.h:61", in __invoke_impl<void, voxedit::SceneManager::construct()::<lambda(const command::CmdArgs&)>&, const core::DynamicArray<core::String, 32>&>
ERROR: (0)          58:   template<typename _Res, typename _Fn, typename... _Args>
ERROR: (0)          59:     constexpr _Res
ERROR: (0)          60:     __invoke_impl(__invoke_other, _Fn&& __f, _Args&&... __args)
ERROR: (0)       >  61:     { return std::forward<_Fn>(__f)(std::forward<_Args>(__args)...); }
ERROR: (0)          62: 
ERROR: (0)          63:   template<typename _Res, typename _MemFun, typename _Tp, typename... _Args>
ERROR: (0)          64:     constexpr _Res
ERROR: (0) #10   Source "/home/mgerhardy/dev/oss/engine/src/tools/voxedit/modules/voxedit-util/SceneManager.cpp:1967", in operator()
ERROR: (0)        1964:     }).setHelp(_("Cut selection"));
ERROR: (0)        1965: 
ERROR: (0)        1966:     command::Command::registerCommand("undo", [&] (const command::CmdArgs& args) {
ERROR: (0)       >1967:         undo();
ERROR: (0)        1968:     }).setHelp(_("Undo your last step"));
ERROR: (0)        1969: 
ERROR: (0)        1970:     command::Command::registerCommand("redo", [&] (const command::CmdArgs& args) {
ERROR: (0) #9    Source "/home/mgerhardy/dev/oss/engine/src/tools/voxedit/modules/voxedit-util/SceneManager.cpp:969", in undo
ERROR: (0)         966: bool SceneManager::undo(int n) {
ERROR: (0)         967:     Log::debug("undo %i steps", n);
ERROR: (0)         968:     for (int i = 0; i < n; ++i) {
ERROR: (0)       > 969:         if (!doUndo()) {
ERROR: (0)         970:             return false;
ERROR: (0)         971:         }
ERROR: (0)         972:     }
ERROR: (0) #8    Source "/home/mgerhardy/dev/oss/engine/src/tools/voxedit/modules/voxedit-util/SceneManager.cpp:992", in doUndo
ERROR: (0)         989:         return false;
ERROR: (0)         990:     }
ERROR: (0)         991: 
ERROR: (0)       > 992:     const MementoState& s = _mementoHandler.undo();
ERROR: (0)         993:     return mementoStateExecute(s, false);
ERROR: (0)         994: }
ERROR: (0) #7    Source "/home/mgerhardy/dev/oss/engine/src/tools/voxedit/modules/voxedit-util/MementoHandler.cpp:418", in undo
ERROR: (0)         415:     const MementoState& s = state();
ERROR: (0)         416:     --_statePosition;
ERROR: (0)         417:     if (s.type == MementoType::Modification) {
ERROR: (0)       > 418:         return undoModification(s);
ERROR: (0)         419:     } else if (s.type == MementoType::SceneNodeTransform) {
ERROR: (0)         420:         return undoTransform(s);
ERROR: (0)         421:     } else if (s.type == MementoType::SceneNodePaletteChanged) {
ERROR: (0) #6    Source "/home/mgerhardy/dev/oss/engine/src/tools/voxedit/modules/voxedit-util/MementoHandler.cpp:320", in undoModification
ERROR: (0)         317:         }
ERROR: (0)         318:     }
ERROR: (0)         319: 
ERROR: (0)       > 320:     core_assert_msg(
ERROR: (0)         321:         _states[0].type == MementoType::Modification ||
ERROR: (0)         322:             (_states[0].referenceId != InvalidNodeId && _states[0].type == MementoType::SceneNodeAdded),
ERROR: (0)         323:         "Expected to have a modification or scene node added with a reference state at the beginning, but got %i",
ERROR: (0) #5    Source "/home/mgerhardy/dev/oss/engine/src/modules/core/Assert.cpp:68", in core_assert_impl_message
ERROR: (0)          65:     SDL_vsnprintf(buf, bufSize - 1, format, args);
ERROR: (0)          66:     va_end(args);
ERROR: (0)          67:     data.condition = buf; /* also let it work for following calls */
ERROR: (0)       >  68:     const SDL_AssertState state = SDL_ReportAssertion((SDL_AssertData *)&data, function, file, line);
ERROR: (0)          69:     if (state == SDL_ASSERTION_BREAK) {
ERROR: (0)          70:         SDL_TriggerBreakpoint();
ERROR: (0)          71:     }
ERROR: (0) #4    Object "/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.3000.3", at 0x7f7efb185e2b, in 
ERROR: (0) #3    Source "/home/mgerhardy/dev/oss/engine/src/modules/core/Assert.cpp:28", in coreAssertionHandler
ERROR: (0)          26: static SDL_assert_state coreAssertionHandler(const SDL_assert_data *data, void *userdata) {
ERROR: (0)          27:     if (data->trigger_count <= 1 && data->always_ignore == 0) {
ERROR: (0)       >  28:         core_stacktrace();
ERROR: (0)          29:     }
ERROR: (0)          30:     const SDL_AssertState state = SDL_GetDefaultAssertionHandler()(data, userdata);
ERROR: (0)          31:     if (state == SDL_ASSERTION_RETRY) {
ERROR: (0) #2    Source "/home/mgerhardy/dev/oss/engine/src/modules/core/Assert.cpp:113", in core_stacktrace
ERROR: (0)         110: #elif defined(HAVE_BACKWARD)
ERROR: (0)         111:     std::ostringstream os;
ERROR: (0)         112:     backward::StackTrace st;
ERROR: (0)       > 113:     st.load_here(32);
ERROR: (0)         114:     backward::Printer printer;
ERROR: (0)         115:     printer.print(st, os);
ERROR: (0)         116:     std::string str = os.str();
ERROR: (0) #1    Source "/home/mgerhardy/dev/oss/engine/contrib/libs/backward/backward.h:879", in load_here
ERROR: (0)         876:       return 0;
ERROR: (0)         877:     }
ERROR: (0)         878:     _stacktrace.resize(depth);
ERROR: (0)       > 879:     size_t trace_cnt = details::unwind(callback(*this), depth);
ERROR: (0)         880:     _stacktrace.resize(trace_cnt);
ERROR: (0)         881:     skip_n_firsts(0);
ERROR: (0)         882:     return size();
ERROR: (0) #0    Source "/home/mgerhardy/dev/oss/engine/contrib/libs/backward/backward.h:861", in unwind<backward::StackTraceImpl<backward::system_tag::linux_tag>::callback>
ERROR: (0)         859: template <typename F> size_t unwind(F f, size_t depth) {
ERROR: (0)         860:   Unwinder<F> unwinder;
ERROR: (0)       > 861:   return unwinder(f, depth);
ERROR: (0)         862: }
ERROR: (0)         863: 
ERROR: (0)         864: } // namespace details
WARN: 

Assertion failure at undoModification (/home/mgerhardy/dev/oss/engine/src/tools/voxedit/modules/voxedit-util/MementoHandler.cpp:320), triggered 1 time:
  'Expected to have a modification or scene node added with a reference state at the beginning, but got 2'

write crash to file: /home/mgerhardy/.local/share/vengi/voxedit/crash.log
WARN: