View previous topic :: View next topic |
Author |
Message |
saturnalia0 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 13 Oct 2016 Posts: 163
|
Posted: Mon Feb 03, 2025 11:43 pm Post subject: Firefox only works with strace (freezes without) |
|
|
I'm using www-client/firefox-bin-134.0.2 and since a few versions ago have been getting frequent freezes on Gentoo, but not on Windows on the same machine (nor on a separate Mac machine).
The issue happens frequently but irregularly on sites like Zoom and Google Meet. On Stripe checkout I can reproduce it 100% of the time when typing the credit card. Great I thought, I'll start by stracing it. Turns out, then the bug happens 0% of the time!
I guess I could just use firefox with strace? I'm doing it now as I type. It's a bit slower than usual, but perfectly bearable, so I guess that patches it... But why?
Code: |
# This is how I normally launch firefox, and it has been freezing frequently as of late
me@localhost ~ $ xhost si:localuser:ff && sudo -u ff apulse firefox-bin -P & exit
# This is me being stupid and running strace without -f to follow processes, and it still hangs
me@localhost ~ $ xhost si:localuser:ff && sudo -u ff strace -Z apulse firefox-bin -P 2>&1 | sort -h | uniq >strace.log
# Running with -f it logs the syscalls of interest, but does not freeze! Ever!
me@localhost ~ $ xhost si:localuser:ff && sudo -u ff strace -Z -f apulse firefox-bin -P 2>&1 | sort -h | uniq >strace.log
|
ff is my sandbox user, it has nothing special just lacks access to /home/me. I don't have any DE, just dwm as a WM.
I suspect the issue might be related to hw accel or webgl because of the nature of the websites where it happens. If I don't use those websites the issue does not present, as far as I could tell from browsing for several hours. Pursuant to suggestions from Firefox support forums I have tried disabling webgl related settings, disabling hw accel, running on "troubleshooting mode" which disables addons etc, all to no avail.
The process does not crash, the UI just freezes, entirely - can't go back, switch tabs, etc. Incoming audio stops, I have the impression that only when I try to interact with the already hung up UI, but I couldn't confirm. I have to kill the process and retry my actions, and sometimes the issue only goes away after trying a few times (to join the Zoom meeting for example).
I've searched online for other people whose Firefox only works with strace, to no avail
I've polled the gentoo IRC channel but no one there seems to have this issue (I only mentioned the freezes, I hadn't used strace yet), so I was wondering if anyone here has experienced this or something similar and knows what the heck could be happening and what I could do to further debug it.
I haven't documented this so I apologize for the lack of specifics, I can only say it started a couple of versions ago and persists in the current Gentoo version. I can supply additional info relevant for debugging. PS: nvidia card and proprietary drivers
Last edited by saturnalia0 on Wed Feb 05, 2025 10:52 am; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Juippisi Developer
![Developer Developer](/images/ranks/rank-dev.gif)
![](images/avatars/807759109442827505b55d.gif)
Joined: 30 Sep 2005 Posts: 761 Location: /home
|
Posted: Tue Feb 04, 2025 6:08 am Post subject: |
|
|
I can't really explain why stracing makes it work, but generally I've heard people using this method of sudo -u ff having performance problems. It has probably something to do with required user access to /dev, /sys etc. Try launching firefox with your own user, without invoking sudo at all. I bet it'll work. You could also try flatpak?
Personally I'd recommend using an external sandbox application, like firejail or bubblewrap over the sudo method to limit firefox's access to your /home dir. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
saturnalia0 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 13 Oct 2016 Posts: 163
|
Posted: Wed Feb 05, 2025 10:53 am Post subject: |
|
|
Thank you for the suggestion, I hadn't thought of it! It does seem smoother/faster running as my user (just `apulse firefox-bin`), but it still freezes on Stripe checkout. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
saturnalia0 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 13 Oct 2016 Posts: 163
|
Posted: Wed Feb 05, 2025 11:43 am Post subject: |
|
|
Well after tweaking with the command line options I was able to reproduce the error with strace. I'm beginning to suspect it might be a race condition, due to the non-deterministic nature of the issue and the fact that it is less likely to happen under the slowed-down strace runs.
strace output is quite verbose, I tried to trim it down by only capturing unique syscalls that returned an error (strace -f -Z | sort -h | uniq), then doing a diff between a good and a bad run, excluding PIDs, timestamps, cache entries and other irrelevant variables, then I tried to manually look for entries of interest. This is the distilled down entries that are only present in the bad run:
Code: |
< [pid PID] prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, HEX, 917504, "js-executable-memory") = -1 EINVAL (Invalid argument)
< [pid PID] rt_sigreturn({mask=[]}) = -1 EACCES (Permission denied)
< [pid PID] rt_sigreturn({mask=[]}) = -1 EINVAL (Invalid argument)
< [pid PID] rt_sigreturn({mask=[]}) = -1 ENOENT (No such file or directory)
< [pid PID] semctl(1, 0, IPC_SET, {sem_perm={uid=1000, gid=18, mode=0660}}) = -1 EPERM (Operation not permitted)
< [pid PID] setpriority(PRIO_PROCESS, PID, -2) = -1 EACCES (Permission denied)
< [pid PID] shmctl(12, IPC_SET, {shm_perm={uid=1000, gid=18, mode=0660}}) = -1 EPERM (Operation not permitted)
|
I'm not sure if they are relevant.
I could not share the full output via pastebin - even capturing only unique errored calls it's still >1MB... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|