# Chromium uses 100% of a core, hangs on exit



## tingo (Jul 6, 2015)

Chromium 43.0.2357.130 fixed the problem with crashes in Settings. But there is still problems:
If I start Chromium and then quit it after a short time (say 5 - 10 minutes) everything is well. If I wait longer, a Chrome process will stick around after quitting Chromium, and it will use 100% of a cpu core. I can kill it via `kill -QUIT ...` but then of course it core dumps.
What can we do to find this problem so it can be fixed?


----------



## protocelt (Jul 6, 2015)

I don't have this problem myself in either HEAD or 10-STABLE. Does this happen for you with an empty profile and/or no extensions installed?


----------



## drhowarddrfine (Jul 6, 2015)

I have it on 9.3-RELEASE and I've seen others talk about it but haven't had a chance to look into it or make sure there's a PR for it. The www/chromium people have commented that they really struggle with www/chromium.


----------



## tingo (Jul 7, 2015)

protocelt said:


> I don't have this problem myself in either HEAD or 10-STABLE. Does this happen for you with an empty profile and/or no extensions installed?


I know how to test with no extensions, and will do so. How do I test with an empty profile (and get my profile back afterwards)?


----------



## protocelt (Jul 7, 2015)

Just rename your configuration directory to something else, restart the browser, test and rename the directory back again when your done after deleting the newly created directory. `mv ~/.config/chromium ~/.config/chromium_bak`


----------



## tingo (Jul 7, 2015)

Ok, with an empty profile and without extensions - it still hangs on exit, the hanging process using 100% of a cpu core:

```
tingo@kg-core1$ pgrep -lf chrome
90005 chrome:
90003 /bin/sh /usr/local/bin/chrome
```
process id of the "100%" process is 90005 in this case.
This on:

```
tingo@kg-core1$ uname -a
FreeBSD kg-core1.kg4.no 9.3-STABLE FreeBSD 9.3-STABLE #0 r273918: Fri Oct 31 22:52:44 CET 2014
  root@kg-core1.kg4.no:/usr/obj/usr/src/sys/GENERIC  amd64
```


----------



## protocelt (Jul 7, 2015)

I don't have any idea what is causing it but I don't have any machines running 9.3-*. I also took a look quick and don't see any PRs filed resembling this issue. Since drhowarddrfine also mentioned he has this issue also on 9.3-* and possibly others, could you possibly file a PR for this?


----------



## cduret (Jul 9, 2015)

Same problem for me.
I have wiped out my ~/.config/chromium settings folder and still have one chrome process that loop at 100% CPU time.
Have to quit chrome and kill the looping process every time !
my version : 10.1-STABLE amd64


----------



## cduret (Jul 9, 2015)

Interestingly it appears to behave nicely if I remove the settings folder and I don't sign in with my Google account...


----------



## rabfulton (Jul 11, 2015)

Same problem here on 10.0-RELEASE-p2 amd64.

Trying out www/chromium for the first time here after `pkg` decided to wipe www/firefox from my system. It appears to work if no plugins or extensions are loaded. Seriously this is a problem. Do I really need to switch back to ports to have a web browser on FreeBSD?


----------



## drhowarddrfine (Jul 11, 2015)

rabfulton said:


> Do I really need to switch back to ports to have a web browser on FreeBSD?


I have the problem and I installed from ports.

No amount of complaining here is going to fix it. The maintainers have stated, in the past, that chrome/chromium has become a beast to maintain.


----------



## rabfulton (Jul 11, 2015)

Perhaps there should be a stable and development packages in this case?

For users, particularly new users, it reflects poorly on FreeBSD if there isn't a working web browser that can be installed.


----------



## drhowarddrfine (Jul 12, 2015)

All the browsers you can install on any other OS can be installed on FreeBSD, including chromium which I use all day, every day. Ports of third party software, including chromium, have nothing directly to do with FreeBSD the OS.


----------



## protocelt (Jul 12, 2015)

www/chromium was just updated today. Maybe this issue has been fixed with the update?


----------



## drhowarddrfine (Jul 13, 2015)

Nope.


----------



## ksym (Jul 24, 2015)

FYI there's a related PR https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=201543

"This bug is triggered *before* r272566 - not after. the commit in question fixed the bug which was triggering this failure."

Maybe they mean the following commit to base: https://svnweb.freebsd.org/base?view=revision&revision=272566

So now it's either www/chromium gets a q&d patch, or you upgrade your system now.

