Skip to content

Regression due to removal of quadratic behavior in node ID cache clearing (GH-142145) #142754

@stefanor

Description

@stefanor

Bug report

Bug description:

In Debian we are seeing test failures as a result of #142146.

====================  test with PYTHON 3.14 ==================
ninja: Entering directory `/build/reproducible-path/pyatspi-2.57.0/build-3.14'
[0/1] Running all tests
dbus-daemon[7409]: [session uid=994 pid=7409 pidfd=5] Activating service name='org.a11y.Bus' requested by ':1.1' (uid=994 pid=7417 comm="/build/reproducible-path/pyatspi-2.57.0/build-3.14" label="unconfined")

(process:7419): dconf-CRITICAL **: 15:22:46.259: unable to create directory '/sbuild-nonexistent/.cache/dconf': Permission denied.  dconf will not work properly.

(process:7419): dconf-CRITICAL **: 15:22:46.260: unable to create directory '/sbuild-nonexistent/.cache/dconf': Permission denied.  dconf will not work properly.

(process:7419): dconf-CRITICAL **: 15:22:46.260: unable to create directory '/sbuild-nonexistent/.cache/dconf': Permission denied.  dconf will not work properly.

(process:7419): dconf-CRITICAL **: 15:22:46.260: unable to create directory '/sbuild-nonexistent/.cache/dconf': Permission denied.  dconf will not work properly.

(process:7419): dconf-CRITICAL **: 15:22:46.260: unable to create directory '/sbuild-nonexistent/.cache/dconf': Permission denied.  dconf will not work properly.

(process:7419): dconf-CRITICAL **: 15:22:46.260: unable to create directory '/sbuild-nonexistent/.cache/dconf': Permission denied.  dconf will not work properly.
dbus-daemon[7409]: [session uid=994 pid=7409 pidfd=5] Successfully activated service 'org.a11y.Bus'
dbus-daemon[7425]: Activating service name='org.a11y.atspi.Registry' requested by ':1.0' (uid=994 pid=7417 comm="/build/reproducible-path/pyatspi-2.57.0/build-3.14" label="unconfined")
dbus-daemon[7425]: Successfully activated service 'org.a11y.atspi.Registry'
SpiRegistry daemon is running with well-known name - org.a11y.atspi.Registry
pyatspi:pyatspi time out (After 300 seconds)
1/1 pyatspi:pyatspi TIMEOUT        300.10s   killed by signal 15 SIGTERM
>>> top_builddir=/build/reproducible-path/pyatspi-2.57.0/build-3.14 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 top_srcdir=/build/reproducible-path/pyatspi-2.57.0 MESON_TEST_ITERATION=1 MALLOC_PERTURB_=187 MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 /build/reproducible-path/pyatspi-2.57.0/tests/pyatspi/runtests.sh
――――――――――――――――――――――――――――――――――――― ✀  ―――――――――――――――――――――――――――――――――――――
stdout:
AT-SPI Received D-Bus name - test.atspi.R242

Unique D-Bus name is: :1.1
stderr:
Traceback (most recent call last):
  File "/build/reproducible-path/pyatspi-2.57.0/tests/pyatspi/pasytest/Pasy.py", line 81, in entry
    self._func(self)
    ~~~~~~~~~~^^^^^^
  File "/build/reproducible-path/pyatspi-2.57.0/tests/pyatspi/accessibletest.py", line 234, in test_tree
    _createNode(doc, root, doc)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/build/reproducible-path/pyatspi-2.57.0/tests/pyatspi/accessibletest.py", line 44, in _createNode
    e.setAttributeNode(nameA)
    ~~~~~~~~~~~~~~~~~~^^^^^^^
  File "/usr/lib/python3.13/xml/dom/minidom.py", line 805, in setAttributeNode
    _set_attribute_node(self, attr)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/lib/python3.13/xml/dom/minidom.py", line 950, in _set_attribute_node
    _clear_id_cache(element)
    ~~~~~~~~~~~~~~~^^^^^^^^^
  File "/usr/lib/python3.13/xml/dom/minidom.py", line 1551, in _clear_id_cache
    elif node.ownerDocument:
         ^^^^^^^^^^^^^^^^^^
AttributeError: 'xml.dom.minidom.Element' object has no attribute 'ownerDocument'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/build/reproducible-path/pyatspi-2.57.0/tests/pyatspi/pasytest/Pasy.py", line 118, in idle_handler
    step.run()
    ~~~~~~~~^^
  File "/build/reproducible-path/pyatspi-2.57.0/tests/pyatspi/pasytest/Pasy.py", line 59, in run
    self.entry()
    ~~~~~~~~~~^^
  File "/build/reproducible-path/pyatspi-2.57.0/tests/pyatspi/pasytest/Pasy.py", line 83, in entry
    self.fail(e.message)
              ^^^^^^^^^
AttributeError: 'AttributeError' object has no attribute 'message'
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

The relevant code here: https://gitlab.gnome.org/GNOME/pyatspi2/-/blob/ad723fb9f0e7d6cb321b6e21f20038a81ed8f5f1/tests/pyatspi/accessibletest.py#L216-250

See: https://bugs.debian.org/1122875

Also: OnroerendErfgoed/skosprovider#155

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes3.14bugs and security fixesrelease-blockerstdlibStandard Library Python modules in the Lib/ directorytopic-XMLtype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions