Bug 240884

Summary: www/firefox on wayland posix_fallocate zfs EINVAL segfault
Product: Ports & Packages Reporter: Jesper Schmitz Mouridsen <jsm>
Component: Individual Port(s)Assignee: Jan Beich <jbeich>
Status: Closed FIXED    
Severity: Affects Some People CC: nk, val
Priority: --- Flags: bugzilla: maintainer-feedback? (gecko)
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=267123

Description Jesper Schmitz Mouridsen freebsd_committer freebsd_triage 2019-09-27 20:57:15 UTC
Hi

ZFS returns EINVAL error 22 on posix_allocate used by firefox on wayland.
a workaround is to use tmpfs or another non zfs fs for /tmp.
Comment 1 Jan Beich freebsd_committer freebsd_triage 2019-09-27 22:39:32 UTC
Does it affect ZFS on Linux as well? Can you report upstream instead?
Comment 2 Val Packett 2019-09-28 08:17:34 UTC
If it's using memfd, it won't affect Linux, though IIRC there's a couple different places where a memory fd is needed and only one of them uses memfd (?)

SHM_ANON was used too but I've heard something about it being removed??
Comment 3 Jan Beich freebsd_committer freebsd_triage 2019-09-28 21:46:48 UTC
(In reply to Greg V from comment #2)
Firefox itself also uses posix_fallocate but maybe not for long.
https://hg.mozilla.org/mozilla-central/rev/9e7204579027
https://bugzilla.mozilla.org/show_bug.cgi?id=1543687
Comment 4 commit-hook freebsd_committer freebsd_triage 2020-02-28 18:21:40 UTC
A commit references this bug:

Author: jbeich
Date: Fri Feb 28 18:20:55 UTC 2020
New revision: 527346
URL: https://svnweb.freebsd.org/changeset/ports/527346

Log:
  www/firefox: unbreak native Wayland if XDG_RUNTIME_DIR on ZFS

  XDG_RUNTIME_DIR should be on tmpfs(5) for optimal performance but if
  users want on permanent storage like ZFS don't abort.

  PR:		240884
  Reported by:	jsm

Changes:
  head/mail/thunderbird/Makefile
  head/mail/thunderbird/files/patch-bug1618914
  head/www/cliqz/Makefile
  head/www/cliqz/files/patch-bug1618914
  head/www/firefox/Makefile
  head/www/firefox/files/patch-bug1618914
  head/www/firefox-esr/Makefile
  head/www/firefox-esr/files/patch-bug1618914
Comment 5 Jan Beich freebsd_committer freebsd_triage 2020-03-03 00:31:29 UTC
Can someone confirm the fix helps?
Comment 6 Jan Beich freebsd_committer freebsd_triage 2020-04-07 11:27:33 UTC
If no one confirms I'm going to back out the fix. After that the bug maybe closed per feedback timeout as I've never could reproduce the original issue.
Comment 7 Val Packett 2020-04-08 16:07:22 UTC
(In reply to Jan Beich from comment #6)

Looks like it might not have helped @nomadlogic:
https://gitter.im/FreeBSDDesktop/Lobby?at=5e8cab0c3a85536c43148c06

Might be because you only did WaylandShmPool::CreateTemporaryFile but not WaylandShmPool::Resize (disclaimer: I'm looking at current Firefox code, not releases, but I don't think that changed recently)
Comment 8 commit-hook freebsd_committer freebsd_triage 2020-05-29 23:26:33 UTC
A commit references this bug:

Author: jbeich
Date: Fri May 29 23:26:00 UTC 2020
New revision: 537006
URL: https://svnweb.freebsd.org/changeset/ports/537006

Log:
  www/firefox: also check posix_fallocate error in WaylandShmPool::Resize

  PR:		240884
  Submitted by:	Greg V

Changes:
  head/mail/thunderbird/Makefile
  head/mail/thunderbird/files/patch-bug1618914
  head/www/firefox/Makefile
  head/www/firefox/files/patch-bug1618914
  head/www/firefox-esr/Makefile
  head/www/firefox-esr/files/patch-bug1618914
Comment 9 commit-hook freebsd_committer freebsd_triage 2020-05-30 00:23:40 UTC
A commit references this bug:

Author: jbeich
Date: Sat May 30 00:22:43 UTC 2020
New revision: 537012
URL: https://svnweb.freebsd.org/changeset/ports/537012

Log:
  MFH: r537006

  www/firefox: also check posix_fallocate error in WaylandShmPool::Resize

  PR:		240884
  Submitted by:	Greg V
  Approved by:	ports-secteam blanket

Changes:
_U  branches/2020Q2/
  branches/2020Q2/mail/thunderbird/Makefile
  branches/2020Q2/mail/thunderbird/files/patch-bug1618914
  branches/2020Q2/www/firefox/Makefile
  branches/2020Q2/www/firefox/files/patch-bug1618914
  branches/2020Q2/www/firefox-esr/Makefile
  branches/2020Q2/www/firefox-esr/files/patch-bug1618914
Comment 10 commit-hook freebsd_committer freebsd_triage 2020-05-31 09:24:54 UTC
A commit references this bug:

Author: jbeich
Date: Sun May 31 09:24:22 UTC 2020
New revision: 537140
URL: https://svnweb.freebsd.org/changeset/ports/537140

Log:
  www/firefox: don't abort WaylandShmPool::Resize if posix_fallocate succeeds

  PR:		240884
  Submitted by:	tijl
  Pointy hat to:	jbeich

Changes:
  head/mail/thunderbird/Makefile
  head/mail/thunderbird/files/patch-bug1618914
  head/www/firefox/Makefile
  head/www/firefox/files/patch-bug1618914
  head/www/firefox-esr/Makefile
  head/www/firefox-esr/files/patch-bug1618914
Comment 11 commit-hook freebsd_committer freebsd_triage 2020-05-31 09:26:56 UTC
A commit references this bug:

Author: jbeich
Date: Sun May 31 09:26:44 UTC 2020
New revision: 537141
URL: https://svnweb.freebsd.org/changeset/ports/537141

Log:
  MFH: r537140

  www/firefox: don't abort WaylandShmPool::Resize if posix_fallocate succeeds

  PR:		240884
  Submitted by:	tijl
  Pointy hat to:	jbeich
  Approved by:	ports-secteam blanket

Changes:
_U  branches/2020Q2/
  branches/2020Q2/mail/thunderbird/Makefile
  branches/2020Q2/mail/thunderbird/files/patch-bug1618914
  branches/2020Q2/www/firefox/Makefile
  branches/2020Q2/www/firefox/files/patch-bug1618914
  branches/2020Q2/www/firefox-esr/Makefile
  branches/2020Q2/www/firefox-esr/files/patch-bug1618914
Comment 12 Mark Linimon freebsd_committer freebsd_triage 2020-08-17 06:46:24 UTC
Committed May 31 09:24:22 UTC 2020 as r537140.

^Triage: assign to committer that resolved.