Bug 272767 - www/firefox: 116.0 all tabs crash if kern.elf64.allow_wx=0
Summary: www/firefox: 116.0 all tabs crash if kern.elf64.allow_wx=0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Christoph Moench-Tegeder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-27 22:52 UTC by Rajeev Pillai
Modified: 2024-09-25 21:58 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (gecko)


Attachments
Error messages from firefox-116.0,2 (2.78 KB, text/plain)
2023-07-27 22:52 UTC, Rajeev Pillai
no flags Details
set wxneeded (481 bytes, patch)
2024-09-22 16:29 UTC, Andre Albsmeier
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rajeev Pillai 2023-07-27 22:52:03 UTC
Created attachment 243659 [details]
Error messages from firefox-116.0,2

After the recent firefox-116.0.2 update, _all_ tabs crash when these are set in
/boot/loader.conf:

```
kern.elf32.allow_wx=0
kern.elf64.allow_wx=0
```

The same result with a clean firefox package reinstall (and also a brand new run
with ~/.cache and ~/.mozilla removed). A ~150 MB core file is left behind after
this.

Didn't have any issues with any of the previous upgrades at all.

I've worked around this by setting both those sysctl vars. to `1'.

The error message from a pristine first-run of Firefox is attached.
Comment 1 Graham Perrin freebsd_committer freebsd_triage 2023-07-29 01:19:00 UTC
% sysctl -d kern.elf32.allow_wx
kern.elf32.allow_wx: Allow pages to be mapped simultaneously writable and executable
% sysctl -d kern.elf64.allow_wx
kern.elf64.allow_wx: Allow pages to be mapped simultaneously writable and executable
% 

<https://lists.freebsd.org/archives/freebsd-questions/2023-July/003962.html>
Comment 2 Rajeev Pillai 2023-07-29 03:51:16 UTC
Well, instead of allowing `WX' globally, I'm now only setting it on firefox:

$ sudo elfctl -e +wxneeded /usr/local/lib/firefox/firefox \
      /usr/local/lib/firefox/firefox-bin

It works just as well--as a workaround for the time being.
Comment 3 Andre Albsmeier 2024-09-22 16:29:18 UTC
Created attachment 253743 [details]
set wxneeded

> as a workaround for the time being.

The "time being" is now over a year :-(. Maybe we can convince the firefox maintainer to apply the attached patch to the port (and maybe the non-esr version as well)?
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-09-25 21:46:19 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=df3c96e94d4775c63b86156bece7978b4c948cfb

commit df3c96e94d4775c63b86156bece7978b4c948cfb
Author:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
AuthorDate: 2024-09-25 21:43:22 +0000
Commit:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
CommitDate: 2024-09-25 21:43:22 +0000

    www/firefox www/firefox-esr mail/thunderbird: set wxneeded

    people keep twiddling the knobs and see fallot from
    setting kern.elf64.allow_wx

    PR:             272767

 Mk/bsd.gecko.mk           | 5 ++++-
 mail/thunderbird/Makefile | 1 +
 www/firefox-esr/Makefile  | 1 +
 www/firefox/Makefile      | 1 +
 4 files changed, 7 insertions(+), 1 deletion(-)
Comment 5 commit-hook freebsd_committer freebsd_triage 2024-09-25 21:47:22 UTC
A commit in branch 2024Q3 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=866ddebbcd4b9a18c86df7377961f99cec1d2439

commit 866ddebbcd4b9a18c86df7377961f99cec1d2439
Author:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
AuthorDate: 2024-09-25 21:43:22 +0000
Commit:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
CommitDate: 2024-09-25 21:46:09 +0000

    www/firefox www/firefox-esr mail/thunderbird: set wxneeded

    people keep twiddling the knobs and see fallot from
    setting kern.elf64.allow_wx

    PR:             272767
    (cherry picked from commit df3c96e94d4775c63b86156bece7978b4c948cfb)

 Mk/bsd.gecko.mk           | 5 ++++-
 mail/thunderbird/Makefile | 1 +
 www/firefox-esr/Makefile  | 1 +
 www/firefox/Makefile      | 1 +
 4 files changed, 7 insertions(+), 1 deletion(-)