AtspiCollection should not descend ginormous tables
I'm working on using AtspiCollection rather than doing accessibility tree dives to find one or more descendants. Turns out that's a really, really bad idea in Calc. LibreOffice has been non-responsive for minutes now. Even the force-quit dialog is non-responsive. Here's the trace:
239 bool ScFlatSegmentsImpl<ValueType_, ExtValueType_>::getRangeData(SCCOLROW nPos, RangeData& rData)
(gdb) bt
#0 0x00007ff5cd762918 in (anonymous namespace)::ScFlatSegmentsImpl<bool, bool>::getRangeData(int, (anonymous namespace)::ScFlatSegmentsImpl<bool, bool>::RangeData&) [clone .part.0] [clone .lto_priv.0] (this=0x559a19ac5210, nPos=14053, rData=...) at /usr/src/debug/libreoffice-7.5.5.2-1.fc38.x86_64/sc/source/core/data/segmenttree.cxx:239
#1 0x00007ff5cd748e04 in (anonymous namespace)::ScFlatSegmentsImpl<bool, bool>::getRangeData (rData=..., nPos=<optimized out>, this=<optimized out>)
at /usr/src/debug/libreoffice-7.5.5.2-1.fc38.x86_64/sc/source/core/data/segmenttree.cxx:239
#2 ScFlatBoolColSegments::getRangeData(short, ScFlatBoolColSegments::RangeData&) (this=<optimized out>, nCol=<optimized out>, rData=...)
at /usr/src/debug/libreoffice-7.5.5.2-1.fc38.x86_64/sc/source/core/data/segmenttree.cxx:541
#3 0x00007ff5cd77f8a9 in ScTable::ColHidden(short, short*, short*) const (pLastCol=0x0, pFirstCol=0x0, nCol=14053, this=0x559a193e0ad0)
at /usr/src/debug/libreoffice-7.5.5.2-1.fc38.x86_64/sc/source/core/data/table5.cxx:561
#4 ScTable::GetColWidth(short, bool) const (bHiddenAsZero=<optimized out>, nCol=14053, this=0x559a193e0ad0)
at /usr/src/debug/libreoffice-7.5.5.2-1.fc38.x86_64/sc/source/core/data/table2.cxx:3467
#5 ScTable::GetColWidth(short, bool) const (this=0x559a193e0ad0, nCol=14053, bHiddenAsZero=<optimized out>)
at /usr/src/debug/libreoffice-7.5.5.2-1.fc38.x86_64/sc/source/core/data/table2.cxx:3461
#6 0x00007ff5cde691f3 in ScViewData::GetScrPos(short, int, ScSplitPos, bool, short) const
(this=0x559a19ae95c0, nWhereX=15167, nWhereY=16, eWhich=<optimized out>, bAllowNeg=true, nForTab=<optimized out>)
at /usr/src/debug/libreoffice-7.5.5.2-1.fc38.x86_64/sc/source/ui/view/viewdata.cxx:2443
#7 0x00007ff5cd9dc793 in ScAccessibleCell::GetBoundingBox() const (this=0x559a89a455a0)
at /usr/src/debug/libreoffice-7.5.5.2-1.fc38.x86_64/sc/source/ui/Accessibility/AccessibleCell.cxx:181
#8 0x00007ff5cd9ec811 in ScAccessibleContextBase::getBounds() (this=0x559a89a455a0)
at /usr/src/debug/libreoffice-7.5.5.2-1.fc38.x86_64/sc/source/ui/Accessibility/AccessibleContextBase.cxx:161
#9 0x00007ff5cd9ecca4 in ScAccessibleContextBase::isShowing() (this=0x559a89a455a0)
at /usr/src/debug/libreoffice-7.5.5.2-1.fc38.x86_64/sc/source/ui/Accessibility/AccessibleContextBase.cxx:196
#10 0x00007ff5cd9dce48 in ScAccessibleCell::getAccessibleStateSet() (this=0x559a89a455a0)
at /usr/src/debug/libreoffice-7.5.5.2-1.fc38.x86_64/sc/source/ui/Accessibility/AccessibleCell.cxx:275
#11 0x00007ff5f16f2acf in atk_object_wrapper_new(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessible> const&, AtkObject*, AtkObject*)
(rxAccessible=..., parent=0x0, orig=0x0) at /usr/src/debug/libreoffice-7.5.5.2-1.fc38.x86_64/vcl/unx/gtk3/a11y/atkwrapper.cxx:983
#12 0x00007ff5f16e823f in wrapper_ref_child(AtkObject*, gint) (atk_obj=<optimized out>, i=277311)
at /usr/src/debug/libreoffice-7.5.5.2-1.fc38.x86_64/vcl/unx/gtk3/a11y/atkwrapper.cxx:503
#13 0x00007ff5f19738b2 in sort_order_canonical.constprop.0
(mrp=0x7fff1fdeec40, ls=0x559a19c009c0 = {...}, kount=132, max=0, obj=0x559a1b4980f0, index=<optimized out>, flag=1, pobj=0x0, traverse=1, recurse=1)
at ../atk-adaptor/adaptors/collection-adaptor.c:489
#14 0x00007ff5f1967b8b in impl_GetMatches (bus=<optimized out>, message=0x559a1a70ee70, user_data=<optimized out>) at ../atk-adaptor/adaptors/collection-adaptor.c:1306
#15 0x00007ff5f196a8b0 in handle_other
(pathstr=0x559a1a7098d8 "/org/a11y/atspi/accessible/2180", member=0x559a1a709938 "GetMatches", iface=<optimized out>, path=0x559a192a2de0, message=0x559a1a70ee70, bus=0x559a1bb369b0) at ../droute/droute.c:558
#16 handle_message (bus=0x559a1bb369b0, message=message@entry=0x559a1a70ee70, user_data=user_data@entry=0x559a192a2de0) at ../droute/droute.c:605
#17 0x00007ff607ce7314 in _dbus_object_tree_dispatch_and_unlock (found_object=<synthetic pointer>, message=<optimized out>, tree=0x559a1b4f1420)
at ../../dbus/dbus-object-tree.c:1021
#18 dbus_connection_dispatch (connection=0x559a1bb369b0) at ../../dbus/dbus-connection.c:4758
#19 dbus_connection_dispatch (connection=connection@entry=0x559a1bb369b0) at ../../dbus/dbus-connection.c:4586
#20 0x00007ff5f0d856a1 in message_queue_dispatch (source=<optimized out>, callback=<optimized out>, user_data=<optimized out>) at ../atspi/atspi-gmain.c:89
#21 0x00007ff60109048c in g_main_dispatch (context=0x559a1861a7f0) at ../glib/gmain.c:3460
#22 g_main_context_dispatch (context=0x559a1861a7f0) at ../glib/gmain.c:4200
#23 0x00007ff6010ee648 in g_main_context_iterate.isra.0 (context=0x559a1861a7f0, block=1, dispatch=1, self=<optimized out>) at ../glib/gmain.c:4276
#24 0x00007ff60108db13 in g_main_context_iteration (context=0x559a1861a7f0, may_block=1) at ../glib/gmain.c:4343
#25 0x00007ff5f16ffccc in GtkSalData::Yield(bool, bool) (bHandleAllCurrentEvents=<optimized out>, bWait=<optimized out>, this=0x559a184e86a0)
at /usr/src/debug/libreoffice-7.5.5.2-1.fc38.x86_64/vcl/unx/gtk3/gtkdata.cxx:405
#26 GtkInstance::DoYield(bool, bool) (this=<optimized out>, bWait=true, bHandleAllCurrentEvents=<optimized out>)
at /usr/src/debug/libreoffice-7.5.5.2-1.fc38.x86_64/vcl/unx/gtk3/gtkinst.cxx:431
#27 0x00007ff60492903c in ImplYield(bool, bool) (i_bWait=true, i_bAllEvents=false) at /usr/src/debug/libreoffice-7.5.5.2-1.fc38.x86_64/vcl/source/app/svapp.cxx:475
#28 0x00007ff60492ff0d in Application::Execute() () at /usr/src/debug/libreoffice-7.5.5.2-1.fc38.x86_64/vcl/source/app/svapp.cxx:453
#29 0x00007ff60831b46a in desktop::Desktop::Main() (this=0x7fff1fdef490) at /usr/src/debug/libreoffice-7.5.5.2-1.fc38.x86_64/desktop/source/app/app.cxx:1604
#30 0x00007ff60493c1ea in ImplSVMain() () at /usr/src/debug/libreoffice-7.5.5.2-1.fc38.x86_64/vcl/source/app/svmain.cxx:203
#31 0x00007ff60493c269 in SVMain() () at /usr/src/debug/libreoffice-7.5.5.2-1.fc38.x86_64/vcl/source/app/svmain.cxx:235
#32 0x00007ff6083341b8 in soffice_main() () at /usr/src/debug/libreoffice-7.5.5.2-1.fc38.x86_64/desktop/source/app/sofficemain.cxx:94
#33 0x0000559a16d230c7 in sal_main () at /usr/src/debug/libreoffice-7.5.5.2-1.fc38.x86_64/desktop/source/app/main.c:51
#34 main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/libreoffice-7.5.5.2-1.fc38.x86_64/desktop/source/app/main.c:49
@mgorse: Is there an existing, clever way I can deal with this sort of thing while still using AtspiCollection?