# chromium issue



## philo_neo (Aug 13, 2017)

Hello,
Question: chromium under FreeBSD 10.3 (i686) presents problems of execution, I read that it was necessary after the compilation of the port `cd /usr/ports/www/chromium/ && make install clean`
add kern.ipc.shm_allow_removed = 1 to /etc/sysctl.conf and reboot!
Nothing to do it starts and then disappears, what must you do?

Ps: I also run `pkg install chromium`
The icon appears

Regards
Philippe


----------



## Sensucht94 (Aug 16, 2017)

philo_neo, in order to allow anyone to help you, you should run `chrome` from a terminal emulator and post here the output.

Did you check up for missing dependencies?



philo_neo said:


> Ps: I also `make pkg install chromium`
> The icon appears



What do you mean by icon appearing? You should have deleted the port before installing the package or it should be telling it's already updated to the latest version.

 Running 'make pkg install', while in the port directory, is not the correct way to build the port, use the handbook as reference to learn more: https://www.freebsd.org/doc/handbook/pkgng-intro.html


----------



## vall (Sep 3, 2017)

Does anyone uses www/chromium ?

If someone do, *how* do you install or config it??
I tried to use it for a couple times two years along and always it's garbage.

For now I have 11.1-RELEASE, everything is updated, `kern.ipc.shm_allow_removed = 1` in `/etc/sysctl.conf`.
Chromium is installed from pkg, not from ports.
And on three machines I just have

```
$ chrome
Segmentation fault
$
```


----------



## macondo (Sep 3, 2017)

`sudo pkg install chromium`

after installation is complete:

`chrome`

voilà!


----------



## cpm@ (Sep 4, 2017)

It has been reported via bugzilla, so I'll take a look.

According to the OP, chromium 64-bit version appears to be unaffected.

See PR 221266 for more details.


----------



## vall (Sep 4, 2017)

Yes, it's happening on i386. Everything is as in PR 221266.

I've added `dmesg` output


----------



## cpm@ (Sep 4, 2017)

Wozzeck.Live

I agree with you, the current problems we have with chromium on FreeBSD would be resolved quickly if we had official support from the chromium engineering dev team.

There is a initial discussion to enable the GPU hardware acceleration support. Chromium uses OpenGL and probably some extensions which are usually provided by the graphic stack from the corresponding vendor. Assuming that the driver provides right version of OpenGL and extensions, there is high chance that the things would work. In reverse, if mesa is too old or our in-kernel driver is too old for mesa to activate recent OpenGL features there is no development on chromium side that could help there.

You will have more details when it is published on the dedicated mailing list.


----------



## cpm@ (Sep 4, 2017)

vall said:


> Yes, it's happening on i386. Everything is as in PR 221266.
> 
> I've added dmesg output



Have you tried to run chromium with GPU hardware acceleration disabled? Note that if software renderer is not in place, then the GPU process won't launch.

`chrome --disable-gpu`


----------



## vall (Sep 5, 2017)

cpm@ said:


> Have you tried to run chromium with GPU hardware acceleration disabled? Note that if software renderer is not in place, then the GPU process won't launch.
> 
> `chrome --disable-gpu`



yep, that's the same 

do I can help as a user? 
Is chromium stable on amd64 now (as I remember it craches every second tab)?


----------



## cpm@ (Sep 5, 2017)

vall said:


> yep, that's the same



You can give a try to build chromium from ports instead using binary package.



> do I can help as a user?



Yes, why not?



> Is chromium stable on amd64 now (as I remember it craches every second tab)?



Yes, it works quite well after disabling V8 cache.

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212812#c24

FYI, I'm using it right now


----------



## vall (Sep 5, 2017)

cpm@ said:


> Yes, why not?



I meaned "*how* I can help?" English is a problem for me ))

Ok I'll try some things and tell about achievements. I've already tried to install from ports yesterday, but my machine is slow and my patience was а small 



cpm@ said:


> Yes, it works quite well after disabling V8 cache.
> 
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212812#c24
> 
> FYI, I'm using it right now



Thanks for showing this solution! I am forcing to switch my friend to FreeBSD, but he is web-developer and chromium is his greatest need.


----------



## cpm@ (Sep 5, 2017)

vall said:


> I meaned "*how* I can help?" English is a problem for me ))



As a user: it would be enough to submit patches to fix/improve the port and/or report issues.


----------



## cpm@ (Sep 13, 2017)

