Tor Browser under Whonix appears to consume high amounts of CPU after resuming from suspend. I’m on Qubes 4.0 with Whonix 15 and Tor Browser 9.5.1 from Tor-Browser-Downloader. This has been going on for about a year, since maybe TB 9.1 or something. It doesn’t happen every time; it’s much more likely when there are more than a couple of tabs open, or when the browser has been open for a long time. It happens often even with JS disabled. It doesn’t affect all instances at the same time; if I resume with two Tor Browsers open in two VMs, sometimes only one of them will have high CPU usage. Sometimes it is only about 50% (as if single threaded), but usually it is 100%; all VMs have 2 vCPUs assigned. Closing and reopening the browser brings it back to normal CPU usage, but the new identity button does not. Usually neither the browser nor other apps seem noticeably slow when this happens, unless I cap the CPU usage with Xen. It does make the fan run at full speed after a while though.
This does not happen with Firefox from the Fedora 30/31/32 templates, nor Firefox ESR from the Debian 10 template!
As I recall, it also did not seem to affect a vanilla Tor Browser bundle in a Debian 10 VM last time I tested it, although I haven’t tested this very much because it’s not a normal use-case for me.
In other words, it appears to be Whonix-specific, from what I can tell at this time.
If I attach with strace, this is what I get:
strace: Process 2058 attached
strace: [ Process PID=2058 runs in x32 mode. ]
strace: [ Process PID=2058 runs in 64 bit mode. ]
clock_gettime(CLOCK_MONOTONIC, {tv_sec=74149, tv_nsec=310089525}) = 0
write(22, “M”, 1) = 1
futex(0x7b7821789ce8, FUTEX_WAKE_PRIVATE, 1) = 1
gettimeofday({tv_sec=1595780096, tv_usec=356508}, NULL) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=74149, tv_nsec=311125577}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=74149, tv_nsec=311168045}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=74149, tv_nsec=311196979}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=74149, tv_nsec=311236352}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=74149, tv_nsec=311263983}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=74149, tv_nsec=311305851}) = 0
recvmsg(4, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=33, events=POLLIN}, {fd=58, events=POLLIN}, {fd=93, events=POLLIN}], 5, 0) = 1 ([{fd=33, revents=POLLIN}])
clock_gettime(CLOCK_MONOTONIC, {tv_sec=74149, tv_nsec=311561976}) = 0
read(33, “\372”, 1) = 1
clock_gettime(CLOCK_MONOTONIC, {tv_sec=74149, tv_nsec=311637326}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=74149, tv_nsec=311667442}) = 0
recvmsg(4, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=33, events=POLLIN}, {fd=58, events=POLLIN}, {fd=93, events=POLLIN}], 5, 0) = 0 (Timeout)
clock_gettime(CLOCK_MONOTONIC, {tv_sec=74149, tv_nsec=311782775}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=74149, tv_nsec=311813563}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=74149, tv_nsec=311838449}) = 0
gettimeofday({tv_sec=1595780096, tv_usec=357368}, NULL) = 0
ioctl(67, FIONREAD, [0]) = 0
ioctl(67, FIONREAD, [0]) = 0
recvfrom(67, “”, 0, 0, NULL, NULL) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=74149, tv_nsec=313367252}) = 0
write(22, “M”, 1) = 1
futex(0x7b7821789ce8, FUTEX_WAKE_PRIVATE, 1) = 1
gettimeofday({tv_sec=1595780096, tv_usec=359566}, NULL) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=74149, tv_nsec=314408674}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=74149, tv_nsec=314687501}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=74149, tv_nsec=314899254}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=74149, tv_nsec=315282810}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=74149, tv_nsec=315847167}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=74149, tv_nsec=316099525}) = 0
And it just repeats, as fast as the terminal can print.
This is the /proc/2058/fd directory:
0 -> /dev/null
1 -> /dev/null
2 -> /dev/null
3 -> anon_inode:inotify
4 -> socket:[22530]
5 -> anon_inode:[eventfd]
6 -> socket:[194424]
7 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/.parentlock
8 -> anon_inode:[eventpoll]
9 -> pipe:[22534]
10 -> pipe:[22534]
11 -> pipe:[22535]
12 -> pipe:[22535]
13 -> /home/user/.tb/tor-browser/Browser/omni.ja
14 -> /home/user/.tb/tor-browser/Browser/browser/omni.ja
15 -> pipe:[22541]
16 -> pipe:[22541]
17 -> pipe:[21811]
18 -> pipe:[21811]
19 -> socket:[22542]
20 -> /dev/urandom
21 -> pipe:[22544]
22 -> pipe:[22544]
23 -> anon_inode:[eventpoll]
24 -> pipe:[21812]
25 -> pipe:[21812]
26 -> anon_inode:[eventpoll]
27 -> pipe:[22545]
28 -> pipe:[22545]
29 -> anon_inode:[eventfd]
30 -> socket:[21827]
31 -> anon_inode:[eventfd]
32 -> /dev/shm/org.chromium.6SweMh (deleted)
33 -> pipe:[21830]
34 -> pipe:[21830]
35 -> /dev/shm/org.chromium.cmk7u8 (deleted)
36 -> /dev/shm/org.chromium.WdgMgF (deleted)
37 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/startupCache/startupCache.8.little
38 -> socket:[196242]
39 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/cookies.sqlite
40 -> /dev/shm/org.chromium.Slusad (deleted)
41 -> /dev/shm/org.chromium.SOT9qZ (deleted)
42 -> /dev/shm/org.chromium.WbMSHL (deleted)
43 -> /dev/shm/org.chromium.2BpDYx (deleted)
44 -> /dev/shm/org.chromium.ytFpfk (deleted)
45 -> /dev/shm/org.chromium.EbCdw6 (deleted)
46 -> /dev/shm/org.chromium.GpGaNS (deleted)
47 -> /dev/shm/org.chromium.CwDe4E (deleted)
48 -> /dev/shm/org.chromium.4v4klr (deleted)
49 -> /dev/shm/org.chromium.y69sCd (deleted)
50 -> /dev/shm/org.chromium.cCBCTZ (deleted)
51 -> /dev/shm/org.chromium.A5qPaM (deleted)
52 -> /dev/shm/org.chromium.0dI4ry (deleted)
53 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/places.sqlite
54 -> /dev/shm/org.chromium.mxFe3j (deleted)
55 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/favicons.sqlite
56 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/favicons.sqlite-wal
57 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/places.sqlite-wal
58 -> socket:[21867]
59 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/webappsstore.sqlite
60 -> socket:[196247]
61 -> /dev/shm/org.chromium.GEXWcH (deleted)
62 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/places.sqlite
63 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/places.sqlite-wal
64 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/favicons.sqlite
65 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/favicons.sqlite-wal
66 -> socket:[196249]
67 -> socket:[22275]
68 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/formhistory.sqlite
69 -> socket:[22240]
70 -> socket:[22650]
71 -> socket:[22651]
72 -> socket:[21991]
73 -> socket:[21993]
74 -> socket:[22654]
75 -> socket:[21995]
76 -> pipe:[21868]
77 -> socket:[22737]
78 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/content-prefs.sqlite
79 -> socket:[22739]
80 -> socket:[196251]
81 -> socket:[22741]
82 -> socket:[22749]
83 -> socket:[196056]
84 -> socket:[22747]
85 -> socket:[22748]
86 -> socket:[21987]
87 -> socket:[22751]
88 -> socket:[196661]
89 -> socket:[196998]
90 -> pipe:[22762]
91 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/webappsstore.sqlite-wal
92 -> pipe:[196058]
93 -> socket:[25379]
94 -> socket:[196662]
95 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/storage-sync.sqlite
96 -> socket:[196652]
97 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/extensions/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi
98 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/places.sqlite
99 -> socket:[196668]
100 -> socket:[22795]
101 -> socket:[196654]
102 -> socket:[196295]
103 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/places.sqlite
104 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/places.sqlite-wal
105 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/favicons.sqlite
106 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/favicons.sqlite-wal
107 -> socket:[201186]
108 -> socket:[196656]
109 -> socket:[23776]
110 -> socket:[196663]
111 -> socket:[196665]
112 -> socket:[196991]
113 -> socket:[196254]
114 -> socket:[197000]
115 -> pipe:[23237]
116 -> pipe:[196256]
117 -> socket:[197002]
118 -> socket:[197126]
119 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/favicons.sqlite
120 -> socket:[196278]
121 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/webappsstore.sqlite
122 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/webappsstore.sqlite-wal
123 -> socket:[197958]
124 -> socket:[196280]
125 -> socket:[197217]
126 -> socket:[196282]
127 -> socket:[23714]
128 -> socket:[196290]
129 -> socket:[197219]
130 -> pipe:[150985]
131 -> socket:[196288]
132 -> socket:[196289]
133 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/places.sqlite
134 -> socket:[196578]
135 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/places.sqlite-wal
136 -> socket:[196292]
137 -> socket:[197221]
138 -> pipe:[196580]
139 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/favicons.sqlite
140 -> socket:[197191]
141 -> socket:[151017]
142 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/favicons.sqlite-wal
143 -> socket:[197223]
144 -> socket:[197193]
145 -> /dev/shm/org.chromium.cmk7u8 (deleted)
146 -> socket:[194446]
147 -> socket:[197195]
148 -> /home/user/.tb/tor-browser/Browser/TorBrowser/Data/Browser/profile.default/cookies.sqlite-wal
149 -> socket:[197203]
151 -> socket:[197201]
152 -> socket:[197202]
153 -> pipe:[151356]
154 -> socket:[152581]
155 -> socket:[201181]
156 -> socket:[197205]
157 -> socket:[202288]
158 -> socket:[201188]
159 -> socket:[201175]
160 -> socket:[222114]
161 -> socket:[197211]
162 -> socket:[201190]
163 -> /home/user/.tb/tor-browser/Browser/.cache/event-sound-cache.tdb.b08dfa6083e7567a1921a715000001fb.x86_64-pc-linux-gnu
164 -> pipe:[201867]
165 -> socket:[202257]
166 -> socket:[212847]
167 -> socket:[202259]
169 -> pipe:[152692]
170 -> socket:[202261]
171 -> socket:[202269]
173 -> socket:[202267]
174 -> socket:[152811]
175 -> socket:[202268]
177 -> socket:[202271]
ss -x -p | grep 2058
u_str ESTAB 0 0 * 196254 * 196255 users:((“firefox.real”,pid=2058,fd=113))
u_str ESTAB 0 0 * 196280 * 196281 users:((“firefox.real”,pid=2058,fd=124))
u_str ESTAB 0 0 * 196056 * 196057 users:((“firefox.real”,pid=2058,fd=83))
u_str ESTAB 0 0 * 196278 * 196279 users:((“firefox.real”,pid=2058,fd=120))
u_str ESTAB 0 0 * 197191 * 197192 users:((“firefox.real”,pid=2058,fd=140))
u_str ESTAB 0 0 * 196292 * 196293 users:((“firefox.real”,pid=2058,fd=136))
u_seq ESTAB 0 0 * 151017 * 0 users:((“firefox.real”,pid=2058,fd=141))
u_str ESTAB 0 0 * 197193 * 197194 users:((“firefox.real”,pid=2058,fd=144))
u_seq ESTAB 0 0 * 152581 * 0 users:((“firefox.real”,pid=2058,fd=154))
u_seq ESTAB 0 0 * 196289 * 196288 users:((“file:// Content”,pid=2252,fd=24),(“firefox.real”,pid=2058,fd=132))
u_seq ESTAB 0 0 * 22650 * 22651 users:((“Web Content”,pid=3079,fd=5),(“Web Content”,pid=2302,fd=5),(“WebExtensions”,pid=2277,fd=5),(“file:// Content”,pid=2252,fd=5),(“Web Content”,pid=2220,fd=5),(“firefox.real”,pid=2058,fd=70))
u_str ESTAB 0 0 * 194424 * 194425 users:((“firefox.real”,pid=2058,fd=6))
u_str ESTAB 0 0 * 196656 * 196657 users:((“firefox.real”,pid=2058,fd=108))
u_str ESTAB 0 0 * 22240 * 22239 users:((“firefox.real”,pid=2058,fd=69))
u_str ESTAB 0 0 * 196282 * 196283 users:((“firefox.real”,pid=2058,fd=126))
u_seq ESTAB 0 0 * 196288 * 196289 users:((“firefox.real”,pid=2058,fd=131))
u_str ESTAB 0 0 * 196652 * 196653 users:((“firefox.real”,pid=2058,fd=96))
u_str ESTAB 0 0 * 196295 * 196294 users:((“firefox.real”,pid=2058,fd=102))
u_str ESTAB 0 0 * 25379 * 25380 users:((“firefox.real”,pid=2058,fd=93))
u_str ESTAB 0 0 * 194446 * 194447 users:((“firefox.real”,pid=2058,fd=146))
u_str ESTAB 0 0 * 196654 * 196655 users:((“firefox.real”,pid=2058,fd=101))
u_str ESTAB 0 0 * 196578 * 196579 users:((“firefox.real”,pid=2058,fd=134))
u_seq ESTAB 0 0 * 22795 * 0 users:((“firefox.real”,pid=2058,fd=100))
u_str ESTAB 0 0 * 22275 * 0 users:((“firefox.real”,pid=2058,fd=67))
u_str ESTAB 0 0 * 201175 * 201176 users:((“firefox.real”,pid=2058,fd=159))
u_str ESTAB 0 0 * 196290 * 196291 users:((“firefox.real”,pid=2058,fd=128))
u_str ESTAB 0 0 * 21867 * 22643 users:((“firefox.real”,pid=2058,fd=58))
u_str ESTAB 0 0 * 196663 * 196664 users:((“firefox.real”,pid=2058,fd=110))
u_seq ESTAB 0 0 * 197202 * 197201 users:((“Web Content”,pid=2302,fd=22),(“firefox.real”,pid=2058,fd=152))
u_str ESTAB 0 0 * 21827 * 21828 users:((“firefox.real”,pid=2058,fd=30))
u_str ESTAB 0 0 * 197195 * 197196 users:((“firefox.real”,pid=2058,fd=147))
u_str ESTAB 0 0 * 196668 * 196667 users:((“firefox.real”,pid=2058,fd=99))
u_str ESTAB 0 0 * 202288 * 202287 users:((“firefox.real”,pid=2058,fd=157))
u_seq ESTAB 0 0 * 197201 * 197202 users:((“firefox.real”,pid=2058,fd=151))
u_str ESTAB 0 0 * 202271 * 202272 users:((“firefox.real”,pid=2058,fd=177))
u_seq ESTAB 0 0 * 152811 * 0 users:((“firefox.real”,pid=2058,fd=174))
u_seq ESTAB 0 0 * 196662 * 196661 users:((“Web Content”,pid=2220,fd=26),(“firefox.real”,pid=2058,fd=94))
u_seq ESTAB 0 0 * 23714 * 0 users:((“firefox.real”,pid=2058,fd=127))
u_str ESTAB 0 0 * 233752 * 233753 users:((“firefox.real”,pid=2058,fd=160))
u_seq ESTAB 0 0 * 196661 * 196662 users:((“firefox.real”,pid=2058,fd=88))
u_str ESTAB 0 0 * 197203 * 197204 users:((“firefox.real”,pid=2058,fd=149))
u_str ESTAB 0 0 * 196665 * 196666 users:((“firefox.real”,pid=2058,fd=111))
u_str ESTAB 0 0 * 197205 * 197206 users:((“firefox.real”,pid=2058,fd=156))
u_str ESTAB 0 0 * 197217 * 197216 users:((“firefox.real”,pid=2058,fd=125))
u_str ESTAB 0 0 * 202257 * 202258 users:((“firefox.real”,pid=2058,fd=165))
u_str ESTAB 0 0 * 22654 * 22655 users:((“firefox.real”,pid=2058,fd=74))
u_str ESTAB 0 0 * 22749 * 22750 users:((“firefox.real”,pid=2058,fd=82))
u_seq ESTAB 0 0 * 202267 * 202268 users:((“firefox.real”,pid=2058,fd=173))
u_str ESTAB 0 0 * 22739 * 22740 users:((“firefox.real”,pid=2058,fd=79))
u_str ESTAB 0 0 * 22737 * 22738 users:((“firefox.real”,pid=2058,fd=77))
u_seq ESTAB 0 0 * 202268 * 202267 users:((“Web Content”,pid=3079,fd=22),(“firefox.real”,pid=2058,fd=175))
u_seq ESTAB 0 0 * 22747 * 22748 users:((“firefox.real”,pid=2058,fd=84))
u_str ESTAB 0 0 * 22741 * 22742 users:((“firefox.real”,pid=2058,fd=81))
u_seq ESTAB 0 0 * 22748 * 22747 users:((“WebExtensions”,pid=2277,fd=22),(“firefox.real”,pid=2058,fd=85))
u_str ESTAB 0 0 * 22751 * 22752 users:((“firefox.real”,pid=2058,fd=87))
u_str ESTAB 0 0 * 202259 * 202260 users:((“firefox.real”,pid=2058,fd=167))
u_str ESTAB 0 0 * 202261 * 202262 users:((“firefox.real”,pid=2058,fd=170))
u_str ESTAB 0 0 * 202269 * 202270 users:((“firefox.real”,pid=2058,fd=171))
u_seq ESTAB 0 0 * 22651 * 22650 users:((“firefox.real”,pid=2058,fd=71))
u_str ESTAB 0 0 * 22530 * 22531 users:((“firefox.real”,pid=2058,fd=4))
This is in the main process (firefox.real). Child processes (Web Extensions, Web Content, file:// Content, etc) continue to have normal CPU usage from what I can tell.
It appears to be clock-related, but sdwdate shows the VM is synced and nothing abnormal that I can see. Whonixcheck doesn’t show any warnings or errors.
I was wondering if anyone else has had this problem, or if there are any simple ways to debug this further? Any ideas are appreciated.
Edit: I forgot to mention, firefox’s internal task manager (about:performance) doesn’t show any high-impact processes, either.