Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Firefox only works with strace (freezes without)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
saturnalia0
Apprentice
Apprentice


Joined: 13 Oct 2016
Posts: 161

PostPosted: Mon Feb 03, 2025 11:43 pm    Post subject: Firefox only works with strace (freezes without) Reply with quote

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! :twisted:

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 :lol:

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 (nothing too fancy if possible, I'm reasonably busy).

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
Back to top
View user's profile Send private message
Juippisi
Developer
Developer


Joined: 30 Sep 2005
Posts: 760
Location: /home

PostPosted: Tue Feb 04, 2025 6:08 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
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