philo_neo, vall

Would you mind trying to rebuild chromium after applying the following patch?


----------



## vall (Sep 13, 2017)

cpm@ said:


> philo_neo, vall
> 
> Would you mind trying to rebuild chromium after applying the following patch?



Ok, I'll try


----------



## tingo (Sep 13, 2017)

cpm@ said:


> philo_neo, vall
> 
> Would you mind trying to rebuild chromium after applying the following patch?


FWIW, I tried this patch. I patched like this:

```
root@kg-core1# pwd
/usr/ports/www/chromium
root@kg-core1# patch  -p 2 < /home/tingo//work/chromium/chromium.patch
[...]
```
and that looked ok, it only complained about a few missing newlines.
but when I try to upgrade chromium, it fails during patching:

```
===>  Patching for chromium-60.0.3112.113_2
===>  Applying extra patch /usr/ports/www/chromium/files/extra-patch-clang
===>  Applying extra patch /usr/ports/www/chromium/files/extra-patch-libc++-old
===>  Applying FreeBSD patches for chromium-60.0.3112.113_2
  I can't seem to find a patch in there anywhere.
=> FreeBSD patch patch-base_task_scheduler_delayed_task_manager.cc failed to apply cleanly.
=> Patch(es)  patch-BUILD.gn patch-apps_ui_views_app__window__frame__view.cc patch-ash_display_mirror__window__controller.cc patch-base_BUILD.gn patch-base__trace_event__process_memory_dump.h patch-base_allocator_allocator__shim.cc patch-base_allocator_allocator__shim__default__dispatch__to__glibc.cc patch-base_allocator_allocator__shim__override__libc__symbols.h patch-base_allocator_allocator__shim__unittest.cc patch-base_debug_debugger__posix.cc patch-base_debug_proc__maps__linux.cc patch-base_debug_stack__trace.h patch-base_debug_stack__trace__posix.cc patch-base_debug_thread__heap__usage__tracker.cc patch-base_files_file__path__unittest.cc patch-base_files_file__path__watcher__kqueue.h patch-base_files_file__util.h patch-base_files_memory_mapped_file_posix.cc patch-base_i18n_icu__util.cc patch-base_linux__util.cc patch-base_logging__unittest.cc patch-base_native__library__posix.cc patch-base_posix_unix__domain__socket__linux.cc patch-base_posix_unix__domain__socket__linux__unittest.cc patch-base_process_internal__linux.cc patch-base_process_internal__linux.h patch-base_process_launch.cc patch-base_process_launch.h patch-base_process_launch__posix.cc patch-base_process_memory.cc patch-base_process_memory.h patch-base_process_memory__unittest.cc patch-base_process_process__handle__freebsd.cc patch-base_process_process__info__linux.cc patch-base_process_process__iterator__freebsd.cc patch-base_process_process__metrics.h patch-base_process_process__metrics__freebsd.cc patch-base_process_process__posix.cc patch-base_profiler_stack__sampling__profiler__unittest.cc patch-base_security__unittest.cc patch-base_sys__info__freebsd.cc patch-base_sys__info__posix.cc applied cleanly.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/www/chromium
```
Do I need more arguments to patch, or is something broken?
This on

```
tingo@kg-core1$ uname -a
FreeBSD kg-core1.kg4.no 10.3-STABLE FreeBSD 10.3-STABLE #0 r310083: Wed Dec 14 21:00:13 CET 2016     root@kg-core1.kg4.no:/usr/obj/usr/src/sys/GENERIC  amd64
```
HTH


----------



## cpm@ (Sep 13, 2017)

It works fine for me...


