Closed Bug 1749914 Opened 3 years ago Closed 3 years ago

http3 uses 100% CPU on filrefox-95 and firefox-96

Categories

(Core :: Networking, defect)

Firefox 96
defect

Tracking

()

VERIFIED DUPLICATE of bug 1749910

People

(Reporter: slyfox, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0

Steps to reproduce:

I think something changed in how services expose http3. Maybe github enabled it? I seemingly did not do anything specific and found my firefox uses 100% CPU. Restarting firefox does not help.

Actual results:

Empty tab list (with Pocket enabled) uses 100% CPU and stalls at loading any web tabs. Running perf top reports http3:

  38,24%  libxul.so                             [.] mozilla::net::Http3Stream::OnReadSegment
  33,39%  libxul.so                             [.] mozilla::net::nsHttpTransaction::ReadRequestSegment
  18,73%  libxul.so                             [.] nsBufferedInputStream::ReadSegments
   0,61%  libbfd-2.35.2.so                      [.] rust_demangle_callback
   0,51%  .perf-wrapped                         [.] rb_next
   0,45%  .perf-wrapped                         [.] __symbols__insert
   0,37%  [kernel]                              [k] module_get_kallsym
   0,37%  libbfd-2.35.2.so                      [.] d_print_comp_inner
   0,26%  [kernel]                              [k] acpi_idle_enter
   0,24%  libxul.so                             [.] js::GCMarker::processMarkStackTop
   ...

Setting network.http.http3.enabled => false in about:config works around the hungups.

Expected results:

Firefox should not use 100% CPU.

htop shows single 100% busy waiting thread: 2158091 testie 20 0 3817M 382M 209M R 99. 0.3 2:32.57 │ │ ├─ /nix/store/x0xkw8xqdys1jrnv4v05ifv7px7rsp9f-firefox-96.0/bin/.firefox-wrapped. gdb resolves it down to

$ gdb -p 2158091
(gdb) info threads
  Id   Target Id                                           Frame
* 1    Thread 0x7fc021b7d640 (LWP 2158091) "Socket Thread" 0x00007fc036a8cf18 in nsBufferedInputStream::ReadSegments(nsresult (*)(nsIInputStream*, void*, char const*, unsigned int, unsigned int, unsigned int*), void*, unsigned int, unsigned int*) () from /nix/store/x0xkw8xqdys1jrnv4v05ifv7px7rsp9f-firefox-96.0/lib/firefox/libxul.so
(gdb) bt
#0  0x00007fc036a8cf18 in nsBufferedInputStream::ReadSegments(nsresult (*)(nsIInputStream*, void*, char const*, unsigned int, unsigned int, unsigned int*), void*, unsigned int, unsigned int*) ()
   from /nix/store/x0xkw8xqdys1jrnv4v05ifv7px7rsp9f-firefox-96.0/lib/firefox/libxul.so
#1  0x00007fc036cbbfad in mozilla::net::nsHttpTransaction::ReadSegments(mozilla::net::nsAHttpSegmentReader*, unsigned int, unsigned int*) ()
   from /nix/store/x0xkw8xqdys1jrnv4v05ifv7px7rsp9f-firefox-96.0/lib/firefox/libxul.so
#2  0x00007fc036bfcb89 in mozilla::net::Http3Session::SendData(nsIUDPSocket*) () from /nix/store/x0xkw8xqdys1jrnv4v05ifv7px7rsp9f-firefox-96.0/lib/firefox/libxul.so
#3  0x00007fc036c3d591 in mozilla::net::HttpConnectionUDP::SendData() () from /nix/store/x0xkw8xqdys1jrnv4v05ifv7px7rsp9f-firefox-96.0/lib/firefox/libxul.so
#4  0x00007fc036c4f34d in mozilla::detail::RunnableFunction<mozilla::net::HttpConnectionUDP::ResumeSend()::$_12>::Run() () from /nix/store/x0xkw8xqdys1jrnv4v05ifv7px7rsp9f-firefox-96.0/lib/firefox/libxul.so
#5  0x00007fc03699e1c6 in nsThread::ProcessNextEvent(bool, bool*) () from /nix/store/x0xkw8xqdys1jrnv4v05ifv7px7rsp9f-firefox-96.0/lib/firefox/libxul.so
#6  0x00007fc0369a2796 in NS_ProcessNextEvent(nsIThread*, bool) () from /nix/store/x0xkw8xqdys1jrnv4v05ifv7px7rsp9f-firefox-96.0/lib/firefox/libxul.so
#7  0x00007fc036acd4a3 in mozilla::net::nsSocketTransportService::Run() () from /nix/store/x0xkw8xqdys1jrnv4v05ifv7px7rsp9f-firefox-96.0/lib/firefox/libxul.so
#8  0x00007fc036ace10d in non-virtual thunk to mozilla::net::nsSocketTransportService::Run() () from /nix/store/x0xkw8xqdys1jrnv4v05ifv7px7rsp9f-firefox-96.0/lib/firefox/libxul.so
#9  0x00007fc03699e1c6 in nsThread::ProcessNextEvent(bool, bool*) () from /nix/store/x0xkw8xqdys1jrnv4v05ifv7px7rsp9f-firefox-96.0/lib/firefox/libxul.so
#10 0x00007fc0369a2796 in NS_ProcessNextEvent(nsIThread*, bool) () from /nix/store/x0xkw8xqdys1jrnv4v05ifv7px7rsp9f-firefox-96.0/lib/firefox/libxul.so
#11 0x00007fc036dc7df8 in mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*) () from /nix/store/x0xkw8xqdys1jrnv4v05ifv7px7rsp9f-firefox-96.0/lib/firefox/libxul.so
#12 0x00007fc036d8d108 in MessageLoop::Run() () from /nix/store/x0xkw8xqdys1jrnv4v05ifv7px7rsp9f-firefox-96.0/lib/firefox/libxul.so
#13 0x00007fc03699b92e in nsThread::ThreadFunc(void*) () from /nix/store/x0xkw8xqdys1jrnv4v05ifv7px7rsp9f-firefox-96.0/lib/firefox/libxul.so
#14 0x00007fc040ea4b90 in _pt_root () from /nix/store/157a965vdvpjgszm2nch51dlpplmcmj1-nspr-4.33/lib/libnspr4.so
#15 0x00007fc0411f9d40 in start_thread () from /nix/store/s9qbqh7gzacs7h68b2jfmn9l6q4jwfjz-glibc-2.33-59/lib/libpthread.so.0
#16 0x00007fc040fc443f in clone () from /nix/store/s9qbqh7gzacs7h68b2jfmn9l6q4jwfjz-glibc-2.33-59/lib/libc.so.6

The Bugbug bot thinks this bug should belong to the 'Core::Networking: HTTP' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Networking: HTTP
Product: Firefox → Core
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.