Firefox (and other Mozilla products) after ino64

Dimitry Andric dim at FreeBSD.org
Wed May 31 21:27:33 UTC 2017


Hi,

Due to the recent ino64 update in 12.0-CURRENT, there have been some
reports by Firefox port users about crashes.  While I personally have
not experienced these crashes, as I immediately rebuilt all my ports
from scratch after the ino64 update, I think can explain why the
following combination is very likely to have problems:

* kernel+world after ino64
* www/firefox package from before ino64

It is because Firefox's JavaScript engine is doing tricks to get at libc
structures and functions (via an FFI mechanism), and several structure
layouts and offsets are hardcoded into its engine at build time.

For instance, here is the place where the engine determines the offset
of struct dirent's d_name field:

  https://hg.mozilla.org/mozilla-central/file/tip/dom/system/OSFileConstants.cpp#l648

Further down in the file, several offsets of fields in struct stats are
similarly determined:

  https://hg.mozilla.org/mozilla-central/file/tip/dom/system/OSFileConstants.cpp#l677

Now, since ino64 changed quite a number of structure layouts, including
struct dirent, struct stat, and others, such offsets determined in the
past will no longer be valid!

It is pretty likely that Firefox will attempt to access these fields,
finding bogus values, or simply reading invalid memory, and crashing
because of this.  Or at the least, the behavior will be unstable.

This also applies to other Mozilla products, such as Thunderbird,
SeaMonkey, and so on.  These should all be rebuilt from scratch under
ino64.

-Dimitry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20170531/9dea1615/attachment.sig>


More information about the freebsd-ports mailing list