Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 May 2017 23:27:16 +0200
From:      Dimitry Andric <dim@FreeBSD.org>
To:        FreeBSD Current <freebsd-current@freebsd.org>
Cc:        FreeBSD Ports <freebsd-ports@freebsd.org>
Subject:   Firefox (and other Mozilla products) after ino64
Message-ID:  <3FD47B4D-1C1E-485E-A305-9C4EF3FB5F74@FreeBSD.org>

next in thread | raw e-mail | index | archive | help

--Apple-Mail=_66BB4097-05BE-472A-9539-F0463C3653F2
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

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


--Apple-Mail=_66BB4097-05BE-472A-9539-F0463C3653F2
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.30

iEYEARECAAYFAlkvNTsACgkQsF6jCi4glqNvpwCg5eerGXuJHurTOjxZgOiFSyZt
OwYAoIZgIrTUAG2vLbkDXU7w3Kuy5pIm
=CvWl
-----END PGP SIGNATURE-----

--Apple-Mail=_66BB4097-05BE-472A-9539-F0463C3653F2--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3FD47B4D-1C1E-485E-A305-9C4EF3FB5F74>