Open Bug 1569325 Opened 1 year ago Updated 4 months ago

125,400 instances of "XPCOM objects created/destroyed from static ctor/dtor" emitted from xpcom/base/nsTraceRefcnt.cpp during linux64 debug testing

Categories

(Core :: CSS Parsing and Computation, defect, P3)

defect

Tracking

()

People

(Reporter: erahm, Unassigned)

References

(Blocks 1 open bug, Regression)

Details

125417 WARNING: XPCOM objects created/destroyed from static ctor/dtor: file xpcom/base/nsTraceRefcnt.cpp, line 194

This warning [1] shows up in the following test suites:

  3490 - test-linux64/debug-web-platform-tests-sw-e10s-10 wpt10
  3488 - test-linux64/debug-web-platform-tests-e10s-10 wpt10
  3324 - test-linux64/debug-web-platform-tests-e10s-14 wpt14
  3322 - test-linux64/debug-web-platform-tests-sw-e10s-14 wpt14
  3120 - test-linux64/debug-web-platform-tests-sw-e10s-4 wpt4
  3120 - test-linux64/debug-web-platform-tests-e10s-4 wpt4
  3084 - test-linux64/debug-web-platform-tests-sw-e10s-18 wpt18
  3084 - test-linux64/debug-web-platform-tests-e10s-18 wpt18
  3020 - test-linux64/debug-web-platform-tests-e10s-11 wpt11
  3018 - test-linux64/debug-web-platform-tests-sw-e10s-15 wpt15
  3018 - test-linux64/debug-web-platform-tests-sw-e10s-11 wpt11
  3018 - test-linux64/debug-web-platform-tests-e10s-15 wpt15
  2752 - test-linux64/debug-web-platform-tests-sw-e10s-9 wpt9
  2746 - test-linux64/debug-web-platform-tests-e10s-9 wpt9
  2534 - test-linux64/debug-web-platform-tests-e10s-5 wpt5
  2528 - test-linux64/debug-web-platform-tests-sw-e10s-5 wpt5
  2442 - test-linux64/debug-web-platform-tests-sw-e10s-3 wpt3
  2430 - test-linux64/debug-web-platform-tests-e10s-3 wpt3
  2418 - test-linux64/debug-web-platform-tests-sw-e10s-13 wpt13
  2416 - test-linux64/debug-web-platform-tests-e10s-13 wpt13
  2382 - test-linux64/debug-web-platform-tests-sw-e10s-8 wpt8
  2376 - test-linux64/debug-web-platform-tests-e10s-8 wpt8
  2338 - test-linux64/debug-web-platform-tests-e10s-7 wpt7
  2328 - test-linux64/debug-web-platform-tests-sw-e10s-7 wpt7
  2302 - test-linux64/debug-web-platform-tests-e10s-16 wpt16
  2300 - test-linux64/debug-web-platform-tests-sw-e10s-16 wpt16
  2082 - test-linux64/debug-web-platform-tests-e10s-2 wpt2
  2078 - test-linux64/debug-web-platform-tests-sw-e10s-2 wpt2
  2014 - test-linux64/debug-web-platform-tests-e10s-1 wpt1
  2014 - test-linux64/debug-web-platform-tests-sw-e10s-1 wpt1
  2000 - test-linux64/debug-web-platform-tests-sw-e10s-17 wpt17
  1996 - test-linux64/debug-web-platform-tests-e10s-17 wpt17
  1880 - test-linux64/debug-web-platform-tests-e10s-12 wpt12
  1872 - test-linux64/debug-web-platform-tests-sw-e10s-12 wpt12
  1520 - test-linux64/debug-web-platform-tests-e10s-6 wpt6
  1512 - test-linux64/debug-web-platform-tests-sw-e10s-6 wpt6
   928 - test-linux64/debug-web-platform-tests-wdspec-e10s-1 Wd1
   928 - test-linux64/debug-web-platform-tests-wdspec-sw-e10s-1 Wd1
   752 - test-linux64/debug-web-platform-tests-reftests-sw-e10s-3 Wr3
   746 - test-linux64/debug-web-platform-tests-reftests-e10s-3 Wr3
   744 - test-linux64/debug-web-platform-tests-wdspec-sw-e10s-2 Wd2
   744 - test-linux64/debug-web-platform-tests-wdspec-e10s-2 Wd2
   734 - test-linux64/debug-web-platform-tests-reftests-sw-e10s-2 Wr2
   734 - test-linux64/debug-web-platform-tests-reftests-e10s-2 Wr2
   700 - test-linux64/debug-web-platform-tests-reftests-e10s-1 Wr1
   700 - test-linux64/debug-web-platform-tests-reftests-sw-e10s-1 Wr1
   650 - test-linux64/debug-web-platform-tests-reftests-e10s-4 Wr4
   650 - test-linux64/debug-web-platform-tests-reftests-sw-e10s-4 Wr4
   453 - test-linux64/debug-mochitest-browser-chrome-e10s-11 bc11
   432 - test-linux64/debug-reftest-e10s-5 R5
   432 - test-linux64/debug-reftest-sw-e10s-5 R5
   432 - test-linux64/debug-reftest-no-accel-sw-e10s-5 Ru5
   432 - test-linux64/debug-reftest-no-accel-e10s-5 Ru5
   424 - test-linux64/debug-reftest-e10s-7 R7
   424 - test-linux64/debug-reftest-sw-e10s-7 R7
   424 - test-linux64/debug-reftest-no-accel-sw-e10s-3 Ru3
   424 - test-linux64/debug-reftest-no-accel-sw-e10s-7 Ru7
   424 - test-linux64/debug-reftest-e10s-6 R6
   424 - test-linux64/debug-reftest-sw-e10s-3 R3
   424 - test-linux64/debug-reftest-no-accel-e10s-6 Ru6
   424 - test-linux64/debug-reftest-e10s-3 R3
   424 - test-linux64/debug-reftest-no-accel-e10s-7 Ru7
   424 - test-linux64/debug-reftest-no-accel-sw-e10s-6 Ru6
   424 - test-linux64/debug-reftest-no-accel-e10s-3 Ru3
   424 - test-linux64/debug-reftest-sw-e10s-6 R6
   422 - test-linux64/debug-reftest-e10s-2 R2
   422 - test-linux64/debug-reftest-no-accel-e10s-2 Ru2
   422 - test-linux64/debug-reftest-no-accel-sw-e10s-2 Ru2
   422 - test-linux64/debug-reftest-sw-e10s-2 R2
   417 - test-linux64/debug-mochitest-browser-chrome-sw-e10s-8 bc8
   408 - test-linux64/debug-reftest-no-accel-e10s-1 Ru1
   408 - test-linux64/debug-reftest-sw-e10s-1 R1
   408 - test-linux64/debug-reftest-e10s-1 R1
   408 - test-linux64/debug-reftest-no-accel-sw-e10s-1 Ru1
   403 - test-linux64/debug-mochitest-browser-chrome-sw-e10s-6 bc6
   396 - test-linux64/debug-marionette-e10s Mn
   377 - test-linux64/debug-mochitest-browser-chrome-e10s-2 bc2
   368 - test-linux64/debug-reftest-no-accel-sw-e10s-4 Ru4
   368 - test-linux64/debug-reftest-no-accel-e10s-4 Ru4
   368 - test-linux64/debug-reftest-sw-e10s-4 R4
   367 - test-linux64/debug-reftest-e10s-4 R4
   327 - test-linux64/debug-mochitest-browser-chrome-e10s-8 bc8
   321 - test-linux64/debug-mochitest-browser-chrome-sw-e10s-7 bc7
   289 - test-linux64/debug-mochitest-browser-chrome-sw-e10s-4 bc4
   278 - test-linux64/debug-mochitest-browser-chrome-e10s-4 bc4
   275 - test-linux64/debug-mochitest-browser-chrome-sw-e10s-10 bc10
   274 - test-linux64/debug-mochitest-browser-chrome-sw-e10s-11 bc11
   273 - test-linux64/debug-mochitest-browser-chrome-e10s-9 bc9
   266 - test-linux64/debug-mochitest-browser-chrome-e10s-10 bc10
   264 - test-linux64/debug-mochitest-browser-chrome-e10s-3 bc3
   261 - test-linux64/debug-mochitest-browser-chrome-e10s-6 bc6
   252 - test-linux64/debug-mochitest-browser-chrome-sw-e10s-9 bc9
   241 - test-linux64/debug-mochitest-browser-chrome-sw-e10s-3 bc3
   239 - test-linux64/debug-mochitest-browser-chrome-sw-e10s-2 bc2
   227 - test-linux64/debug-mochitest-browser-chrome-sw-e10s-1 bc1
   227 - test-linux64/debug-mochitest-browser-chrome-e10s-7 bc7
   224 - test-linux64/debug-mochitest-browser-chrome-e10s-5 bc5
   214 - test-linux64/debug-mochitest-browser-chrome-sw-e10s-5 bc5
   201 - test-linux64/debug-mochitest-browser-chrome-e10s-1 bc1
   170 - test-linux64/debug-mochitest-sw-e10s-15 15
   169 - test-linux64/debug-firefox-ui-functional-local-e10s en-US
   166 - test-linux64/debug-mochitest-e10s-15 15
   152 - test-linux64/debug-mochitest-chrome-sw-1proc-1 c1
   152 - test-linux64/debug-mochitest-chrome-1proc-1 c1
   150 - test-linux64/debug-mochitest-e10s-6 6
   150 - test-linux64/debug-mochitest-sw-e10s-6 6
   122 - test-linux64/debug-mochitest-chrome-1proc-2 c2
   122 - test-linux64/debug-mochitest-chrome-sw-1proc-2 c2
   110 - test-linux64/debug-mochitest-chrome-1proc-3 c3
   110 - test-linux64/debug-mochitest-chrome-sw-1proc-3 c3
   110 - test-linux64/debug-mochitest-sw-e10s-8 8
   100 - test-linux64/debug-mochitest-devtools-chrome-e10s-3 dt3
    96 - test-linux64/debug-mochitest-devtools-chrome-sw-e10s-6 dt6
    96 - test-linux64/debug-mochitest-e10s-8 8
    94 - test-linux64/debug-mochitest-e10s-7 7
    92 - test-linux64/debug-mochitest-sw-e10s-7 7
    92 - test-linux64/debug-mochitest-devtools-chrome-e10s-5 dt5
    90 - test-linux64/debug-mochitest-sw-e10s-5 5
    90 - test-linux64/debug-mochitest-devtools-chrome-sw-e10s-4 dt4
    90 - test-linux64/debug-mochitest-sw-e10s-1 1
    90 - test-linux64/debug-mochitest-e10s-5 5
    90 - test-linux64/debug-mochitest-e10s-1 1
    90 - test-linux64/debug-mochitest-media-e10s-1 mda1
    88 - test-linux64/debug-mochitest-e10s-9 9
    88 - test-linux64/debug-mochitest-sw-e10s-9 9
    88 - test-linux64/debug-mochitest-devtools-chrome-e10s-6 dt6
    82 - test-linux64/debug-mochitest-sw-e10s-13 13
    82 - test-linux64/debug-mochitest-e10s-13 13
    80 - test-linux64/debug-mochitest-sw-e10s-10 10
    80 - test-linux64/debug-mochitest-e10s-11 11
    80 - test-linux64/debug-mochitest-sw-e10s-14 14
    80 - test-linux64/debug-mochitest-e10s-3 3
    80 - test-linux64/debug-mochitest-e10s-14 14
    80 - test-linux64/debug-mochitest-sw-e10s-3 3
    80 - test-linux64/debug-mochitest-sw-e10s-11 11
    80 - test-linux64/debug-mochitest-devtools-chrome-e10s-7 dt7
    80 - test-linux64/debug-mochitest-e10s-10 10
    79 - test-linux64/debug-mochitest-devtools-chrome-sw-e10s-7 dt7
    78 - test-linux64/debug-mochitest-media-spi-e10s-1 mda1
    76 - test-linux64/debug-mochitest-media-sw-e10s-3 mda3
    76 - test-linux64/debug-mochitest-devtools-chrome-e10s-4 dt4
    76 - test-linux64/debug-mochitest-media-e10s-3 mda3
    76 - test-linux64/debug-mochitest-media-spi-e10s-3 mda3
    74 - test-linux64/debug-mochitest-e10s-12 12
    74 - test-linux64/debug-mochitest-devtools-chrome-sw-e10s-1 dt1
    74 - test-linux64/debug-mochitest-devtools-chrome-e10s-1 dt1
    74 - test-linux64/debug-mochitest-sw-e10s-12 12
    73 - test-linux64/debug-mochitest-devtools-chrome-sw-e10s-2 dt2
    72 - test-linux64/debug-mochitest-e10s-16 16
    72 - test-linux64/debug-mochitest-sw-e10s-4 4
    72 - test-linux64/debug-mochitest-sw-e10s-16 16
    72 - test-linux64/debug-mochitest-media-sw-e10s-1 mda1
    72 - test-linux64/debug-mochitest-e10s-4 4
    70 - test-linux64/debug-gtest-1proc GTest
    66 - test-linux64/debug-mochitest-media-spi-e10s-2 mda2
    66 - test-linux64/debug-mochitest-media-e10s-2 mda2
    66 - test-linux64/debug-mochitest-media-sw-e10s-2 mda2
    60 - test-linux64/debug-mochitest-devtools-chrome-sw-e10s-3 dt3
    58 - test-linux64/debug-mochitest-devtools-chrome-sw-e10s-5 dt5
    54 - test-linux64/debug-mochitest-e10s-2 2
    54 - test-linux64/debug-mochitest-browser-chrome-sw-e10s-12 bc12
    54 - test-linux64/debug-mochitest-sw-e10s-2 2
    53 - test-linux64/debug-mochitest-browser-chrome-e10s-12 bc12
    46 - test-linux64/debug-mochitest-devtools-chrome-e10s-2 dt2
    44 - test-linux64/debug-mochitest-gpu-sw-e10s gpu
    44 - test-linux64/debug-mochitest-gpu-e10s gpu
    42 - test-linux64/debug-telemetry-tests-client-e10s c
    40 - test-linux64/debug-mochitest-webgl1-core-sw-e10s gl1c
    40 - test-linux64/debug-mochitest-webgl1-core-e10s gl1c
    34 - test-linux64/debug-mochitest-browser-chrome-sw-e10s-15 bc15
    34 - test-linux64/debug-mochitest-browser-chrome-sw-e10s-16 bc16
    34 - test-linux64/debug-mochitest-browser-chrome-e10s-16 bc16
    34 - test-linux64/debug-mochitest-browser-chrome-e10s-15 bc15
    24 - test-linux64/debug-mochitest-browser-chrome-sw-e10s-14 bc14
    24 - test-linux64/debug-test-verify-e10s TV
    24 - test-linux64/debug-firefox-ui-functional-remote-e10s en-US
    24 - test-linux64/debug-mochitest-browser-chrome-e10s-13 bc13
    24 - test-linux64/debug-mochitest-browser-chrome-sw-e10s-13 bc13
    23 - test-linux64/debug-mochitest-browser-chrome-e10s-14 bc14
    22 - test-linux64/debug-reftest-e10s-8 R8
    22 - test-linux64/debug-reftest-no-accel-sw-e10s-8 Ru8
    22 - test-linux64/debug-crashtest-e10s C
    22 - test-linux64/debug-reftest-no-accel-e10s-8 Ru8
    22 - test-linux64/debug-reftest-sw-e10s-8 R8
    22 - test-linux64/debug-mochitest-devtools-chrome-e10s-8 dt8
    22 - test-linux64/debug-crashtest-sw-e10s C
    22 - test-linux64/debug-mochitest-devtools-chrome-sw-e10s-8 dt8
    18 - test-linux64/debug-mochitest-devtools-chrome-e10s-11 dt11
    18 - test-linux64/debug-mochitest-devtools-chrome-sw-e10s-10 dt10
    18 - test-linux64/debug-mochitest-devtools-chrome-e10s-10 dt10
    18 - test-linux64/debug-mochitest-devtools-chrome-sw-e10s-11 dt11
    16 - test-linux64/debug-mochitest-remote-e10s remote
    16 - test-linux64/debug-mochitest-devtools-chrome-sw-e10s-9 dt9
    16 - test-linux64/debug-mochitest-devtools-chrome-sw-e10s-12 dt12
    16 - test-linux64/debug-mochitest-remote-sw-e10s remote
    16 - test-linux64/debug-mochitest-devtools-chrome-e10s-9 dt9
    16 - test-linux64/debug-mochitest-devtools-chrome-e10s-12 dt12
    14 - test-linux64/debug-mochitest-a11y-sw-1proc a11y
    14 - test-linux64/debug-mochitest-a11y-1proc a11y
     8 - test-linux64/debug-jsreftest-sw-e10s-1 J1
     8 - test-linux64/debug-jsreftest-e10s-4 J4
     8 - test-linux64/debug-jsreftest-sw-e10s-3 J3
     8 - test-linux64/debug-jsreftest-e10s-3 J3
     8 - test-linux64/debug-mochitest-webgl1-ext-sw-e10s gl1e
     8 - test-linux64/debug-mochitest-webgl1-ext-e10s gl1e
     8 - test-linux64/debug-jsreftest-e10s-2 J2
     8 - test-linux64/debug-jsreftest-e10s-1 J1
     8 - test-linux64/debug-jsreftest-sw-e10s-4 J4
     8 - test-linux64/debug-jsreftest-e10s-5 J5
     8 - test-linux64/debug-jsreftest-sw-e10s-2 J2
     8 - test-linux64/debug-jsreftest-sw-e10s-5 J5

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

  9732 - [e10s] Shutdown
   412 -        Shutdown
   152 -        browser/components/shell/test/test_headless_screenshot.html
   108 - [e10s] browser/base/content/test/tabs/browser_privilegedmozilla_process_pref.js
   100 - [e10s] /webdriver/tests/new_window/user_prompts.py
    72 - [e10s] /webdriver/tests/get_element_css_value/user_prompts.py
    72 - [e10s] /webdriver/tests/is_element_selected/user_prompts.py
    72 - [e10s] /webdriver/tests/get_current_url/user_prompts.py
    72 - [e10s] /webdriver/tests/get_window_handle/user_prompts.py
    72 - [e10s] /webdriver/tests/get_element_text/user_prompts.py

