# www/firefox and www/firefox-esr not working.



## TAL15 (Aug 16, 2017)

Just wanted people to know, Chromium is down too.


----------



## Maxnix (Aug 16, 2017)

Probably they are being rebuilt (I've seen this with mplayer2 when it still was in ports); nothing to worry about IMO.


----------



## Minbari (Aug 16, 2017)

firefox-55.0.2,1 succeeded!


----------



## YuryG (Aug 18, 2017)

firefox-55.0.2,1 works nicely for me


----------



## fl1pper (Aug 29, 2017)

I have upgraded to 11.1 and Firefox no longer works for me (55.0.3_1,1).

Initially it gave me errors about extensions so I moved my .mozilla directory out of the way. It now starts, runs for about 20 seconds and then dumps core.

Anybody have any idea what is causing that?


----------



## Minbari (Aug 29, 2017)

fl1pper said:


> I have upgraded to 11.1 and Firefox no longer works for me (55.0.3_1,1).
> 
> Initially it gave me errors about extensions so I moved my .mozilla directory out of the way. It now starts, runs for about 20 seconds and then dumps core.
> 
> Anybody have any idea what is causing that?


Restart firefox with add-ons disabled, delete .cache/mozilla/firefox and .mozilla/firefox then run firefox again and add add-ons, etc. This method worked for me when I upgraded Firefox.


----------



## fl1pper (Aug 29, 2017)

Minbari said:


> Restart firefox with add-ons disabled, delete .cache/mozilla/firefox and .mozilla/firefox then run firefox again and add add-ons, etc. This method worked for me when I upgraded Firefox.



Unfortunately it does not work for me. Still dumps core.


----------



## SirDice (Aug 29, 2017)

Did you upgrade from 11.0 or a 10.x version? If you did a major version upgrade, did you reinstall _all_ ports/packages? Did you use the port or the package? If you used the port what options did you enable/disable? Are you running a custom kernel or GENERIC?


----------



## fl1pper (Aug 29, 2017)

SirDice said:


> Did you upgrade from 11.0 or a 10.x version? If you did a major version upgrade, did you reinstall _all_ ports/packages? Did you use the port or the package? If you used the port what options did you enable/disable? Are you running a custom kernel or GENERIC?



Simplest case possible. I upgraded from 11.0, generic kernel  and I use packages


----------



## YuryG (Aug 29, 2017)

fl1pper said:


> Simplest case possible. I upgraded from 11.0, generic kernel  and I use packages


And the main question: «did you reinstall _all_ ports/packages?».


----------



## fl1pper (Aug 29, 2017)

YuryG said:


> And the main question: «did you reinstall _all_ ports/packages?».



The actual question was "If you did a major version upgrade, did you reinstall _all_ ports/packages?" which I ignored because I didn't do a major version upgrade going from 11.0 to 11.1.


----------



## fl1pper (Aug 29, 2017)

I have now tried a couple of other browsers with the following results:

firefox - core dumps after after a few seconds
firefox-esr - core dumps before the browser window comes up
chromium - core dumps after 30 seconds or so of browsing.

Obviously it is something more fundamental than the firefox package.


----------



## skywhi (Aug 29, 2017)

Hi,

Have you checked if dbus is correctly installed/enabled during boot on your new system ? Do you have the following entry in your /etc/rc.conf file ? :

```
dbus_enable="YES"
```


----------



## chrbr (Aug 29, 2017)

Just a question - do you run zfs on a quite weak CPU as I do? Nevertheless please install ports-mgmt/bsdadminscripts2. The output of `pkg_libchk` might give an answer if something fundamental is wrong.


----------



## Minbari (Aug 29, 2017)

fl1pper said:


> The actual question was "If you did a major version upgrade, did you reinstall _all_ ports/packages?" which I ignored because I didn't do a major version upgrade going from 11.0 to 11.1.



FreeBSD Handbook:


> *Generally*, installed applications will continue to work without problems after minor version upgrades.



As the handbook says in general there is no need to rebuild the system but sometimes things are not working as planned. I'm always rebuilding the whole system even if is a minor or major upgrade.


----------



## fl1pper (Aug 30, 2017)

skywhi said:


> Hi,
> 
> Have you checked if dbus is correctly installed/enabled during boot on your new system ? Do you have the following entry in your /etc/rc.conf file ? :
> 
> ...



Thanks for the suggestion, but I do have that entry.



chrbr said:


> Just a question - do you run zfs on a quite weak CPU as I do? Nevertheless please install ports-mgmt/bsdadminscripts2. The output of `pkg_libchk` might give an answer if something fundamental is wrong.



I have an Intel i5-2500 (3.3Ghz) which I'm unsure as to whether that would be defined as "weak".  Thanks for the tip about `pkg_libchk`, I didn't know about that. Running it against firefox with "-d" generates no errors. Running it against the whole system puts out the error 'ELF binary type "0" not known', but because of the way the output works, it's not possible to see which package generates the error.


----------



## fl1pper (Aug 30, 2017)

Minbari said:


> FreeBSD Handbook:
> 
> 
> As the handbook says in general there is no need to rebuild the system but sometimes things are not working as planned. I'm always rebuilding the whole system even if is a minor or major upgrade.



I've just done this with `pkg-static upgrade -f` and sadly it makes no difference.


----------



## SirDice (Aug 30, 2017)

If you start Firefox from an Xterm (or something similar) does it print any error messages?


----------



## getopt (Aug 30, 2017)

Read pkg-check(8) and see if it points to a problem when trying `pkg check`.


----------



## fl1pper (Aug 30, 2017)

SirDice said:


> If you start Firefox from an Xterm (or something similar) does it print any error messages?



Other than "Segmentation fault (core dumped)", no it doesn't. It's very frustrating!


----------



## Minbari (Aug 30, 2017)

fl1pper said:


> Thanks for the suggestion, but I do have that entry.
> 
> 
> 
> I have an Intel i5-2500 (3.3Ghz) which I'm unsure as to whether that would be defined as "weak".  Thanks for the tip about `pkg_libchk`, I didn't know about that. Running it against firefox with "-d" generates no errors. Running it against the whole system puts out the error 'ELF binary type "0" not known', but because of the way the output works, it's not possible to see which package generates the error.


I think that ELF error has something to do with linux binaries and is not related to firefox.


----------



## SirDice (Aug 30, 2017)

Yeah, you typically get that error when you try to run a Linux binary without the emulation layer enabled.


----------



## fl1pper (Aug 30, 2017)

getopt said:


> Read pkg-check(8) and see if it points to a problem when trying `pkg check`.



It flagged a perl package with a bad checksum, so I reinstalled it which removed the error. Makes no difference to firefox though.


----------



## chrbr (Aug 30, 2017)

fl1pper said:


> I have an Intel i5-2500 (3.3Ghz) which I'm unsure as to whether that would be defined as "weak".


This should be not weak. From FreeBSD 11.1 onwards ARC is compressed which adds additional CPU load. This was very difficult on my dual core. Therefore I have disabled it by

```
vfs.zfs.compressed_arc_enabled="0"
```
in /boot/loader.conf. Regarding `pkg_libchk` run it without any arguments. Then it should check everything. May be you have done that already, I just want to be sure because my earlier post is not really clear. Sorry for that.


----------



## Kiiski (Aug 31, 2017)

Just out of curiosity, did you stacktrace the dump?


----------



## sko (Sep 1, 2017)

I just had to deal with firefox randomly crashing after a few seconds to minutes on my work dekstop after ~30 days uptime. 
Turned out to be firefox trying to swap when there was no swap active (with 32GB RAM I never bothered about swap...). From what I found, when some process tries to allocate a chunk of memory that isn't available as a continuous block, FreeBSD tries to rearrange the memory using swap. If no swap is available the process just gets killed because the memory allocation request cold not be fulfilled. (Please correct me if I got that wrong)

So bottom line: is swap space available?


----------



## SirDice (Sep 1, 2017)

Even if you have massive amounts of RAM in the machine, don't be tempted to turn off swap. Modern operating systems will always use _some_ swap. Swap usage in and of itself is never a problem, it's _excessive_ swapping that will cause significant performance degradation.


----------



## fl1pper (Sep 1, 2017)

sko said:


> I just had to deal with firefox randomly crashing after a few seconds to minutes on my work dekstop after ~30 days uptime.
> Turned out to be firefox trying to swap when there was no swap active (with 32GB RAM I never bothered about swap...). From what I found, when some process tries to allocate a chunk of memory that isn't available as a continuous block, FreeBSD tries to rearrange the memory using swap. If no swap is available the process just gets killed because the memory allocation request cold not be fulfilled. (Please correct me if I got that wrong)
> 
> So bottom line: is swap space available?





SirDice said:


> Even if you have massive amounts of RAM in the machine, don't be tempted to turn off swap. Modern operating systems will always use _some_ swap. Swap usage in and of itself is never a problem, it's _excessive_ swapping that will cause significant performance degradation.



I was hoping that this might be the answer but unfortunately `swapctl -l` reports that I do have swap space configured and not being used.

Additionally, LibreOffice is now exhibiting exactly the same behavior i.e. works for a few seconds and then core dumps.


----------



## fl1pper (Sep 1, 2017)

chrbr said:


> This should be not weak. From FreeBSD 11.1 onwards ARC is compressed which adds additional CPU load. This was very difficult on my dual core. Therefore I have disabled it by
> 
> ```
> vfs.zfs.compressed_arc_enabled="0"
> ...



Thanks mate, I did run the command and it found nothing unfortunately.


----------



## fl1pper (Sep 1, 2017)

Kiiski said:


> Just out of curiosity, did you stacktrace the dump?



I did not, it's not something I've done before. It's increasingly looking like something I will have to learn how to do


----------



## sko (Sep 1, 2017)

SirDice said:


> Even if you have massive amounts of RAM in the machine, don't be tempted to turn off swap. Modern operating systems will always use _some_ swap. Swap usage in and of itself is never a problem, it's _excessive_ swapping that will cause significant performance degradation.



I just learned that the hard way 




fl1pper said:


> I did not, it's not something I've done before. It's increasingly looking like something I will have to learn how to do



For a start you can simply use ktrace(1):
`ktrace firefox`
The output is written to ktrace.out in the current directory (this file might grow a few 100MB!) and can be viewed in human readable (e.g. text) format with kdump(1). Mostly the very last breaths before the process dies are interesting, so for a first peek the tail of the dump is mostly sufficient:
`kdump | tail -n 1000 | less`


----------



## fl1pper (Sep 4, 2017)

sko said:


> I just learned that the hard way
> 
> 
> 
> ...



I've tried this and nothing jumped out me. Unfortunately I'm away for the rest of the week so I'll have a more thourough look at it next week.


----------



## fl1pper (Sep 11, 2017)

The output of `kdump` has lots of the following errors.


```
1389 Socket Thread RET   recvfrom 1440/0x5a0
  1389 Socket Thread CALL  recvfrom(0x62,0x82da35882,0x35d6,0,0,0)
  1389 Socket Thread RET   recvfrom -1 errno 35 Resource temporarily unavailable
  1389 Socket Thread CALL  getpeername(0x7b,0x7fffdfbfb8f0,0x7fffdfbfb8b4)
  1389 Socket Thread RET   getpeername -1 errno 57 Socket is not connected
```

To me they just seem like the thread waiting for data from a remote web site. Is that correct?

Eventually these errors are immediately followed by:


```
1389 SignedJAR PSIG  SIGSEGV caught handler=0x801d96d90 mask=0x0 code=SEGV_ACCERR
  1389 SignedJAR CALL  sigprocmask(SIG_SETMASK,0x7fffdb9b950c,0)
  1389 SignedJAR RET   sigprocmask 0
  1389 SignedJAR CALL  unlink(0x8027f8ec0)
```

The error SEGV_ACCERR  means "invalid permissions for mapped object" and is what causes the seg fault.

Any idea what would cause that?


----------



## sko (Sep 12, 2017)

Are you using add-ons/plugins? Something that executes via "SignedJAR" segfaults - this is most likely some buggy or outdated browser addon/plugin.
If you have enabled automaitc loading for java applets on websites it could also be some crappy applet on a site you are visiting (a lot of malware advertising networks also still use applets for their junk).

Firefox heavily mangled its addon interface and broke a lot of older addons in the process (e.g. the trusty, good old CookieMonster ). Sometimes these addons just won't load/work, more often they crash and burn loudly while also killing the browser.

The culprit might be revealed from somewhere shortly before the segfault - maybe you could paste the latst ~100 lines at e.g. nopaste/pastebin?


----------



## fl1pper (Sep 12, 2017)

sko said:


> Are you using add-ons/plugins? Something that executes via "SignedJAR" segfaults - this is most likely some buggy or outdated browser addon/plugin.
> If you have enabled automaitc loading for java applets on websites it could also be some crappy applet on a site you are visiting (a lot of malware advertising networks also still use applets for their junk).
> 
> Firefox heavily mangled its addon interface and broke a lot of older addons in the process (e.g. the trusty, good old CookieMonster ). Sometimes these addons just won't load/work, more often they crash and burn loudly while also killing the browser.
> ...



I've deleted ~/.mozilla and ~/.cache/mozilla so there are no addons there. Your reply did make me wonder if I had any global addons installed and I did have the swfdec-plugin flash package installed but deleting that made no difference. It did however produce an error on the command line:


```
1505203357808   addons.xpi   WARN   Error parsing extensions state: [Exception... "Component returned
failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [amIAddonManagerStartup.readStartupData]"  nsresult: "0
x80520012 (NS_ERROR_FILE_NOT_FOUND)"  location: "JS frame :: resource://gre/modules/addons/XPIProvider.jsm
 :: loadExtensionState :: line 1596"  data: no] Stack trace: loadExtensionState()@resource://gre/modules/a
ddons/XPIProvider.jsm:1596 < getInstallState()@resource://gre/modules/addons/XPIProvider.jsm:1631 < checkF
orChanges()@resource://gre/modules/addons/XPIProvider.jsm:3152 < startup()@resource://gre/modules/addons/X
PIProvider.jsm:2246 < callProvider()@resource://gre/modules/AddonManager.jsm:271 < _startProvider()@resour
ce://gre/modules/AddonManager.jsm:741 < startup()@resource://gre/modules/AddonManager.jsm:908 < startup()@
resource://gre/modules/AddonManager.jsm:3122 < observe()@jar:file:///usr/local/lib/firefox/omni.ja!/compon
ents/addonManager.js:65 < MP_migrate()@resource:///modules/MigrationUtils.jsm:378 < onMigratingMigrate()@m
igration.js:349 < onMigratingPageShow/<()@migration.js:345 < MU_showMigrationWizard()@resource:///modules/
MigrationUtils.jsm:873 < MU_startupMigrator()@resource:///modules/MigrationUtils.jsm:966
Segmentation fault (core dumped)
```

I don't believe that is relevant because it continues for 20 seconds or so after the error.

I've attached the last 2000 lines of the `ktrace` output.


----------



## fl1pper (Sep 13, 2017)

This is now working. Big thanks to hruodr for providing the solution.
The issue was the version of libgcc_s.so.1  being used by Firefox. My system was using the one in /usr/local/lib/gcc5 whereas it should have been using the version in /lib. On my system the library had been renamed to /lib/libgcc_s.so.orig which was causing the problem. I have no recollection of renaming that file, but undoing that change now allows Firefox to run without problems.


----------

