<div dir="ltr"><div>Adding repro instructions (I hit the same bug but found that it was already filed)</div><div><br></div>It takes about 2 minutes in a fresh container. It starts its own headless sway, D-Bus session bus and accessibility bus, so nothing touches a running desktop session.<br><br>1. Start a container and install the packages:<br><br>    docker run --rm -it debian:sid<br>    echo 'deb <a href="http://deb.debian.org/debian-debug">http://deb.debian.org/debian-debug</a> sid-debug main' > /etc/apt/sources.list.d/debug.list<br>    apt update<br>    apt install -y --no-install-recommends sway wtype python3-gi gir1.2-gtk-3.0 gir1.2-atspi-2.0 at-spi2-core dbus dbus-bin gdb procps libgtk-3-0t64-dbgsym<br><br>   The -dbgsym package is only needed for symbolic backtraces. For trixie, use debian:trixie and trixie-debug.<br><br>2. Create these three files in one directory.<br><br>app.py, a GTK 3 window with an entry:<br><br>    #!/usr/bin/env python3<br>    # A GTK 3 window with an entry; quits after the number of seconds given (default 20).<br>    import sys<br>    import gi<br>    gi.require_version("Gtk", "3.0")<br>    from gi.repository import Gtk, GLib<br><br>    win = Gtk.Window(title="a11y-race")<br>    win.add(Gtk.Entry())<br>    win.connect("destroy", Gtk.main_quit)<br>    win.show_all()<br>    GLib.timeout_add_seconds(int(sys.argv[1]) if len(sys.argv) > 1 else 20, Gtk.main_quit)<br>    Gtk.main()<br><br>client.py, an AT-SPI client that connects and then exits:<br><br>    #!/usr/bin/env python3<br>    # An AT-SPI client that asks app.py (or the application named in $1) one question and<br>    # exits (status 0 if it found it).<br>    # The question makes app.py's AT-SPI bridge count this process as a client and add its<br>    # ATK key listener; when the process exits, the bridge removes that listener again.<br>    import sys<br>    import gi<br>    gi.require_version("Atspi", "2.0")<br>    from gi.repository import Atspi<br>    desktop = Atspi.get_desktop(0)<br>    name = sys.argv[1] if len(sys.argv) > 1 else "app.py"<br>    for i in range(desktop.get_child_count()):<br>        app = desktop.get_child_at_index(i)<br>        if app is not None and app.get_name() == name:<br>            app.get_child_count()<br>            sys.exit(0)<br>    sys.exit(1)<br><br>repro.sh, which runs headless sway, types into the window with wtype and keeps starting AT-SPI clients:<br><br>    #!/bin/sh<br>    # repro.sh [RUNS] [SECONDS]: start a headless sway, then RUNS times: start app.py,<br>    # type into it with wtype while short-lived AT-SPI clients (client.py) come and go,<br>    # for at most SECONDS. Counts the runs where app.py died of SIGSEGV.<br>    # Run it inside a D-Bus session: dbus-run-session -- sh repro.sh 40 8<br>    RUNS=${1:-20}; SECS=${2:-8}<br>    HERE=$(cd "$(dirname "$0")" && pwd)<br>    export XDG_RUNTIME_DIR=$(mktemp -d) WLR_BACKENDS=headless WLR_RENDERER=pixman WLR_LIBINPUT_NO_DEVICES=1<br>    chmod 700 "$XDG_RUNTIME_DIR"<br>    printf 'output HEADLESS-1 resolution 1280x800\n' > "$XDG_RUNTIME_DIR/sway.cfg"<br>    sway -c "$XDG_RUNTIME_DIR/sway.cfg" >"$XDG_RUNTIME_DIR/sway.log" 2>&1 &<br>    for i in $(seq 1 50); do ls "$XDG_RUNTIME_DIR"/wayland-? >/dev/null 2>&1 && break; sleep 0.1; done<br>    export WAYLAND_DISPLAY=$(basename "$(ls "$XDG_RUNTIME_DIR"/wayland-? | head -1)") XDG_SESSION_TYPE=wayland GDK_BACKEND=wayland<br>    crashes=0<br>    for run in $(seq 1 "$RUNS"); do<br>      python3 "$HERE/app.py" "$SECS" 2>/dev/null & app=$!<br>      sleep 1.5<br>      ( found=0; while kill -0 $app 2>/dev/null; do python3 "$HERE/client.py" 2>/dev/null && found=$((found+1)); done; echo "$found" > "$XDG_RUNTIME_DIR/found" ) & clients=$!<br>      ( while kill -0 $app 2>/dev/null; do wtype -d 15 abcdefghijklmnopqrstuvwxyz 2>/dev/null; done ) & typer=$!<br>      wait $app; rc=$?<br>      wait $clients $typer 2>/dev/null<br>      [ $rc = 139 ] && crashes=$((crashes+1))<br>      echo "run $run: exit $rc, AT-SPI clients that reached app.py: $(cat "$XDG_RUNTIME_DIR/found")"<br>    done<br>    echo "SIGSEGV in $crashes of $RUNS runs"<br><br>3. Run it: 40 runs of up to 8 s each.<br><br>    dbus-run-session -- sh repro.sh 40 8<br><br>   Expected on 3.24.52-3: "run N: exit 139" lines and "SIGSEGV in 40 of 40 runs". Each run crashes after 3 to 56 client exits (median 12), which is 1 or 2 seconds.<br>   With e6372d29: every run ends with exit 0 after 8 s, with about 80 client exits per run.<br><br>To see the crash in gdb, run app.py as `gdb -batch -ex run -ex bt --args python3 app.py 8`, with the client loop and the wtype loop from repro.sh running alongside. On sid, 3.24.52-3:<br><br>    Thread 1 "python3" received signal SIGSEGV, Segmentation fault.<br>    0x00007f69764bb2f8 in _gtk_accessibility_key_snooper (widget=widget@entry=0xd4a4f0, event=event@entry=0x1075db0) at ../../../gtk/a11y/gtkaccessibilityutil.c:154<br>    #0  _gtk_accessibility_key_snooper (widget=widget@entry=0xd4a4f0, event=event@entry=0x1075db0) at ../../../gtk/a11y/gtkaccessibilityutil.c:154<br>    #1  gtk_invoke_key_snoopers (grab_widget=0xd4a4f0, event=0x1075db0) at ../../../gtk/gtkmain.c:2451<br>    #2  gtk_main_do_event (event=0x1075db0) at ../../../gtk/gtkmain.c:1869<br>    #3  gtk_main_do_event (event=<optimized out>) at ../../../gtk/gtkmain.c:1694<br>    #4  _gdk_event_emit (event=event@entry=0x1075db0) at ../../../gdk/gdkevents.c:73<br>    #5  gdk_event_source_dispatch (base=<optimized out>, callback=<optimized out>, data=<optimized out>) at ../../../gdk/wayland/gdkeventsource.c:124<br><br>On trixie, 3.24.49-3, it crashed in try 16, at line 152 (`listener = l->data`, where the freed node's next pointer was garbage):<br><br>    _gtk_accessibility_key_snooper (widget=widget@entry=0xf2d510, event=event@entry=0x108ca50) at ../../../gtk/a11y/gtkaccessibilityutil.c:152<br>    #1  gtk_invoke_key_snoopers (grab_widget=0xf2d510, event=0x108ca50) at ../../../gtk/gtkmain.c:2448<br>    #2  gtk_main_do_event (event=0x108ca50) at ../../../gtk/gtkmain.c:1866<br>    #4  _gdk_event_emit (event=event@entry=0x108ca50) at ../../../gdk/gdkevents.c:73<br>    #5  gdk_event_source_dispatch (...) at ../../../gdk/wayland/gdkeventsource.c:124<br><br>These are the frames from the upstream commit message.<br><br><br>Crash rates (reproducer above, 40 runs each)<br>--------------------------------------------<br><br>    build                                                      SIGSEGV<br>    sid:    libgtk-3-0t64 3.24.52-3 from the archive            40/40<br>    sid:    3.24.52-3 source rebuilt as is (7 patches)          40/40<br>    sid:    3.24.52-3 source rebuilt + e6372d29                  0/40<br>    trixie: libgtk-3-0t64 3.24.49-3 from the archive             2/40<br><br>The rebuilt libraries are plain meson builds of libgtk-3.so only (`apt-get source`, `quilt push -a`, the patch on top, no introspection, file print backend), loaded with LD_LIBRARY_PATH. The unpatched rebuild crashes like the archive library, so the build configuration isn't what stops the crash. The same test on Ubuntu 26.04 (3.24.52-0ubuntu1) gives 40/40 as packaged and 0/40 with e6372d29.</div>