[1] https://hg.mozilla.org/mozilla-central/annotate/a6fa09658817e99eb52335a0773f567ab20a34aa/xpcom/base/nsTraceRefcnt.cpp#l194

Bisection kind of points to: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=849ba4e850449a007e77316d6a2c1038f5143669&tochange=dbd5328d0960ef802cec0c7a006b99291f93ab64

Which has:

0edd8c43147130a2b0d3acbcde5d53d4b4f6aaf4	Emilio Cobos Álvarez — Bug 1552080 - Add refcount logging to servo_arc. r=heycam

I'm reasonably confident that's the root of this uptick.

Regressed by: 1552080

Do you know what's the way to fix this? I don't think that code really runs from statics, but probably does very early during startup anyway (since this is using lazy_static!).

Bugbug thinks this bug is a defect, but please change it back in case of error.

Type: -- → defect

(In reply to Emilio Cobos Álvarez (:emilio) from comment #2)

Do you know what's the way to fix this? I don't think that code really runs from statics, but probably does very early during startup anyway (since this is using lazy_static!).

Andrew, do you have any ideas?

Flags: needinfo?(continuation)
Component: XPCOM → CSS Parsing and Computation

I think that means that these objects were created before XPCOM started up. I don't know if there's any easy fix for that. Maybe the lazy static stuff could be initialized later?

Flags: needinfo?(continuation)

The priority flag is not set for this bug.
:hiro, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(hikezoe.birchill)

Based on comment 2, this seems a false alarm.

Flags: needinfo?(hikezoe.birchill)
Priority: -- → P3

For what it's worth, this is happening during shutdown; an example stack is:

#0  0x00007fb0782aeb1b in NS_DebugBreak(uint32_t, char const*, char const*, char const*, int32_t) (aSeverity=0, aStr=0x7fb075234540 <kStaticCtorDtorWarning> "XPCOM objects created/destroyed from static ctor/dtor", aExpr=0x0, aFile=0x7fb074d6685f "<removed>/gecko/xpcom/base/nsTraceRefcnt.cpp", aLine=198) at gecko/xpcom/base/nsDebugImpl.cpp:297
#1  0x00007fb0782ec7eb in NS_LogDtor(void*, char const*, uint32_t) (aPtr=0x7fb06c337000, aType=0x7fb076399d5f <anon.1b2df560eb876bc5c47c74cbdb2f4228.42.llvm> "ServoArc", aInstanceSize=8)
    at gecko/xpcom/base/nsTraceRefcnt.cpp:1061
#2  0x00007fb07e516f7d in servo_arc::Arc<T>::record_drop (self=0x7fb0888ab858)
    at gecko/servo/components/servo_arc/lib.rs:340
#3  0x00007fb07e516f7d in servo_arc::Arc<T>::drop_slow (self=0x7fb0888ab858)
    at gecko/servo/components/servo_arc/lib.rs:358
#4  0x00007fb088cc98af in __GI___call_tls_dtors () at cxa_thread_atexit_impl.c:155
#5  0x00007fb088cc9117 in __run_exit_handlers (status=0, listp=0x7fb089071718 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:46
#6  0x00007fb088cc913a in __GI_exit (status=<optimized out>) at exit.c:139
#7  0x00007fb088ca7b9e in __libc_start_main (main=
    0x55600f64017d <main(int, char**, char**)>, argc=16, argv=0x7ffd36583418, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffd36583408)
    at ../csu/libc-start.c:344
#8  0x000055600f64002a in _start ()

I suspect that means this also blocks bug 1517309, since these would show up for the leakThreshold there.

Any idea why this happens only in WPT? Would it be a side-effect of a different leak?

Blocks: 1517309

I think this should happen everywhere, and not show up in the leakThreshold.

These looks like thread-locals getting dropped (I thought rust didn't do that consistently / gave that guarantee?).

We leak these intentionally, and thus that drop call would get counted as a negative leak:

I think the solution would just be ensuring we don't drop them even on exit via ManuallyDrop or such, but that may make other tools like valgrind report them as actual leaks, maybe? Maybe valgrind deals with them just fine?

If that's an acceptable solution, then it's just a matter of wrapping the Arc inside a ManuallyDrop<>.

Oh, I missed that there was a scrollbar in comment 0. Hooray for what scrollbars look like these days...

No longer blocks: 1517309
You need to log in before you can comment on or make changes to this bug.