I am going to upgrade my 10.1-RELEASE to 10.2-BETA2 with freebsd-update and see if it fixes the problem. I will post an update after I've upgraded, rebooted and tested www/chromium.


----------



## ksym (Jul 24, 2015)

rabfulton said:


> Perhaps there should be a stable and development packages in this case?
> 
> For users, particularly new users, it reflects poorly on FreeBSD if there isn't a working web browser that can be installed.



There's plenty other browsers: https://www.freebsd.org/doc/handbook/desktop-browsers.html

I've had similar problems with software even in Windows. These problems are temporal, and the short term solutions is always 1) fix the problem or 2) try another piece of software 

Otherwise one just gotta wait until the problem is fixed in system or in the software.


----------



## ksym (Jul 24, 2015)

I can now confirm that upgrading to 10.2-BETA2 fixes the high CPU usage problem with www/chromium

I did as follows

`freebsd-update upgrade -r 10.2-BETA2
freebsd-update install`

The above upgrades only the kernel, and asks you to reboot into single user mode. If you are a daredevil, you could do `freebsd-update install` again, but you might get some programs crashing on shutdown. Since I am a gent, I continued as follows:

`nextboot -o "-s" -k kernel
shutdown -r now`

The `nextboot -o "-s" -k kernel` command instructs loader to boot the upgraded kernel into single user mode once. The reboot after that would boot normally. Then, after I got into single user mode I did the following:

`mount -o rw /
freebsd-update install
shutdown -r now`

After that, my rig happily booted 10.2-BETA2.

I started my VNCServer, and www/chromium in it, and now chrome no longer exhausts CPU.

Problem solved as far as I am concerned. I am not concerned about the stability of 10.2-BETA2, even if it is a beta release. I've never had any stability problems with beta releases, ever. Only problems I've ever run into where minor regressions, but those were always fixed in due time.

I suppose the people who cannot do this are
- those who have to keep the rig running because it is a production server of some kind
- people who do not have time to do a system upgrade; the single user upgrade of userland can take some time, if your rig is slow


----------



## tingo (Aug 22, 2015)

I'm still on FreeBSD 9.3-stable:

```
tingo@kg-core1$ uname -a
FreeBSD kg-core1.kg4.no 9.3-STABLE FreeBSD 9.3-STABLE #0 r273918: Fri Oct 31 22:52:44 CET 2014  root@kg-core1.kg4.no:/usr/obj/usr/src/sys/GENERIC  amd64
```
I just upgraded Chromium to 44.0.2403.130:

```
root@kg-core1# pv chrom*
[Reading data from pkg(8) ... - 835 packages found - done]
chromium-44.0.2403.130  =  up-to-date with port
```
and it still hangs on exit, using 100% of a core.


----------



## cpm@ (Aug 23, 2015)

Chromium now requires FreeBSD 10.2-RELEASE.


----------



## tingo (Aug 23, 2015)

cpm said:


> Chromium now requires FreeBSD 10.2-RELEASE.


Interesting statement. Documented where?


----------



## cpm@ (Aug 23, 2015)

tingo said:


> Interesting statement. Documented where?



Please, see PR 201543.


----------



## tingo (Aug 23, 2015)

Well, it (PR 201543) only says that the bug fix is in 10.2. It does not say that other supported branches of FreeBSD won't get fixed.


----------



## cpm@ (Aug 23, 2015)

Note that chrome only works fine on 10.2 ATM. If you want to still using chrome on other FreeBSD branches is necessary to downgrade.


----------



## tingo (Sep 13, 2015)

Upgraded my FreeBSD 9.3-stable to latest:

```
tingo@kg-core1$ uname -a
FreeBSD kg-core1.kg4.no 9.3-STABLE FreeBSD 9.3-STABLE #1 r287724: Sun Sep 13 00:23:47 CEST 2015
  root@kg-core1.kg4.no:/usr/obj/usr/src/sys/GENERIC  amd64
```
and upgraded to latest Chromium

```
root@kg-core1# pv chrom*
[Reading data from pkg(8) ... - 691 packages found - done]
chromium-45.0.2454.85  =  up-to-date with port
```
and now Chrome manages to use 100% of two cores:

```
root@kg-core1# ps ax -p 32877
  PID TT  STAT  TIME COMMAND
32877 v1  I  14:47.24 chrome:  (chrome)
```
not impressed.


----------



## drhowarddrfine (Sep 14, 2015)

