urho3d/urho3d

Crash in UI::Update()

sy-borg opened this issue · 3 comments

Hello, this change 240c453#diff-a7774c8bbebced9b89447bda22004a58a4e4213f3f66126dd40bb1a78a3b8ce5R956-R957 seems to be problematic. It may indeed crash the program when Update() modifies the the children vector, like the comment says. This happens to me when I hover over a button with a Tooltip and the Tooltip should appear.

When I revert this change, it doesn't crash anymore.

Here is a backtrace of such a crash:

SIGSEGV: Segmentation Fault
./fw(+0x4bd85e)[0x55cd1916f85e]: Urho3D::UI::Update(float, Urho3D::UIElement*) at /home/sa/src/Urho3D/Source/Urho3D/UI/UI.cpp:950
./fw(+0x4bd903)[0x55cd1916f903]: Urho3D::UI::Update(float, Urho3D::UIElement*) at /home/sa/src/Urho3D/Source/Urho3D/UI/UI.cpp:956
./fw(+0x4bd903)[0x55cd1916f903]: Urho3D::UI::Update(float, Urho3D::UIElement*) at /home/sa/src/Urho3D/Source/Urho3D/UI/UI.cpp:956
./fw(+0x4bd903)[0x55cd1916f903]: Urho3D::UI::Update(float, Urho3D::UIElement*) at /home/sa/src/Urho3D/Source/Urho3D/UI/UI.cpp:956
./fw(+0x4bae4b)[0x55cd1916ce4b]: Urho3D::UI::Update(float) at /home/sa/src/Urho3D/Source/Urho3D/UI/UI.cpp:391
./fw(+0x4c2bc1)[0x55cd19174bc1]: Urho3D::UI::HandlePostUpdate(Urho3D::StringHash, Urho3D::HashMap<Urho3D::StringHash, Urho3D::Variant>&) at /home/sa/src/Urho3D/Source/Urho3D/UI/UI.cpp:2027
./fw(+0x4ccde5)[0x55cd1917ede5]: Urho3D::EventHandlerImpl<Urho3D::UI>::Invoke(Urho3D::HashMap<Urho3D::StringHash, Urho3D::Variant>&) at /home/sa/src/Urho3D/Source/Urho3D/UI/../Core/../Core/Object.h:305 (discriminator 4)
./fw(+0x7b3567)[0x55cd19465567]: Urho3D::Object::OnEvent(Urho3D::Object*, Urho3D::StringHash, Urho3D::HashMap<Urho3D::StringHash, Urho3D::Variant>&) at /home/sa/src/Urho3D/Source/Urho3D/Core/Object.cpp:110
./fw(+0x7b41d4)[0x55cd194661d4]: Urho3D::Object::SendEvent(Urho3D::StringHash, Urho3D::HashMap<Urho3D::StringHash, Urho3D::Variant>&) at /home/sa/src/Urho3D/Source/Urho3D/Core/Object.cpp:355
./fw(+0x799006)[0x55cd1944b006]: Urho3D::Engine::Update() at /home/sa/src/Urho3D/Source/Urho3D/Engine/Engine.cpp:733
./fw(+0x7988c9)[0x55cd1944a8c9]: Urho3D::Engine::RunFrame() at /home/sa/src/Urho3D/Source/Urho3D/Engine/Engine.cpp:551
./fw(+0x7a5a20)[0x55cd19457a20]: Urho3D::Application::Run() at /home/sa/src/Urho3D/Source/Urho3D/Engine/Application.cpp:66
./fw(+0x12075f)[0x55cd18dd275f]: RunApplication() at /home/sa/src/ABx/abclient/src/ClientApp.cpp:104 (discriminator 7)
./fw(+0x120823)[0x55cd18dd2823]: (unknown)  at /home/sa/src/ABx/abclient/src/ClientApp.cpp:104
/usr/lib/libc.so.6(+0x29290)[0x7f90ab829290]: (unknown)  at ??:?
/usr/lib/libc.so.6(__libc_start_main+0x8a)[0x7f90ab82934a]: (unknown) ?? ??:0
./fw(+0xb0335)[0x55cd18d62335]: (unknown)  at /build/glibc/src/glibc/csu/../sysdeps/x86_64/start.S:117

image
image

I'm using GCC 12.1 on Arch Linux, btw.

1vanK commented

How to reproduce this?

Here it happens when I hover with the mouse over a Button which has a ToolTip, which should appear on Mouse hover. But I can't reproduce it with the Editor, maybe because I have a fairly complex ToolTip.

1vanK commented

I can't say that I understand what the problem is, but let's bring back the old way of iteration