Closed Bug 2055964 Opened 4 months ago Closed 3 months ago

48,400 instances of "'NS_FAILED(rv)'" emitted from checkouts/gecko/xpcom/threads/nsThreadUtils.cpp during macosx1015-64-qr debug testing

Categories

(Core :: XPCOM, task)

task

Tracking

()

RESOLVED FIXED
155 Branch
Tracking Status
firefox155 --- fixed

People

(Reporter: mccr8, Assigned: jstutte)

References

(Blocks 2 open bugs)

Details

Attachments

(1 external file)

48394 WARNING: 'NS_FAILED(rv)', file checkouts/gecko/xpcom/threads/nsThreadUtils.cpp:237

This warning is extremely frequent, occurring more than twice as much as the next most frequent warning.

This warning shows up in 22 test suites. A few of the most prevalent:

  8886 - test-macosx1015-64-qr/debug-mochitest-browser-chrome-25 bc25
  6121 - test-macosx1015-64-qr/debug-mochitest-browser-chrome-30 bc30
  3566 - test-macosx1015-64-qr/debug-mochitest-browser-chrome-38 bc38
  2696 - test-macosx1015-64-qr/debug-mochitest-browser-chrome-4 bc4
  2567 - test-macosx1015-64-qr/debug-mochitest-browser-chrome-7 bc7
  2244 - test-macosx1015-64-qr/debug-mochitest-browser-chrome-5 bc5
  2134 - test-macosx1015-64-qr/debug-mochitest-browser-chrome-6 bc6
  2132 - test-macosx1015-64-qr/debug-mochitest-browser-chrome-10 bc10
  1991 - test-macosx1015-64-qr/debug-mochitest-browser-chrome-vt bc
  1955 - test-macosx1015-64-qr/debug-mochitest-browser-chrome-1 bc1

It shows up in 1501 tests. A few of the most prevalent:

  4446 -        Shutdown
  1648 -        dom/security/test/referrer-policy/browser_referrer_disallow_cross_site_relaxing.js
  1112 -        toolkit/components/antitracking/test/browser/browser_partitionedCookies.js
   876 -        toolkit/components/antitracking/test/browser/browser_blockingMessaging.js
   802 -        toolkit/components/antitracking/test/browser/browser_partitionedLocalStorage.js
   721 -        dom/ipc/tests/browser_wpi_isolate_everything.js
   708 -        toolkit/components/antitracking/test/browser/browser_partitionedSharedWorkers.js
   626 -        toolkit/components/antitracking/test/browser/browser_referrerDefaultPolicy.js
   576 -        toolkit/components/antitracking/test/browser/browser_PBMCookieBehavior.js
   462 -        toolkit/components/antitracking/test/browser/browser_blockingCookies.js

NS_DispatchToMainThread wraps the NS_GetMainThread failure check in NS_WARN_IF. NS_GetMainThread only fails (with NS_ERROR_NOT_INITIALIZED) when there is no main thread, which is an expected condition during shutdown. As a result this warning was the single most frequent warning in macOS debug test logs (~48,400 instances, top source "Shutdown"), providing no diagnostic value.

Drop the NS_WARN_IF wrapper (keeping the NS_FAILED check and early return). The genuine-misuse case -- a non-fallible dispatch failing and thus leaking the runnable -- is still caught by the NS_ASSERTION immediately below.

Assignee: nobody → jstutte
Status: NEW → ASSIGNED
Attachment #9619741 - Attachment description: WIP: Bug 2055964 - Don't warn when NS_DispatchToMainThread fails to get the main thread during shutdown → Bug 2055964 - Don't warn when NS_DispatchToMainThread fails to get the main thread during shutdown. r?#xpcom-reviewers
Duplicate of this bug: 2059549
Pushed by jstutte@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/fb60b34c851b https://hg.mozilla.org/integration/autoland/rev/477fcdf4fd84 Don't warn when NS_DispatchToMainThread fails to get the main thread during shutdown. r=xpcom-reviewers,mccr8
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: