SIGCONT (CONT signal) no longer works on Firefox processes
Categories
(Core :: DOM: Content Processes, defect)
Tracking
()
People
(Reporter: bugzillaPost120030in, Unassigned)
Details
For years (since 2010) I've relied on the following bash function to suspend firefox when I wanted to keep the state of open tabs, but have it not use CPU. When run on a command line, it suspends the Firefox processes by sending 'em a STOP signal, until the user enters something, at which point it sends it a CONT signal, after which Firefox works as before. At least that's been the case for years.
sleepfirefox () {
THEPID=`ps -ef | grep -v grep | grep Firefox | awk '{print $2}'`;
echo " THEPID: $THEPID."
trap "kill -SIGCONT $THEPID" SIGINT ;
kill -SIGSTOP $THEPID ;
for ((;i!=255;))
do
if read -t 1800 WHATEVER ;
then
i=255 ;
else
kill -SIGCONT $THEPID ;
sleep 5 ;
kill -SIGSTOP $THEPID ;
echo -n Firefox was kept frozen for past half hour [# ${i}]\; gave it half a minute to breathe. Now: ;
date ;
fi
done
kill -SIGCONT $THEPID ;
trap SIGINT ;
i= ;
}
Recently, it (sleepfirefox) stopped working, in the sense that when continued, the firefox processes do continue, but all UI interaction is absurdly slow. After an extended period of time (h hours), it starts working normally again.
(To be continued, with revisions, momentarily.)
Reporter | ||
Comment 1•5 years ago
|
||
I was wondering if some kind of new anti-cryptojacking feature is causing this. Looking at the version history, I think it must the the cryptomining and fingering protections added in Firefox 68. Ok, so I'm de-confirming and assigning this to myself and will confirm that it appeared in 68; I think it's not a good bug report 'till I've at least done that, and specified a range for h. But it'll be here if someone's looking for it.
OT aside: BTW, I wrote a few working forks too - sleepsafari and sleepchrome. The set has been really useful; I've used it >> 1000 times over the years. If anyone wants the code / to use sleepfirefox, sleepsafari and/or sleepchrome, let me know and I'll put the code up on github (or whatever folks are using most since M$ borged it. (assimilated it; see https://www.yourdictionary.com/Borg)). I use it on MacOS, but it's probably fully cross-platform.
Reporter | ||
Updated•5 years ago
|
Comment 2•5 years ago
|
||
Could you use https://mozilla.github.io/mozregression/ to determine when this changed?
Updated•5 years ago
|
Updated•5 years ago
|
Reporter | ||
Comment 3•5 years ago
|
||
Summary: I (still) plan to keep trying to.
FYI: I didn't have mozregression installed and am on MacOS. I started installing mozregression and got distracted. It's appears the GUI version is not available on MacOS. Trying anyway. Got a warning, but it seems to have installed OK... And I have to stop for the day, at least. Sorry again. (Yup. CLI only.) At least I managed to disable clearing of the needinfo before saving. :=}
Comment 4•5 years ago
•
|
||
Flagging this bug for "DOM: Content Processes" triage.
Comment 5•5 years ago
|
||
Closing this bug as WONTFIX because we don't want to support random processes being suspended unexpectedly. If a background tab process is using too much CPU, we should fix that bug by better throttling of background tabs.
Reporter | ||
Updated•5 years ago
|
Updated•5 years ago
|
Description
•