[Snap] opening firefox in weston taking more than 25secs
Categories
(Core :: Widget: Gtk, defect, P3)
Tracking
()
Performance Impact | low |
People
(Reporter: pvharsha, Assigned: gerard-majax)
References
(Blocks 1 open bug)
Details
(Keywords: perf:startup)
Attachments
(9 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Steps to reproduce:
Start weston on Ubuntu22.04 as mentioned in below link:
https://gitlab.freedesktop.org/wayland/weston
In weston try to open Firefox browser from terminal provided in weston from /usr/bin/firefox
Actual results:
Firefox browser takes more than 25secs to open & while opening in terminal we can see below error:
Gtk-Message: 14:39:44.888: Not loading module "atk-bridge": The functionality is
provided by GTK natively. Please try to not load it.
[53235, Main Thread] WARNING: Settings portal not found: Error calling StartServ
iceByName for org.freedesktop.portal.Desktop: Timeout was reached: 'glib warning
', file /build/firefox/parts/firefox/build/toolkit/xre/nsSigHandlers.cpp:187
(firefox:53235): Gdk-WARNING **: 14:40:09.916: Settings portal not found: Error
calling StartServiceByName for org.freedesktop.portal.Desktop: Timeout was reach
ed
This issue is not seen when we launch firefox in X11.
Also delay issue is not seen when I compile & run firefox code from below link:
https://github.com/mozilla/gecko-dev
Expected results:
Firefox should have opened within 5secs.
Reporter | ||
Updated•1 year ago
|
Reporter | ||
Comment 1•1 year ago
|
||
Reporter | ||
Comment 2•1 year ago
|
||
Reporter | ||
Updated•1 year ago
|
![]() |
||
Updated•1 year ago
|
Comment 3•1 year ago
|
||
This bug was moved into the Performance component.
:pvharsha, could you make sure the following information is on this bug?
- For slowness or high CPU usage, capture a profile with http://profiler.firefox.com/, upload it and share the link here.
- For memory usage issues, capture a memory dump from
about:memory
and attach it to this bug. - Troubleshooting information: Go to
about:support
, click "Copy raw data to clipboard", paste it into a file, save it, and attach the file here.
If the requested information is already in the bug, please confirm it is recent.
Thank you.
Reporter | ||
Comment 4•1 year ago
|
||
need more information w.r.t below profile capturing:
"For slowness or high CPU usage, capture a profile with http://profiler.firefox.com/, upload it and share the link here."
How do i start capturing while opening the firefox browser is taking time. Can you please help me the exact steps to capture the profile.
Thanks
Comment 5•1 year ago
|
||
Comment 6•1 year ago
|
||
The Performance Impact Calculator has determined this bug's performance impact to be low. If you'd like to request re-triage, you can reset the Performance Impact flag to "?" or needinfo the triage sheriff.
Platform: Linux [x]
Impact on browser: Causes noticeable startup delay
Configuration: Specific but common
Updated•1 year ago
|
Reporter | ||
Comment 7•1 year ago
|
||
Reporter | ||
Comment 8•1 year ago
|
||
Please find the link of the profiler captured:
https://profiler.firefox.com/from-browser/calltree/?globalTrackOrder=cwg0wb&hiddenGlobalTracks=1wa&hiddenLocalTracksByPid=81264-1w57wc~82412-0~82572-0w3~82535-0~82859-0~82145-0~82721-0~82729-0~82565-01~82579-0~82299-0~82156-023&thread=i&v=10
Also find the json file downloaded from the link "Firefox 2024-09-18 12.17 profile.json.gz"
Comment 9•1 year ago
|
||
Can you try plain Mozilla binaries?
https://fedoraproject.org/wiki/How_to_debug_Firefox_problems#Testing_Mozilla_binaries
Also please attach your about:support page.
Thanks.
Updated•1 year ago
|
Reporter | ||
Comment 10•1 year ago
|
||
Reporter | ||
Comment 11•1 year ago
|
||
Reporter | ||
Comment 12•1 year ago
|
||
Downloaded new firexfox tar file 64 bit from this link: https://www.mozilla.org/en-US/firefox/new/
When i open firefox from the tar folder its opening immediately.
But when I open the already installed firefox in linux its still taking time. Have attached about:support details of the installed firefox browser which is taking time to open : firefox_raw_data.txt & firefox_text.txt
Comment 13•1 year ago
|
||
I see you're using Snap - it may be related.
Updated•1 year ago
|
Comment 14•1 year ago
|
||
I guess we're hitting a Snap sandbox restrictions here.
Assignee | ||
Comment 15•1 year ago
|
||
Long shot but what desktop environment? Could it be some dbus related timeout ? Or Wayland proxy ?
I think journalctl -fxe might help checking if there are apparmor issue
Can you also share more details on how to reproduce from scratch?
Assignee | ||
Comment 16•1 year ago
|
||
Amin, do you know of known issue related to bare Weston usage ?
Assignee | ||
Comment 17•1 year ago
|
||
(In reply to :gerard-majax from comment #15)
Long shot but what desktop environment? Could it be some dbus related timeout ? Or Wayland proxy ?
I think journalctl -fxe might help checking if there are apparmor issue
Can you also share more details on how to reproduce from scratch?
Like maybe the snap is expecting something exposed from the desktop environment that gnome/kde/others provides but bare Weston lacks?
Reporter | ||
Comment 18•1 year ago
|
||
Just to give you an overview of how to check in weston:
- clone code, compile & install wayland as mentioned in below link:
https://gitlab.freedesktop.org/wayland/wayland - Similar way clone code, compile & install wayland-protocols:
https://gitlab.freedesktop.org/wayland/wayland-protocols - clone code, compile & install weston as mentioned in below link:
https://gitlab.freedesktop.org/wayland/weston
and as mentioned in above link after compilation of all three modules, launch weston in using tty terminal in linux as mentioned in above weston link. In that you have terminal icon which opens terminal, which you can use to launch firefox.
Assignee | ||
Comment 19•1 year ago
|
||
(In reply to Sriharsha P V from comment #18)
Just to give you an overview of how to check in weston:
- clone code, compile & install wayland as mentioned in below link:
https://gitlab.freedesktop.org/wayland/wayland- Similar way clone code, compile & install wayland-protocols:
https://gitlab.freedesktop.org/wayland/wayland-protocols- clone code, compile & install weston as mentioned in below link:
https://gitlab.freedesktop.org/wayland/westonand as mentioned in above link after compilation of all three modules, launch weston in using tty terminal in linux as mentioned in above weston link. In that you have terminal icon which opens terminal, which you can use to launch firefox.
Please answer all my questions, because we ran tests with Weston with gnome Wayland for something else and never had a problem.
Comment 20•1 year ago
|
||
(In reply to :gerard-majax from comment #15)
Long shot but what desktop environment? Could it be some dbus related timeout ? Or Wayland proxy ?
I think journalctl -fxe might help checking if there are apparmor issue
Can you also share more details on how to reproduce from scratch?
I think comment 0 has the info:
Start weston on Ubuntu22.04 as mentioned in below link:
https://gitlab.freedesktop.org/wayland/weston
In weston try to open Firefox browser from terminal provided in weston from /usr/bin/firefox
Actual results:
Firefox browser takes more than 25secs to open & while opening in terminal we can see below error:
Gtk-Message: 14:39:44.888: Not loading module "atk-bridge": The functionality is
provided by GTK natively. Please try to not load it.
[53235, Main Thread] WARNING: Settings portal not found: Error calling StartServ
iceByName for org.freedesktop.portal.Desktop: Timeout was reached: 'glib warning
', file /build/firefox/parts/firefox/build/toolkit/xre/nsSigHandlers.cpp:187
(firefox:53235): Gdk-WARNING **: 14:40:09.916: Settings portal not found: Error
calling StartServiceByName for org.freedesktop.portal.Desktop: Timeout was reach
ed
Assignee | ||
Comment 21•1 year ago
|
||
What should we do if we fail to get that ? It might break a few things no? https://searchfox.org/mozilla-central/search?q=org.freedesktop.portal.Desktop&path=&case=false®exp=false
Reporter | ||
Comment 22•1 year ago
|
||
(In reply to :gerard-majax from comment #19)
(In reply to Sriharsha P V from comment #18)
Just to give you an overview of how to check in weston:
- clone code, compile & install wayland as mentioned in below link:
https://gitlab.freedesktop.org/wayland/wayland- Similar way clone code, compile & install wayland-protocols:
https://gitlab.freedesktop.org/wayland/wayland-protocols- clone code, compile & install weston as mentioned in below link:
https://gitlab.freedesktop.org/wayland/westonand as mentioned in above link after compilation of all three modules, launch weston in using tty terminal in linux as mentioned in above weston link. In that you have terminal icon which opens terminal, which you can use to launch firefox.
Please answer all my questions, because we ran tests with Weston with gnome Wayland for something else and never had a problem.
Can you please let me know what exact information you are looking for. I already gave information about how to reproduce issue on weston & what is the error log I am getting while opening.
Assignee | ||
Comment 23•1 year ago
|
||
Desktop environment? Logs from journalctl ? about:support?
Comment 24•1 year ago
|
||
org.freedesktop.portal. Desktop is supposed to be here but we may work without it - we'll miss camera capture, portals (flatpak system interfaces), GIO (filetypes), wakelock and getting system themes. But I wonder why stock Mozilla binaries works and Snap fails.
Reporter | ||
Comment 25•1 year ago
|
||
(In reply to :gerard-majax from comment #23)
Desktop environment? Logs from journalctl ? about:support?
Desktop environment:
Linux -> 6.8.12
Ubuntu 22.04 x86_64
From tty terminal we are launching opensource weston & then launching firefox from weston terminal.
Attaching about:support but journalctl is more than 150mb collected. Here i can attach only maximum 10mb file. So need any shared link where i can attach journalctl.
Reporter | ||
Comment 26•1 year ago
|
||
Reporter | ||
Comment 27•1 year ago
|
||
Reporter | ||
Comment 28•1 year ago
|
||
Assignee | ||
Comment 29•1 year ago
|
||
It's instant for me
Assignee | ||
Comment 30•1 year ago
|
||
(In reply to Sriharsha P V from comment #25)
(In reply to :gerard-majax from comment #23)
Desktop environment? Logs from journalctl ? about:support?
Desktop environment:
Linux -> 6.8.12
Ubuntu 22.04 x86_64
Do you repro on 24.04 ? This may be a bug on Ubuntu level rather (missing backported fix)
From tty terminal we are launching opensource weston & then launching firefox from weston terminal.
It would help if your video includes before you launch weston. tty terminal
do you mean you are launching weston
from a real TTY console? Or just from GNOME Terminal
or some other emulator?
Attaching about:support but journalctl is more than 150mb collected. Here i can attach only maximum 10mb file. So need any shared link where i can attach journalctl.
Window Protocol: wayland
Target Frame Rate: 60
There should be a line mentionning ubuntu:gnome
if you were running under GNOME. This suggest you are not, hence why I keep asking on precise STR, because missing GNOME Desktop running would explain why you lack proper DBus (and we do some sync call on it). I still dont get why it would be different between the snap and non snap, but maybe the handling of DBus differs there?
You can mach repackage snap --snap-name firefox
on your nightly build and try to install that using sudo snap install --dangerous ./path/to/firefox.snap --name firefox_nightly
and then you should be able to run snap run firefox_nightly
.
You can also use this build from our CI: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/OfYtxpJTRtWrf0guy7Y8xw/runs/0/artifacts/public/build/firefox_132.0a1_amd64.snap it's a debug build of the snap (more on https://treeherder.mozilla.org/jobs?repo=mozilla-central&searchStr=snap-upstream%2Cnightly%2Cdebug)
Comment 31•1 year ago
|
||
I can reproduce when starting Weston in the console.
Problem is, xdg-desktop-portal-wlr cannot be started. This does not happen in other window managers such as Hyperland or Sway.
Assignee | ||
Comment 32•1 year ago
|
||
I'm curious about the usecase of:
- depending on the snap while at the same time
- building weston from 0
I suspect there's a specific usecase here, and the goal is to leverage Snap's updating mechanism/compatibility and Weston's use is to make sure not to depend on the whole GNOME desktop.
I'm really curious what a debug snap build would show of errors so we can track where precisely it is waiting so long.
Assignee | ||
Updated•1 year ago
|
Comment 33•1 year ago
|
||
Building Weston from 0 is not a variable here, I tested with packaged Weston.
In the case of sandboxed Firefox I'm not sure there is any avoiding the portal without losing functionality — I can remember GTK_USE_PORTAL though. To be clear, I'm completely in favor of never getting tied to a particular desktop environment.
Assignee | ||
Comment 34•1 year ago
|
||
(In reply to Martin Stránský [:stransky] (ni? me) from comment #24)
org.freedesktop.portal. Desktop is supposed to be here but we may work without it - we'll miss camera capture, portals (flatpak system interfaces), GIO (filetypes), wakelock and getting system themes. But I wonder why stock Mozilla binaries works and Snap fails.
I just thought about that, and I think it's obvious: the Snap needs the portal to work, but our binaries dont use it by default unless a pref is flipped. That's likely the difference.
(In reply to Nathan Teodosio :nteodosio from comment #33)
Building Weston from 0 is not a variable here, I tested with packaged Weston.
That was not what I was implying, rather than reproducing with a custom build of weston and (allegedly) without a running GNOME sounds like a specific usecase, so I'm curious if non Snap works well why trying to use the Snap.
And if the need of the Snap is really there, lack of portal, even if we fix the delay, will impair severely the features. But maybe in this usecase it's not a problem? Or maybe it would be and the fix should not be on our side ?
Assignee | ||
Comment 35•1 year ago
|
||
Is Dbus running? What is the output of env
? Even forcing GTK_USE_PORTAL=1 DBUS_SESSION_BUS_ADDRESS=''
I cannot reproduce so far.
Reporter | ||
Comment 36•1 year ago
|
||
(In reply to Nathan Teodosio :nteodosio from comment #31)
I can reproduce when starting Weston in the console.
Problem is, xdg-desktop-portal-wlr cannot be started. This does not happen in other window managers such as Hyperland or Sway.
I just installed sway in my linux system & launched firefox from sway terminal without setting any XDG_CURRENT_DESKTOP, it launched firefox browser within 2-3secs. Dint see any delay.
Comment 37•1 year ago
|
||
Sway has this /etc/sway/config.d/50-systemd-user.conf, you could try to execute the same commands to solve your problem.
--->
import variables into system-user enviroment
based on the instructions in the sway wiki
see also https://github.com/swaywm/sway/issues/5732
and https://github.com/systemd/systemd/blob/dfc637d0ff756889e8e5b7cb4ec991eb06069aa1/xorg/50-systemd-user.sh
exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
exec hash dbus-update-activation-environment 2>/dev/null &&
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP=sway
<---
Not implying this dismisses the bug from Firefox' side.
Assignee | ||
Comment 38•1 year ago
|
||
(In reply to Sriharsha P V from comment #36)
(In reply to Nathan Teodosio :nteodosio from comment #31)
I can reproduce when starting Weston in the console.
Problem is, xdg-desktop-portal-wlr cannot be started. This does not happen in other window managers such as Hyperland or Sway.
I just installed sway in my linux system & launched firefox from sway terminal without setting any XDG_CURRENT_DESKTOP, it launched firefox browser within 2-3secs. Dint see any delay.
Could you please answer to the best you can about the usecase behind this ? Especially, does lacking desktop portal (file open, save, etc) is a problem ?
Comment 39•1 year ago
|
||
I have seen this reported in a different context, but could be related: https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/issues/104.
Reporter | ||
Comment 40•1 year ago
|
||
(In reply to :gerard-majax from comment #38)
(In reply to Sriharsha P V from comment #36)
(In reply to Nathan Teodosio :nteodosio from comment #31)
I can reproduce when starting Weston in the console.
Problem is, xdg-desktop-portal-wlr cannot be started. This does not happen in other window managers such as Hyperland or Sway.
I just installed sway in my linux system & launched firefox from sway terminal without setting any XDG_CURRENT_DESKTOP, it launched firefox browser within 2-3secs. Dint see any delay.
Could you please answer to the best you can about the usecase behind this ? Especially, does lacking desktop portal (file open, save, etc) is a problem ?
Sorry for late reply was away. Actually the usecase is Ubuntu22.04 already comes with Firefox browser installed by default. So when we launch weston on same Ubuntu machine via tty terminal, we want to use this already installed firefox for browsing in weston also. But on Ubuntu22.04 we dont see the delay in firefox opening via ubuntu terminal but when we try launching firefox from weston terminal it takes about more than 25secs to open which kind of keep user waiting for a long time. So it would be helpful if it can open fast in similar way as in ubuntu.
Assignee | ||
Comment 41•1 year ago
|
||
(In reply to Sriharsha P V from comment #40)
(In reply to :gerard-majax from comment #38)
(In reply to Sriharsha P V from comment #36)
(In reply to Nathan Teodosio :nteodosio from comment #31)
I can reproduce when starting Weston in the console.
Problem is, xdg-desktop-portal-wlr cannot be started. This does not happen in other window managers such as Hyperland or Sway.
I just installed sway in my linux system & launched firefox from sway terminal without setting any XDG_CURRENT_DESKTOP, it launched firefox browser within 2-3secs. Dint see any delay.
Could you please answer to the best you can about the usecase behind this ? Especially, does lacking desktop portal (file open, save, etc) is a problem ?
Sorry for late reply was away. Actually the usecase is Ubuntu22.04 already comes with Firefox browser installed by default. So when we launch weston on same Ubuntu machine via tty terminal, we want to use this already installed firefox for browsing in weston also. But on Ubuntu22.04 we dont see the delay in firefox opening via ubuntu terminal but when we try launching firefox from weston terminal it takes about more than 25secs to open which kind of keep user waiting for a long time. So it would be helpful if it can open fast in similar way as in ubuntu.
Thanks, it still does not explain why you want to use Firefox from a TTY console via Weston and without any desktop environment, and it does not answers whether the lack of feature I mentionned earlier would be a problem in your usecase.
Have you also had a look at https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/issues/104 ? If you experience this only on 24.04, then it's likely related. Unfortunately, I dont have enough time to try and repro that more than I could so far (i.e. trying to run firefox snap under GNOME but breaking DBus and others would not reproduce the issue for me), and if the problem really is on the desktop portal side, there's probably not a lot we can do without risking breaking badly the experience.
Comment 42•1 year ago
|
||
So it would be helpful if it can open fast in similar way as in ubuntu.
Switching to dbus-broker
seems to help with https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/issues/104, maybe try that?
Assignee | ||
Comment 43•1 year ago
|
||
(In reply to Matthijs Velsink [:velsinki] from comment #42)
So it would be helpful if it can open fast in similar way as in ubuntu.
Switching to
dbus-broker
seems to help with https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/issues/104, maybe try that?
I cannot find that information in their issue?
Comment 44•1 year ago
|
||
Sorry, see https://github.com/flatpak/xdg-desktop-portal/issues/986.
I happened to come across this as it solved https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/3037.
Reporter | ||
Comment 45•1 year ago
|
||
(In reply to :gerard-majax from comment #41)
(In reply to Sriharsha P V from comment #40)
(In reply to :gerard-majax from comment #38)
(In reply to Sriharsha P V from comment #36)
(In reply to Nathan Teodosio :nteodosio from comment #31)
I can reproduce when starting Weston in the console.
Problem is, xdg-desktop-portal-wlr cannot be started. This does not happen in other window managers such as Hyperland or Sway.
I just installed sway in my linux system & launched firefox from sway terminal without setting any XDG_CURRENT_DESKTOP, it launched firefox browser within 2-3secs. Dint see any delay.
Could you please answer to the best you can about the usecase behind this ? Especially, does lacking desktop portal (file open, save, etc) is a problem ?
Sorry for late reply was away. Actually the usecase is Ubuntu22.04 already comes with Firefox browser installed by default. So when we launch weston on same Ubuntu machine via tty terminal, we want to use this already installed firefox for browsing in weston also. But on Ubuntu22.04 we dont see the delay in firefox opening via ubuntu terminal but when we try launching firefox from weston terminal it takes about more than 25secs to open which kind of keep user waiting for a long time. So it would be helpful if it can open fast in similar way as in ubuntu.
Thanks, it still does not explain why you want to use Firefox from a TTY console via Weston and without any desktop environment, and it does not answers whether the lack of feature I mentionned earlier would be a problem in your usecase.
Have you also had a look at https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/issues/104 ? If you experience this only on 24.04, then it's likely related. Unfortunately, I dont have enough time to try and repro that more than I could so far (i.e. trying to run firefox snap under GNOME but breaking DBus and others would not reproduce the issue for me), and if the problem really is on the desktop portal side, there's probably not a lot we can do without risking breaking badly the experience.
Looks like got confused. I am launching weston from tty terminal which has its own desktop environment like sway. Weston also has its own terminal like ubuntu22.04 & it doesnot show any icons like other than terminal by default. So in weston to launch any application we use terminal. Similar fashion I am launching firefox from terminal. Please check the video I have attached Comment#1 and Comment#2 for your understanding.
Assignee | ||
Comment 46•1 year ago
|
||
Weston is not a full desktop environment, it's just a wayland display server. So I still dont know how bad it is in your case if Firefox gets fixed but lacks some important features provided by XDG Desktop Portal. Also, have you checked linked in comment 42 and 44 and the dbus-broker
workaround ? I'm really really unsure there's a bug on our side here.
Comment 47•1 year ago
|
||
You may build Firefox with --disabled-dbus option for such case.
Reporter | ||
Comment 48•1 year ago
|
||
(In reply to :gerard-majax from comment #46)
Weston is not a full desktop environment, it's just a wayland display server. So I still dont know how bad it is in your case if Firefox gets fixed but lacks some important features provided by XDG Desktop Portal. Also, have you checked linked in comment 42 and 44 and the
dbus-broker
workaround ? I'm really really unsure there's a bug on our side here.
Installing dbus-broker and then launching weston, could see firefox browser launching soon.
Assignee | ||
Comment 49•11 months ago
|
||
Martin, Nathan, do you think there's still something we may want to fix here? I would assume that it's a problem outside of firefox and its packaging at that point and comment 48 shows how to fix.
Comment 51•11 months ago
|
||
(In reply to :gerard-majax from comment #49)
Martin, Nathan, do you think there's still something we may want to fix here? I would assume that it's a problem outside of firefox and its packaging at that point and comment 48 shows how to fix.
Not actionable on Firefox side -> wontfix.
Assignee | ||
Comment 52•11 months ago
|
||
Fine by me and this documents the problem and solution
Description
•