Bug 256072 - www/firefox: requires COMPAT_FREEBSD11
Summary: www/firefox: requires COMPAT_FREEBSD11
Status: Open
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)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-22 08:15 UTC by Stéphane D'Alu
Modified: 2023-04-23 13:41 UTC (History)
3 users (show)

See Also:
jbeich: maintainer-feedback+


Attachments

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
	OPTIMIZED_CFLAGS: 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 freebsd_triage 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 freebsd_triage 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 freebsd_triage 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.

https://searchfox.org/mozilla-release/rev/a8d49c009a9250de34d683567d586f3aeb409b4c/third_party/rust/libc/build.rs#33
Comment 6 Stéphane D'Alu 2021-05-23 16:49:24 UTC
Thanks for the explanations.