Open Bug 2038469 Opened 6 months ago Updated 6 days ago

Accessibility tree mutation storm from high-DOM-churn page freezes entire OS

Categories

(Core :: Disability Access APIs, defect)

Firefox 150
defect

Tracking

()

UNCONFIRMED

People

(Reporter: leigh, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0

Steps to reproduce:

Have any UI Automation consumer active. In my case, Wispr Flow voice-to-text (confirmed in about:support as UIAUTOMATION|Wispr Flow Helper.exe). Any UIA consumer will trigger this — it is not specific to Wispr.
Open the AWS EC2 Console (console.aws.amazon.com) and go to create a new instance.
Open the "Change instance type" or "Browse more AMIs" dialog
Type in the search/filter field

Actual results:

Firefox becomes unresponsive. The entire Windows GUI freezes — mouse movement stutters in visible jerks, keyboard input queues. The system recovers only after the search filtering completes or the dialog is closed. This occurs even with 12GB free RAM on a 24-thread machine. The issue is not memory pressure — it is message queue starvation.

Expected results:

Firefox should remain responsive. The a11y subsystem should throttle, coalesce, or circuit-break accessibility tree notifications when mutation volume exceeds a reasonable threshold, rather than synchronously firing one NotifyWinEvent per DOM mutation on the parent process main thread.

Profiler Data:
Firefox Profiler capture (51 seconds, JSON available on request or can be uploaded to profiler.firefox.com) shows:
PID 40644 (AWS Console content process) generated 524,134 accessibility tree operations over 238 seconds, with bursts of 143,444 in a single second. These constitute 72% of all markers on that thread (562,956 of 776,967 total markers). Breakdown:

DocAccessible::ContentRemovedNode — 386,432 calls
DocAccessible::PruneOrInsertSubtree — 90,380 calls
DocAccessible::ShutdownChildrenInSubtree — 47,322 calls
DocAccessible::ProcessQueuedCacheUpdates — 25,328 calls
DocAccessible::ContentRemovedAcc — 11,765 calls

The parent process (PID 48364) receives these via IPC and processes them as:

a11y::PlatformShowHideEvent — 4,236 calls
DocAccessibleParent::ProcessHideEvent — 2,593 calls
DocAccessibleParent::RecvCache — 2,110 calls
DocAccessibleParent::ProcessShowEvent — 1,682 calls

The parent process main thread leaf sample is 92.6% ZwUserMsgWaitForMultipleObjectsEx with ZwUserNotifyWinEvent visible in the call stacks, confirming the same mechanism as bug 1321960: synchronous Windows accessibility API notifications saturating the message queue and starving mouse/keyboard input processing.
**
Relationship to Bug 1321960:**

Bug 1321960 described the same symptoms (browser hang, OS becomes unusable) and the same root cause (mass a11y events processed synchronously via NotifyWinEvent on the parent main thread). That bug was resolved as FIXED in Firefox 57/58, but the fix addressed the specific scenario at the time (ATOK IME + NVDA + large pre elements with e10s). The underlying architectural vulnerability — no upper bound on a11y mutation throughput to the OS — remains, and is now triggered by a different but increasingly common pattern: React applications performing unvirtualized list filtering with full DOM teardown/rebuild on each keystroke.

Environment:

Firefox 150.0.2 (build 20260506140522)
Windows 11 build 26200
AMD Ryzen AI 9 HX 370 (12 physical / 24 logical cores), 32GB RAM
AMD Radeon 890M iGPU + NVIDIA GeForce RTX 5070 Laptop GPU
Accessibility instantiator: UIAUTOMATION|C:\Users\leigh\AppData\Local\WisprFlow\app-1.5.257\resources\Release\Wispr Flow Helper.exe
accessibility.force_disabled = 0 (default)
Extensions: uBlock Origin 1.70.0, Bitwarden 2026.3.0, Reddit Enhancement Suite 5.24.8, SimplyCodes 2.8.1, Raindrop.io 6.6.91

The Bugbug bot thinks this bug should belong to the 'Core::Disability Access APIs' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Disability Access APIs
Product: Firefox → Core
Blocks: a11yperf

Marking as S2 since this seems like an acute issue, Jamie, downgrade if I am wrong.

Severity: -- → S2
Flags: needinfo?(jteh)

Thanks for the report. It would be great if you can upload the profile to profiler.firefox.com and provide a link, thank you.

I don't have access to Amazon AWS. Can you give me some idea of how many items might be in that list (1000, 10000, more)?

Aside from the aforementioned bug 1321960, we've implemented several other fixes in this area to try to deal with heavy mutation floods like this, including bug 1774918, bug 1938958 and bug 1948375. Still, we'll look into what else we might be able to do here.

As a matter of interest, have you ever tried this in a Chromium browser? Do you see similar results? From what I can tell, it doesn't seem to coalesce events for many added children either, so I'd be surprised if it's any better, but either way, the data point might be useful.

Technical investigation note: test case to fire 100000 show events in one hit:

data:text/html,
<body role="application">
<div id="container"></div>
<button onclick="run();">Go</button>
<script>
function run() {
  const container = document.getElementById("container");
  let html = "";
  for (let i = 0; i < 100000; ++i) {
    html += `<p>${i}</p>`;
  }
  container.innerHTML += html;
}
</script>
Flags: needinfo?(jteh) → needinfo?(leigh)
See Also: → 1321960, 1774918, 1938958, 1948375

Hi again,

Here is the profiler link: https://profiler.firefox.com/from-file/calltree/?globalTrackOrder=0312&thread=4&v=16

There are 1081 items in the list I believe.

The bug is not present in Chrome. I'm downloading Chromium now to try.

Flags: needinfo?(leigh)

Thank you for the profile. I'll take a look.

Chrome is fine; you don't need to try Chromium as well. I just meant any Chromium based browser: Chrome or Edge are both fine, for example.

That means one of three things:

  1. Your accessibility client doesn't instantiate accessibility in Chrome for some reason.
  2. Chrome fires less events. Based on the test case above, I don't see how that could be the case; Chrome seems to cope even worse than Firefox does with that one and doesn't seem to coalesce events any better. Still, maybe I'm missing something that is more specific to the AWS EC2 case.
  3. Chrome fires a similar number of events, but somehow avoids whatever system contention you're seeing. Again, I'm not sure how that could be the case, but I can't rule it out.

Anyway, we'll keep digging.

Leigh, do you still experience the issue with version 153?

Flags: needinfo?(leigh)

Hi. I can reproduce this issue in the latest firefox developer edition build.

Here is the profiling file: https://share.firefox.dev/48Asau0

While visit a huge diff page in GIthub PR, it hang with the same reason, which is metioned the root issue.

Redirect a needinfo that is pending on an inactive user to the triage owner.
:morgan, since the bug has high severity and recent activity, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(leigh) → needinfo?(mreschenberg)
Flags: needinfo?(mreschenberg)
You need to log in before you can comment on or make changes to this bug.