As he said:





cpm said:


> Note that chrome only works fine on 10.2 ATM.


----------



## tingo (Sep 29, 2015)

Latest Chromium

```
root@kg-core1# pv chrom*
[Reading data from pkg(8) ... - 729 packages found - done]
chromium-45.0.2454.101  =  up-to-date with port
```
also uses 100% of two cores on exit. Still on FreeBSD 9.3-stable:

```
tingo@kg-core1$ uname -a
FreeBSD kg-core1.kg4.no 9.3-STABLE FreeBSD 9.3-STABLE #1 r287724: Sun Sep 13 00:23:47 CEST 2015
  root@kg-core1.kg4.no:/usr/obj/usr/src/sys/GENERIC  amd64
```
In case this information is useful to those trying to get Chromium to work properly on FreeBSD.


----------



## drhowarddrfine (Sep 30, 2015)

tingo Of course it does. As stated earlier and at the top of this page. That is not new information.


----------



## tingo (Oct 1, 2015)

I'm not following you. What isn't new information? That a new version of Chromium (still) doesn't work on FreeBSD 9.3-stable?


----------



## drhowarddrfine (Oct 2, 2015)

Yes, and according to cpm previous post here, it may never.


----------



## protocelt (Oct 2, 2015)

IIRC, there was a change made to the kernel in 11-CURRENT that worked around the issue with Chromium but did not actually fix the problem (Chromium) itself. The change made to to kernel was MFC'd to 10-STABLE before 10.2-RELEASE was released which then included the change. It was not MFC'd to 9.3-STABLE however and won't be for reasons I can't remember at this time. So, from what I understand, Chromium still technically has this issue on all branches. It's just worked around on 10.2-RELEASE and up through a change in the kernel.


----------



## tingo (Oct 15, 2015)

Well, I decided to test this. So I installed a fresh virtual machine in VirtualBox, with FreeBSD 10.2-release:

```
root@p1# uname -a
FreeBSD p1.kg4.no 10.2-RELEASE FreeBSD 10.2-RELEASE #0 r286666: Wed Aug 12 19:31:38 UTC 2015
  root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  i386
```
(actually, I cheated - I just downloaded the official virtual image). The machine has 1 vCPU and (currently) 2560 MB RAM.
I installed the necessary packages to get Xorg LXDE up, and then Chromium:

```
root@p1# pv chrom*
[Reading data from pkg(8) ... - 217 packages found - done]
chromium-45.0.2454.101  =  up-to-date with port
```
and the only thing running on this machine now (apart from Xorg and LXDE) is Chromium and a couple of xterms.
Anyone want to guess what load it is at?

```
root@p1# date;uptime
Thu Oct 15 23:56:55 CEST 2015
11:56PM  up 48 mins, 6 users, load averages: 2.11, 2.41, 2.79
```
Additionally, I get frequent "Ahw, snap" messages when trying bookmarks, links or even reloading pages in Chromium.
And this in /var/log/messages:

```
Oct 15 23:26:30 p1 su: tingo to root on /dev/pts/3
Oct 15 23:28:23 p1 kernel: pid 868 (chrome), uid 1001: exited on signal 11
Oct 15 23:29:57 p1 kernel: pid 1226 (chrome), uid 1001: exited on signal 11
Oct 15 23:31:28 p1 kernel: pid 1238 (chrome), uid 1001: exited on signal 11
Oct 15 23:31:36 p1 kernel: pid 1255 (chrome), uid 1001: exited on signal 11
Oct 15 23:31:44 p1 kernel: pid 1257 (chrome), uid 1001: exited on signal 11
Oct 15 23:31:54 p1 kernel: pid 1260 (chrome), uid 1001: exited on signal 11
Oct 15 23:32:04 p1 kernel: pid 1263 (chrome), uid 1001: exited on signal 11
Oct 15 23:34:57 p1 kernel: pid 953 (chrome), uid 1001: exited on signal 11
Oct 15 23:37:32 p1 kernel: pid 929 (chrome), uid 1001: exited on signal 11
```
No, I'm not impressed.


----------



## drhowarddrfine (Oct 16, 2015)

Well, here's mine on a year and a half old machine:


```
8:40PM up 13:43, 9 users, load averages: 0.15, 0.16, 0.11
```

The "Aw, snap" stuff happens to me occasionally so, yes, the port maintainers can't seem to get that fixed cause it's been there for a couple of weeks.


----------

