After resuming laptop from overnight sleep/standby/Lid Close, all pages intermittently stop loading for 1 minute(other browser on the same machine loads pages just fine)
Categories
(Core :: Networking, defect, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox139 | --- | fixed |
People
(Reporter: mayankleoboy1, Assigned: valentin)
References
Details
(Whiteboard: [necko-triaged][necko-priority-queue])
User Story
platform-scheduled:2025-12-31
Attachments
(7 files)
|
44.68 KB,
text/plain
|
Details | |
|
228.49 KB,
image/png
|
Details | |
|
2.16 MB,
application/x-zip-compressed
|
Details | |
|
5.06 MB,
application/x-zip-compressed
|
Details | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
Profile with networking preset : https://share.firefox.dev/4gc8v6b
The page wont load... Then i tried opening google.com and that wouldnt load. Even the profile took a long time to capture.
I also sometimes get hang while shutting down the browser - I get the message "another instance of firefox is already running" message.
Filing under networking, but this may be due to other issues.
| Reporter | ||
Comment 1•1 year ago
|
||
| Reporter | ||
Comment 2•1 year ago
•
|
||
This is with the latest Nightly only. It only reproduced a few times, and I dont see it anymore.
I suspect it was a "one-time" activity from the patches in Bug 1933053
Comment 3•1 year ago
|
||
Not able to replicate issue.
Operating System: openSUSE Leap 15.6
KDE Plasma Version: 5.27.11
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.12
Kernel Version: 6.4.0-150600.23.30-default (64-bit)
Graphics Platform: X11
Processors: 16 Γ AMD Ryzen 7 PRO 6850HS with Radeon Graphics
Memory: 62.1 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: HP
Product Name: HP EliteBook 865 16 inch G9 Notebook PC
| Reporter | ||
Comment 4•1 year ago
|
||
Another profile with networking preset logging: https://share.firefox.dev/3ZvhvMs
Comment 5•1 year ago
|
||
This line in the markers from the last profile implies ublock origin was involved. This is the first event that happens when treeherder finally gets unblocked after sitting for 15+s
Extension Suspend - onBeforeRequest https://treeherder.mozilla.org/jobs?repo=try by uBlock0@raymondhill.net (chanId: 11132)
Can you try disabling uBlock Origin (and other extensions?)
| Reporter | ||
Comment 6•1 year ago
|
||
I disabled ublock and could still repro : https://share.firefox.dev/4iINhyr
But as i saud, this is intermittent and started in the last 1-2 days only.
| Reporter | ||
Comment 7•1 year ago
•
|
||
- Here is another profile (with all extensions enabled) where pages just stopped loading while i was browsing. I started the profiler after maybe 30 seconds of "hang". https://share.firefox.dev/4iDhyP2
- Another profile with all threads and I/O: https://share.firefox.dev/3VIULrd
| Reporter | ||
Comment 8•1 year ago
|
||
Networking log. I started logging just after startup. My usual profile with all addons.
| Reporter | ||
Comment 9•1 year ago
|
||
In many such cases, when i close the browser and restart, I get the "Firefox is already running" message. When i force close Firefox and start Firefox again, network does not load.
I checked the "dependency cycle" using Windows task manager, and it said that Firefox was waiting to complete "Network I/O" on two threads of one of the Firefox processes (I chose the Firefox process with highest memory use so I am guessing it must be the parent-process)
| Reporter | ||
Comment 10•1 year ago
|
||
OK, this should be hopefully a better log that i captured.
This contains the networking + websockets+http3 logging presets.
I started logging when pages opened normally. Then I did a bit of browsing. Then the pages stopped loading for maybe 15-20 seconds. Then they eventually all loaded.
This log captures all of that.
rjesup, was this useful?
| Reporter | ||
Comment 11•1 year ago
|
||
This seem to occur after i resume my laptop after suspend/sleep. I specially notice this after i open my laptop in the morning after i close the lid in the night.
Only Firefox is affected. This may only occur on Win11 24H2 version.
| Reporter | ||
Updated•1 year ago
|
| Reporter | ||
Updated•1 year ago
|
| Reporter | ||
Comment 12•1 year ago
|
||
Here is another profile with network preset logging: https://share.firefox.dev/4ah8HP3
Updated•1 year ago
|
Comment 13•1 year ago
|
||
Could one of you take a look? Thanks
| Assignee | ||
Comment 14•1 year ago
|
||
Looking at the user triggered channels, they seem to be canceled by this stack:
XMLHttpRequest.abort
stopresource://gre/modules/SearchSuggestionController.sys.mjs:352:7
cancelQueryresource:///modules/UrlbarProviderSearchSuggestions.sys.mjs:320:14
js::RunScript
That said, I would have expected some DNS resolutions to happen, but I see none of that in the profile.
And the Socket thread is doing next-to-nothing.
@Mayank, thank you for this report.
If possible, could you start profiling before suspending the computer? Then capturing immediately after resuming?
Thanks!
| Reporter | ||
Comment 15•1 year ago
•
|
||
https://share.firefox.dev/4ampK2x
I started network preset logging . Then i closed down the lid and went to sleep. Woke up in the morning and captured the profile.
Let me know if it works for you.
Edit: I didnt try to open any page after waking up, which is why the profile is sort of empty. Will retry again tomorrow.
Comment 16•1 year ago
|
||
(In reply to Mayank Bansal from comment #15)
https://share.firefox.dev/4ampK2x
I started network preset logging . Then i closed down the lid and went to sleep. Woke up in the morning and captured the profile.
Let me know if it works for you.
Edit: I didnt try to open any page after waking up, which is why the profile is sort of empty. Will retry again tomorrow.
The profile indicates that after 2025-01-21 01:48:08.381965576 UTC, all proxy resolutions are blocked, with the last successful resolution logged at that timestamp.
2025-01-21 01:48:08.381965576 UTC - [Parent Process 15988: GeckoMain]: D/nsHttp nsHttpChannel::OnProxyAvailable [this=2088ae17c00 pi=0 status=0 mStatus=0]
For example, TRR request 2089037f100 attempts to resolve the proxy at 01:48:08.402730712 UTC but is subsequently canceled, as shown in the logs. Could you please add proxy:5 to the MOZ_LOG environment variable and capture the HTTP logs again? Additionally, are you able to reproduce this issue using a clean profile?
2025-01-21 01:48:08.402730712 UTC - [Parent Process 15988: GeckoMain]: D/nsHttp TRRServiceChannel::ResolveProxy [this=2089037f100]
2025-01-21 01:48:09.886917480 UTC - [Parent Process 15988: TRR Background]: D/nsHttp TRRServiceChannel::Cancel [this=2089037f100 status=804b0055]
2025-01-21 01:48:09.887862792 UTC - [Parent Process 15988: GeckoMain]: D/nsHttp TRRServiceChannel::OnProxyAvailable [this=2089037f100 pi=0 status=804b0055 mStatus=804b0055]
| Assignee | ||
Updated•1 year ago
|
| Reporter | ||
Comment 17•1 year ago
|
||
I have tried to get a profile for the last two days by starting the profiler, suspending, and then capturing the profile in the morning.
However, on resuming the browser, it is able to connect to the network. Maybe the act of keeping the browser open and profiler running prevents my laptop from truely suspending?
(keeping the needinfo)
| Reporter | ||
Updated•1 year ago
|
| Reporter | ||
Comment 18•1 year ago
|
||
Valentin, I have been trying to repro for 3 days now. But it looks like if I keep Firefox open when closing the lid of my laptop, on waking up Firefox can access network normally. So I think to repro this issue, I need to close Firefox.
What can I try next here?
| Assignee | ||
Comment 19•1 year ago
|
||
How did you capture the profile before? Does that method still work?
It would be good if you also manage to add proxy:5 to the module list.
| Reporter | ||
Comment 20•1 year ago
|
||
(In reply to Valentin Gosu [:valentin] (he/him) from comment #19)
How did you capture the profile before? Does that method still work?
It would be good if you also manage to addproxy:5to the module list.
Previously, i would close Firefox and let the laptop suspend. Then in the morning i would start firefox and capture logs. that should still work i guess. (So basically capture the log just after startup). I will add proxy:5. I will capture something tomorrow morning.
Is there a way to log during startup? Some sort of logging that begins with the launch of the browser?
| Reporter | ||
Comment 21•1 year ago
•
|
||
Hmmm.... https://firefox-source-docs.mozilla.org/networking/http/logging.html may be onto something
I will try using this command line argument:
"c:\Program Files\Mozilla Firefox\firefox.exe" -MOZ_LOG=nsSocketTransport:5,EarlyHint:5,neqo_transport:::3,nsWebSocket:5,nsHostResolver:5,cache2:5,neqo_http3:::5,nsHttp:5,proxy:5,timestamp,sync,profilerstacks -MOZ_LOG_FILE=%TEMP%\log.txt
Should I add the "profilerstacks" at the end? Does this look correct to you?
| Assignee | ||
Comment 22•1 year ago
|
||
Ah, I understand now.
Yes, getting the proxy:5 logs even after the resume may help us find the problem.
Don't think logging the browser startup would help here - but you can do it with the MOZ_LOG env variable. You can even profile during startup https://profiler.firefox.com/docs/#/./guide-startup-shutdown
| Reporter | ||
Updated•1 year ago
|
| Assignee | ||
Comment 23•1 year ago
|
||
Latest logs from Mayank.
https://drive.google.com/drive/folders/1lJUtOm4oRH40CWWFLXOd-yiFbJgJU155?usp=drive_link
| Assignee | ||
Comment 24•1 year ago
|
||
Looking at the logs, I see:
2025-01-29 15:37:20.129000 UTC - [Parent 30008: Main Thread]: V/nsHttp TRRServiceChannel::ResolveProxy [this=1e4c5033a00]
...
2025-01-29 15:37:21.696000 UTC - [Parent 30008: TRR Background]: D/nsHostResolver TRR: 1e4c50efb60 canceling Channel 1e4c5033a40 bugzilla.mozilla.org 28 status=804b0055
2025-01-29 15:37:21.696000 UTC - [Parent 30008: TRR Background]: V/nsHttp TRRServiceChannel::Cancel [this=1e4c5033a00 status=804b0055]
...
2025-01-29 15:37:21.696000 UTC - [Parent 30008: Main Thread]: D/proxy pac thread callback did not provide information 804B0055
later:
2025-01-29 15:38:33.329000 UTC - [Parent 30008: Main Thread]: D/nsHttp nsHttpChannel::ResolveProxy [this=1e4c598d400]
2025-01-29 15:38:33.329000 UTC - [Parent 30008: Main Thread]: D/proxy nsPACMan::AsyncGetProxyForURI reload as scheduled
2025-01-29 15:38:33.329000 UTC - [Parent 30008: Main Thread]: D/proxy nsPACMan::LoadPACFromURI aSpec: , aResetLoadFailureCount: false
2025-01-29 15:38:33.329000 UTC - [Parent 30008: Main Thread]: D/proxy network.proxy.type pref retrieved: 4
2025-01-29 15:38:33.329000 UTC - [Parent 30008: Main Thread]: D/proxy network.proxy.type pref retrieved: 4
2025-01-29 15:38:33.329000 UTC - [Parent 30008: Main Thread]: D/proxy pac not available, use DIRECT
Mayank says the configured proxy setting was auto detect proxy settings for this network, so presumably the OS settings are configured for WPAD.
The proxy code isn't LOGging too much, so I assume the problem is somewhere in the proxy code. We're probably encountering an error, but not calling the callback.
I asked Mayank to also test with no proxy
| Assignee | ||
Comment 25•1 year ago
|
||
Mayank reports that setting the proxy to no proxy got rid of the resume hang.
| Assignee | ||
Comment 26•1 year ago
|
||
I think we need to add more proxy logging to figure out what is erroring after resume.
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 27•1 year ago
|
||
Also removes unused nsAsyncBridgeRequest
Updated•1 year ago
|
| Assignee | ||
Comment 28•1 year ago
|
||
I went through the most recent logs and found the following:
// First call to ResolveProxy
2025-01-29 15:37:20.127000 UTC - [Parent 30008: TRR Background]: V/nsHttp TRRServiceChannel::ResolveProxy [this=1e4c5033a00]
...
// Call failed
2025-01-29 15:37:21.696000 UTC - [Parent 30008: TRR Background]: V/nsHttp TRRServiceChannel::Cancel [this=1e4c5033a00 status=804b0055]
...
// This thread is blocked maybe?
2025-01-29 15:38:22.629000 UTC - [Parent 30008: ProxyResolution]: D/proxy nsPACMan::GetPACFromDHCP DHCP option 252 query failed with result -2147221231
....
2025-01-29 15:38:27.651000 UTC - [Parent 30008: Main Thread]: D/proxy OnStreamComplete: entry
2025-01-29 15:38:27.651000 UTC - [Parent 30008: Main Thread]: D/proxy OnStreamComplete: unable to load PAC, retry later
2025-01-29 15:38:27.651000 UTC - [Parent 30008: Main Thread]: D/proxy OnLoadFailure: retry in 5 seconds (1 fails)
...
2025-01-29 15:38:27.712000 UTC - [Parent 30008: Main Thread]: V/nsHttp TRRServiceChannel::OnProxyAvailable [this=1e4b370da00 pi=0 status=0 mStatus=0] (first good)
I looked around for some info about GetPACFromDHCP getting stuck, and found this chrome bug: Chrome hangs after waking up from sleepswitching network when using proxy auto-detect and have virtual adapters enabled 40542477 which seems to describe a very similar issue.
I think the problem is that DhcpRequestParams is hanging simlar to Chrome, and this is blocking the ProxyResolution thread here.
Chrome uses multiple threads to avoid hanging. I'm wondering if we could execute this on a background thread that is not the ProxyResolution thread instead.
Comment 29•1 year ago
|
||
Comment 30•1 year ago
|
||
| bugherder | ||
| Assignee | ||
Comment 31•1 year ago
|
||
Comment 32•1 year ago
|
||
| Assignee | ||
Comment 33•1 year ago
|
||
Mayank, once this gets merged to central, I'd appreciate it if you tried to reproduce again and captured another profile.
Add dhcpUtils:5 to the modules list.
Thanks!
Comment 34•1 year ago
|
||
| bugherder | ||
| Reporter | ||
Comment 35•1 year ago
|
||
(In reply to Valentin Gosu [:valentin] (he/him) from comment #33)
Mayank, once this gets merged to central, I'd appreciate it if you tried to reproduce again and captured another profile.
AdddhcpUtils:5to the modules list.
Thanks!
shared the logs privately on chat.
| Reporter | ||
Comment 36•1 year ago
|
||
Just for clarity: I can still repro this.
| Assignee | ||
Comment 37•1 year ago
|
||
Thanks. I'll have a look at fixing this next week. It does seem to match Chrome's problem exactly, with DhcpRequestParams hanging.
I intend to call DhcpRequestParams and have the ProxyResolution thread wait on a condition variable with a timeout.
| Assignee | ||
Comment 38•1 year ago
|
||
Comment 39•1 year ago
|
||
(Commenting on User Story)
platform-scheduled:2025-12-31
| Assignee | ||
Updated•1 year ago
|
Comment 40•1 year ago
|
||
Comment 41•1 year ago
|
||
| bugherder | ||
Updated•1 year ago
|
Description
•