```
# cd /usr/ports/www/chromium
# patch -p2 < /home/cpm/Desktop/chromium-libc++.diff
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: www/chromium/Makefile
|===================================================================
|--- www/chromium/Makefile    (revision 449598)
|+++ www/chromium/Makefile    (working copy)
--------------------------
Patching file Makefile using Plan A...
Hunk #1 succeeded at 3.
Hunk #2 succeeded at 201.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: www/chromium/files/extra-patch-libc++-new
|===================================================================
|--- www/chromium/files/extra-patch-libc++-new    (nonexistent)
|+++ www/chromium/files/extra-patch-libc++-new    (working copy)
--------------------------
(Creating file files/extra-patch-libc++-new...)
Patching file files/extra-patch-libc++-new using Plan A...
Empty context always matches.
Hunk #1 succeeded at 1.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|
|Property changes on: www/chromium/files/extra-patch-libc++-new
|___________________________________________________________________
|Added: fbsd:nokeywords
|## -0,0 +1 ##
|+yes
|\ No newline at end of property
|Added: svn:eol-style
|## -0,0 +1 ##
|+native
|\ No newline at end of property
|Added: svn:mime-type
|## -0,0 +1 ##
|+text/plain
|\ No newline at end of property
|Index: www/chromium/files/extra-patch-libc++-old
|===================================================================
|--- www/chromium/files/extra-patch-libc++-old    (nonexistent)
|+++ www/chromium/files/extra-patch-libc++-old    (working copy)
--------------------------
(Creating file files/extra-patch-libc++-old...)
Patching file files/extra-patch-libc++-old using Plan A...
Empty context always matches.
Hunk #1 succeeded at 1.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|
|Property changes on: www/chromium/files/extra-patch-libc++-old
|___________________________________________________________________
|Added: fbsd:nokeywords
|## -0,0 +1 ##
|+yes
|\ No newline at end of property
|Added: svn:eol-style
|## -0,0 +1 ##
|+native
|\ No newline at end of property
|Added: svn:mime-type
|## -0,0 +1 ##
|+text/plain
|\ No newline at end of property
|Index: www/chromium/files/patch-base_task_scheduler_delayed_task_manager.cc
|===================================================================
|--- www/chromium/files/patch-base_task_scheduler_delayed_task_manager.cc    (revision 449598)
|+++ www/chromium/files/patch-base_task_scheduler_delayed_task_manager.cc    (nonexistent)
--------------------------
Patching file files/patch-base_task_scheduler_delayed_task_manager.cc using Plan A...
Hunk #1 succeeded at 0.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|
|Property changes on: www/chromium/files/patch-base_task_scheduler_delayed_task_manager.cc
|___________________________________________________________________
|Deleted: fbsd:nokeywords
|## -1 +0,0 ##
|-yes
|\ No newline at end of property
|Deleted: svn:eol-style
|## -1 +0,0 ##
|-native
|\ No newline at end of property
|Deleted: svn:mime-type
|## -1 +0,0 ##
|-text/plain
|\ No newline at end of property
|Index: www/chromium/files/patch-tools_gn_bootstrap_bootstrap.py
|===================================================================
|--- www/chromium/files/patch-tools_gn_bootstrap_bootstrap.py    (revision 449598)
|+++ www/chromium/files/patch-tools_gn_bootstrap_bootstrap.py    (nonexistent)
--------------------------
Patching file files/patch-tools_gn_bootstrap_bootstrap.py using Plan A...
Hunk #1 succeeded at 0.
Hmm...  Ignoring the trailing garbage.
done
```

P.S. You should remove the leftover patches:

patch-base_task_scheduler_delayed_task_manager.cc
patch-tools_gn_bootstrap_bootstrap.py


----------



## tingo (Sep 15, 2017)

Aha, so I should have used '-E' with the patch command then. Removed the two zero-length patch files, and now chromium is building.
Thanks for the hint.


----------



## vall (Sep 22, 2017)

Oh, I've built it.
Twice. First one to make sure that problem is.
Then clean ports/www/chromium catalogue, reexport chromium port, then apply patch, delete patch-base_task_scheduler_delayed_task_manager.cc and patch-tools_gn_bootstrap_bootstrap.py and build again.
Maybe I'm doing something wrong and somebody should check too, but still Segmentation fault.

upd:
And while I was building this port (yep I can't run computer all day long) new version of port with fix was released ))
should rebuild again 

upd2:
Tried to install version 61.0.3163.79 from pkg. Segmentation fault.
Maybe we just should upgrade to amd64 ))


----------



## cpm@ (Sep 22, 2017)

vall said:


> upd2:
> Tried to install version 61.0.3163.79 from pkg. Segmentation fault.
> Maybe we just should upgrade to amd64 ))



Please, show me the following output

`chrome --disable-gpu --enable-logging=stderr --v=1`


----------



## end222 (Sep 22, 2017)

cpm@ said:


> Please, show me the following output
> 
> `chrome --disable-gpu --enable-logging=stderr --v=1`


I get this output too:

```
$ chrome --disable-gpu --enable-logging=stderr --v=1
Segmentation fault
```

I am using the latest version installed with pkg in a i386 machine


----------



## jrm@ (Sep 23, 2017)

