Bug 256072 - www/firefox: requires COMPAT_FREEBSD11
Summary: www/firefox: requires COMPAT_FREEBSD11
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-gecko (Nobody)
Depends on:
Reported: 2021-05-22 08:15 UTC by Stéphane D'Alu
Modified: 2022-05-02 06:24 UTC (History)
3 users (show)

See Also:
jbeich: maintainer-feedback+


Note You need to log in before you can comment on or make changes to this bug.
Description Stéphane D'Alu 2021-05-22 08:15:27 UTC
On FreeBSD13, firefox 88.0.1_1,2 crash with bad system call, if kernel is not compiled with COMPAT_FREEBSD11.

Firefox is build from port using :
	ALSA           : off
	CANBERRA       : on
	DBUS           : on
	DEBUG          : off
	FFMPEG         : on
	JACK           : off
	LIBPROXY       : on
	LTO            : on
	PROFILE        : off
	PULSEAUDIO     : on
	SNDIO          : on
	TEST           : off

I don't think it was the case with previous version.
Comment 1 Konstantin Belousov freebsd_committer 2021-05-22 08:26:07 UTC
Set sysctl kern.lognosys=3 then run firefox.  Either the controlling terminal
(if any) or dmesg would log which syscall was called.  Show it there.
Comment 2 Stéphane D'Alu 2021-05-22 09:02:06 UTC
pid 1790 comm firefox: nosys 188
Comment 3 Konstantin Belousov freebsd_committer 2021-05-22 09:14:45 UTC
Indeed 188 is the pre-ino64 stat(2).

I noted some time ago that firefox built on stable/11, calls stat@FBSD_1.5 with
the pointer to old struct stat, causing memory corruption.  I suspect both this
and your problem are caused by some attempt to dynamically call the syscall.

I cannot provide any more useful input, wait for the maintainers.
Comment 4 Ghost 2021-05-22 10:31:32 UTC
(In reply to Stéphane D'Alu from comment #0)

lang/rust generated code requires COMPAT_FREEBSD11, see https://cgit.freebsd.org/ports/tree/Mk/Uses/cargo.mk#n276
Comment 5 Jan Beich freebsd_committer 2021-05-22 11:55:42 UTC
See https://github.com/rust-lang/libc/issues/570

www/firefox uses libc crate which due to lack of OS version in --target triple binds to symbols from the oldest still supported FreeBSD major version. After FreeBSD 11.* reaches EOL on 2021-09-30 upstream may bump the default from relying on COMPAT_FREEBSD11 to COMPAT_FREEBSD12. Also, if LIBC_CI is defined via environ(7) libc crate would use freebsd-version(1) to try binding natively but it doesn't support 14.0-CURRENT yet.

Comment 6 Stéphane D'Alu 2021-05-23 16:49:24 UTC
Thanks for the explanations.