ryzom / ryzomcore

Ryzom Core is the open-source project related to the Ryzom game. This community repository is synchronized with the Ryzom Forge repository, based on the Core branch.
https://wiki.ryzom.dev
GNU Affero General Public License v3.0
331 stars 89 forks source link

Web browser long scroll lockup #73

Closed ryzom-pipeline closed 10 years ago

ryzom-pipeline commented 10 years ago

Original report by Meelis Mägi (Bitbucket: [Meelis Mägi](https://bitbucket.org/Meelis Mägi), ).


First I thought that its a crash, but turns out its endless loop hehe

Break at interface_element.cpp:494 is when gdb attached to running process.

NLGUI::CInterfaceElement::updateCoords (this=0x38dc65e0)
    at /home/max/src/ryzom.hg/code/nel/src/gui/interface_element.cpp:494
494             el = _ParentPos;
(gdb) bt
#0  NLGUI::CInterfaceElement::updateCoords (this=0x38dc65e0)
    at /home/max/src/ryzom.hg/code/nel/src/gui/interface_element.cpp:494
#1  0x0000000001b3637c in NLGUI::CViewBase::updateCoords (this=0x38dc65e0)
    at /home/max/src/ryzom.hg/code/nel/include/nel/gui/view_base.h:52
#2  0x000000000268b886 in NLGUI::CInterfaceGroup::doUpdateCoords (this=0x38dc65e0)
    at /home/max/src/ryzom.hg/code/nel/src/gui/interface_group.cpp:1420
#3  0x000000000268b9c4 in NLGUI::CInterfaceGroup::updateCoords (this=0x38dc65e0)
    at /home/max/src/ryzom.hg/code/nel/src/gui/interface_group.cpp:1440
#4  0x00000000027b9aaf in NLGUI::CGroupParagraph::updateCoords (this=0x38dc65e0)
    at /home/max/src/ryzom.hg/code/nel/src/gui/group_paragraph.cpp:922
#5  0x000000000268b925 in NLGUI::CInterfaceGroup::doUpdateCoords (this=0x356152f0)
    at /home/max/src/ryzom.hg/code/nel/src/gui/interface_group.cpp:1429
#6  0x000000000268b9c4 in NLGUI::CInterfaceGroup::updateCoords (this=0x356152f0)
    at /home/max/src/ryzom.hg/code/nel/src/gui/interface_group.cpp:1440
#7  0x000000000268b925 in NLGUI::CInterfaceGroup::doUpdateCoords (this=0x35589380)
    at /home/max/src/ryzom.hg/code/nel/src/gui/interface_group.cpp:1429
#8  0x000000000268b9c4 in NLGUI::CInterfaceGroup::updateCoords (this=0x35589380)
    at /home/max/src/ryzom.hg/code/nel/src/gui/interface_group.cpp:1440
#9  0x000000000268b925 in NLGUI::CInterfaceGroup::doUpdateCoords (this=0x35676b20)
    at /home/max/src/ryzom.hg/code/nel/src/gui/interface_group.cpp:1429
#10 0x000000000268b9c4 in NLGUI::CInterfaceGroup::updateCoords (this=0x35676b20)
    at /home/max/src/ryzom.hg/code/nel/src/gui/interface_group.cpp:1440
#11 0x0000000002698baa in NLGUI::CGroupTable::updateCoords (this=0x35676b20)
    at /home/max/src/ryzom.hg/code/nel/src/gui/group_table.cpp:1003
#12 0x000000000268b925 in NLGUI::CInterfaceGroup::doUpdateCoords (this=0x35505fd0)
    at /home/max/src/ryzom.hg/code/nel/src/gui/interface_group.cpp:1429
#13 0x000000000268b9c4 in NLGUI::CInterfaceGroup::updateCoords (this=0x35505fd0)
    at /home/max/src/ryzom.hg/code/nel/src/gui/interface_group.cpp:1440
#14 0x00000000026c9ea7 in NLGUI::CGroupListAdaptor::updateCoords (this=0x35505fd0)
    at /home/max/src/ryzom.hg/code/nel/src/gui/group_html.cpp:435
#15 0x000000000268b925 in NLGUI::CInterfaceGroup::doUpdateCoords (this=0x18beb630)
    at /home/max/src/ryzom.hg/code/nel/src/gui/interface_group.cpp:1429
#16 0x000000000268b9c4 in NLGUI::CInterfaceGroup::updateCoords (this=0x18beb630)
    at /home/max/src/ryzom.hg/code/nel/src/gui/interface_group.cpp:1440
#17 0x00000000027cb4c5 in NLGUI::CGroupList::updateCoords (this=0x18beb630)
    at /home/max/src/ryzom.hg/code/nel/src/gui/group_list.cpp:737
#18 0x000000000268b925 in NLGUI::CInterfaceGroup::doUpdateCoords (this=0x18bd5310)
    at /home/max/src/ryzom.hg/code/nel/src/gui/interface_group.cpp:1429
#19 0x000000000268b9c4 in NLGUI::CInterfaceGroup::updateCoords (this=0x18bd5310)
    at /home/max/src/ryzom.hg/code/nel/src/gui/interface_group.cpp:1440
#20 0x0000000002652482 in NLGUI::CGroupScrollText::updateCoords (this=0x18bd5310)
    at /home/max/src/ryzom.hg/code/nel/src/gui/group_scrolltext.cpp:105
#21 0x00000000026bebb4 in NLGUI::CGroupHTML::updateCoords (this=0x18bd5310)
    at /home/max/src/ryzom.hg/code/nel/src/gui/group_html.cpp:2936
#22 0x000000000268b925 in NLGUI::CInterfaceGroup::doUpdateCoords (this=0x18bd5050)
    at /home/max/src/ryzom.hg/code/nel/src/gui/interface_group.cpp:1429
#23 0x000000000268b9c4 in NLGUI::CInterfaceGroup::updateCoords (this=0x18bd5050)
    at /home/max/src/ryzom.hg/code/nel/src/gui/interface_group.cpp:1440
#24 0x000000000268b925 in NLGUI::CInterfaceGroup::doUpdateCoords (this=0x18bd2bc0)
    at /home/max/src/ryzom.hg/code/nel/src/gui/interface_group.cpp:1429
#25 0x000000000268b9c4 in NLGUI::CInterfaceGroup::updateCoords (this=0x18bd2bc0)
    at /home/max/src/ryzom.hg/code/nel/src/gui/interface_group.cpp:1440
#26 0x00000000027a6d12 in NLGUI::CGroupContainer::updateCoords (this=0x18bd2bc0)
    at /home/max/src/ryzom.hg/code/nel/src/gui/group_container.cpp:2481
#27 0x00000000027700d2 in NLGUI::CWidgetManager::checkCoords (this=0x7ac8f10)
    at /home/max/src/ryzom.hg/code/nel/src/gui/widget_manager.cpp:1106
#28 0x0000000001d4b9be in CInterfaceManager::updateFrameViews (this=0x7ac5780, camera=...)
    at /home/max/src/ryzom.hg/code/ryzom/client/src/interface_v3/interface_manager.cpp:1566
#29 0x00000000018e12b0 in mainLoop () at /home/max/src/ryzom.hg/code/ryzom/client/src/main_loop.cpp:1819
#30 0x0000000001829d83 in main (argc=1, argv=0x7fff55b46b88)
    at /home/max/src/ryzom.hg/code/ryzom/client/src/client.cpp:616

I let it to run a while, but trace did not get any longer than that.

ryzom-pipeline commented 10 years ago

Original comment by Meelis Mägi (Bitbucket: [Meelis Mägi](https://bitbucket.org/Meelis Mägi), ).


Update..

Deadlock is in CWidgetManager::checkCoords()

#!c++

while (pIG->getParent()==rMG.Group && (pIG->getInvalidCoords()>0))
{
   ....
}

pIG->getInvalidCoords() == 1 when scrollbar is scrolled too long down.

adding simple deadlock counter that counts to 10 and then breaks the loop would be quick fix (usually it needs 2 passes )

With deadlock counter in place, its visible that content will end up in the middle of (its) window and ossilating +/-10px (or so) back and forth. It's possible to recover from it using mouse wheel to scroll back up a bit.

ryzom-pipeline commented 10 years ago

Original comment by Cédric Ochs (Bitbucket: [Cédric OCHS](https://bitbucket.org/Cédric OCHS), ).


Thanks a lot for the report and the fix !

ryzom-pipeline commented 10 years ago

Original comment by Cédric Ochs (Bitbucket: [Cédric OCHS](https://bitbucket.org/Cédric OCHS), ).


Fixed in c6b3672