Off topic aside: cpm@, you are a kind soul to maintain and debug a port that takes 15.5 hours to build.


----------



## cpm@ (Sep 23, 2017)

end222 said:


> I get this output too:
> 
> ```
> $ chrome --disable-gpu --enable-logging=stderr --v=1
> ...



I'm not sure if it would make any difference, but it will probably work.

Add ld(1) option --no-keep-memory for IA32 machine.

```
Index: Makefile
===================================================================
--- Makefile    (revision 450418)
+++ Makefile    (working copy)
@@ -209,6 +209,12 @@
 GN_ARGS+=    use_vulcanize=false
 .endif

+.if ${ARCH} == i386
+GN_ARGS+=    extra_ldflags="-L${LOCALBASE}/lib -Wl,--no-keep-memory"
+.else
+GN_ARGS+=    extra_ldflags="-L${LOCALBASE}/lib"
+.endif
+
 .if !defined(GN_ONLY)
 pre-everything::
    @${ECHO_MSG}
```


----------



## vall (Sep 23, 2017)

cpm@ said:


> I'm not sure if it would make any difference, but it will probably work.
> 
> Add ld(1) option --no-keep-memory for IA32 machine.
> 
> ...



On my mom's SandyBridge in VirtualBox compilation is 6 time faster then on Pentium4 
and near object-file number 4500 I have this:

ld.lld : unknown argument: --no-keep-memory


----------



## bookwormep (Sep 23, 2017)

I'll give another try to re-build www/chromium; after refreshing ports using portsnap.

EDIT: Previous thread re: www/chromium :
https://forums.freebsd.org/threads/61667/


----------



## cpm@ (Sep 24, 2017)

vall said:


> ld.lld : unknown argument: --no-keep-memory



Yes, it should only work with GNU ld(1).

Change the following build argument 
	
	



```
GN_ARGS+=use_lld=false
```
 in chromium/Makefile.


----------



## bookwormep (Sep 30, 2017)

A big thank you to @cpm and the Chromium team for all the work on this web-bowser. For now I will just
use Firefox and Firefox-esr, both are working on my i386 architectures.

I suspect there may be special files and/or directories that are needed to be in place for Chromium to work correctly. As I always create a very minimalist system, this style of system building is prone to many unorthodox maladies. Nevertheless, I learn alot from these adventures, and I have a whole lot of fun doing so!

Furthermore, monwarez discussed building a system in a clean environment (so that dependencies either missing, incompatible, or wholesale wrong) are not pulled into the system.


----------



## tingo (Oct 15, 2017)

FWIW, the patch earlier in this thread improves Chromium usability, which is good.
But, even if Chromium now get "hung" tabs less often, they are still there. As before, the only way is to close that tab. When the frequency of this problem increases, I just stop and start Chromium.


----------



## cpm@ (Oct 28, 2017)

bookwormep said:


> A big thank you to @cpm and the Chromium team for all the work on this web-bowser. For now I will just
> use Firefox and Firefox-esr, both are working on my i386 architectures.
> 
> I suspect there may be special files and/or directories that are needed to be in place for Chromium to work correctly. As I always create a very minimalist system, this style of system building is prone to many unorthodox maladies. Nevertheless, I learn alot from these adventures, and I have a whole lot of fun doing so!
> ...



I have in mind to update chromium and iridium to the latest stable release (TBD). To solve the segfault on i386, first I need to fix the DEBUG option to get a reliable stack trace and see what's wrong here.


----------



## bookwormep (Oct 29, 2017)

Well okay, if there is anything I can test, just give some detail and hints as to how to help.


----------



## Vincenzo Isaia (Oct 31, 2017)

cpm@ said:


> I have in mind to update chromium and iridium to the latest stable release (TBD). To solve the segfault on i386, first I need to fix the DEBUG option to get a reliable stack trace and see what's wrong here.



Hi,

I'm newbie, but I get to compile the latest chromium 61 version in DEBUG adding manually the /usr/local/lib/libfontconfig.so to the solibs key in gfx.ninja.
Unfortunally, I try to launch chromium inside gdb and I get only the memory address where the segmentation occurs  without information about the code.
Please, could you help me?


----------



## cpm@ (Dec 28, 2017)

Chromium segfault at startup on i386 was fixed in r457431.


----------



## Snurg (Dec 28, 2017)

I know this is not a real "issue", but I'd like to ask you guys:
What do you think are the chances of getting the Linux pepper flash plugin working on FreeBSD chromium?

(The plugin can be extracted from a Linux chrome executable and, at least theoretically installed into FreeBSD Chromium.
I did that a while ago. But I was unable to get it working. Maybe I made a bad manifest file or other issues prevented the Flash to activate.)


----------



## bookwormep (Dec 28, 2017)

Okay, installed chromium v. 61.0.3160.100 as a package; then, launched but still Seg. Fault.
However, I read the revision r.457431 and  it detailed a switch to: llvm50; while, I have the
older llvm40-4.0.1_1. Also, next time around I should probably set Debug and Test options.


----------



## cpm@ (Dec 28, 2017)

bookwormep said:


> Okay, installed chromium v. 61.0.3160.100 as a package; then, launched but still Seg. Fault.
> However, I read the revision r.457431 and  it detailed a switch to: llvm50; while, I have the
> older llvm40-4.0.1_1. Also, next time around I should probably set Debug and Test options.



Packages are built weekly from a snapshot of the ports, therefore, you need to install it from ports if you don't want to wait.

In addition, chromium was tested on 10.3/i386 and 11.1/i386. See PR 224622 for further details.


----------



## cpm@ (Dec 28, 2017)

Snurg said:


> I know this is not a real "issue", but I'd like to ask you guys:
> What do you think are the chances of getting the Linux pepper flash plugin working on FreeBSD chromium?
> 
> (The plugin can be extracted from a Linux chrome executable and, at least theoretically installed into FreeBSD Chromium.
> I did that a while ago. But I was unable to get it working. Maybe I made a bad manifest file or other issues prevented the Flash to activate.)



Chromium no longer support Flash and was deprecated due to security concerns.

https://www.chromium.org/flash-roadmap


----------



## cpm@ (Dec 28, 2017)

Vincenzo Isaia said:


> Hi,
> 
> I'm newbie, but I get to compile the latest chromium 61 version in DEBUG adding manually the /usr/local/lib/libfontconfig.so to the solibs key in gfx.ninja.
> Unfortunally, I try to launch chromium inside gdb and I get only the memory address where the segmentation occurs  without information about the code.
> Please, could you help me?



Please, file a new PR via bugzilla.


----------



## bookwormep (Dec 30, 2017)

I built the newer version devel/llvm50 this afternoon; and will wait til' Jan. 4th or thereafter to 
install chromium as a package. Not sure if I need to remove llvm40--4.0.1_1?


----------



## cpm@ (Dec 30, 2017)

bookwormep said:


> I built the newer version devel/llvm50 this afternoon; and will wait til' Jan. 4th or thereafter to
> install chromium as a package. Not sure if I need to remove llvm40--4.0.1_1?



It's available from the package repository

```
% pkg search chromium-6
chromium-61.0.3163.100_5       Google web browser based on WebKit
```
There are ports that still depends on devel/llvm40


----------



## bookwormep (Dec 30, 2017)

Okay, I will give it another try. If I try to build from ports it takes over 18 hours, I don't want to melt cpu, sorry.

Edit: I will write back by the end of today, otherwise: Thanks for all the help on this!


----------



## bookwormep (Dec 30, 2017)

Okay, here we go for another round. I will build port, and keep a script text file running - 18 hours.


----------



## bookwormep (Dec 31, 2017)

Good news! I'm writing this while using www/chromium

Thx again to Chromium team; especially cpm!


----------



## Deleted member 30996 (Dec 31, 2017)

bookwormep said:


> Okay, I will give it another try. If I try to build from ports it takes over 18 hours, I don't want to melt cpu, sorry.



I've got much more use out of my Opolar gaming fan building ports in the year I've owned it than I have playing games. Nice to have at only $30 and really works.


----------



## bookwormep (Dec 31, 2017)

I'm glad you mentioned fans, as it was, I positioned a household fan right up to the side of the Thinkpad
and kept it running for most of the time.


----------



## Deleted member 30996 (Dec 31, 2017)

bookwormep said:


> I'm glad you mentioned fans, as it was, I positioned a household fan right up to the side of the Thinkpad and kept it running for most of the time.



I had to do the same thing with my old Gateway Solo laptop or it would shut itself down as a safety measure. 

I noticed a syslog warning in one of my terminals just last week while compiling ports on a T61 and saw it had reached 100C. I hooked up the gaming fan and brought it down to a safe level in no time. I need to take it apart and look at it because that's not normal.


----------

