Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 895752 - www-client/firefox-110.0: SANDBOX ACCESS VIOLATION with USE="pgo"
Summary: www-client/firefox-110.0: SANDBOX ACCESS VIOLATION with USE="pgo"
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-21 20:29 UTC by sqrtd
Modified: 2024-02-12 05:45 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info output (emerge-info,16.04 KB, text/plain)
2023-02-21 20:33 UTC, sqrtd
Details
full build.log (build.log.xz,634.49 KB, application/x-xz)
2023-02-22 13:31 UTC, sqrtd
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sqrtd 2023-02-21 20:29:39 UTC
When updating Firefox I came across a SANDBOX ACCESS VIOLATION when building with pgo.

Steps to reproduce:
 1. Build Firefox with USE="pgo"

# /var/tmp/notmpfs/portage/www-client/firefox-110.0/temp/sandbox.log
VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: open_wr
S: deny
P: /dev/snd/seq
A: /dev/snd/seq
R: /dev/snd/seq
C: /var/tmp/notmpfs/portage/www-client/firefox-110.0/work/firefox_build/instrumented/dist/firefox/firefox http://localhost:8888/index.html -profile /var/tmp/notmpfs/portage/www-client/firefox-110.0/temp/tmpxxeq4vfh

F: open_wr
S: deny
P: /dev/snd/seq
A: /dev/snd/seq
R: /dev/snd/seq
C: /var/tmp/notmpfs/portage/www-client/firefox-110.0/work/firefox_build/instrumented/dist/firefox/firefox http://localhost:8888/index.html -profile /var/tmp/notmpfs/portage/www-client/firefox-110.0/temp/tmpxxeq4vfh
Comment 1 sqrtd 2023-02-21 20:33:45 UTC
Created attachment 853522 [details]
emerge --info output
Comment 2 Joonas Niilola gentoo-dev 2023-02-22 07:50:34 UTC
Could you upload the full build.log please? You can use "xz -9" to compress it.
Comment 3 sqrtd 2023-02-22 13:31:42 UTC
Created attachment 853888 [details]
full build.log
Comment 4 Joonas Niilola gentoo-dev 2023-02-23 06:27:03 UTC
So I was able to build firefox with your use flags on a normal glibc system. Then I spent a day setting up a musl container... just to realize pgo is use.masked for firefox in musl. So by that definition pgo won't work with musl.

However your error doesn't seem to be related to musl, but I'd rather blame -dbus and your system overall instead. If you want to try, add:

  addpredict /dev/snd

to line 552 in the ebuild. To clarify, you want to edit this:


  # May need a wider addpredict when using wayland+pgo.
  addpredict /dev/dri


into this:


  # May need a wider addpredict when using wayland+pgo.
  addpredict /dev/dri
  addpredict /dev/snd


(Again, I was able to compile firefox with -dbus +pgo +lto so just guessing here)
Comment 5 sqrtd 2023-02-23 21:53:16 UTC
I've just compiled Firefox with your suggested fix with both PGO & clang on musl which are masked, and it built successfully, so is there any reason for it to still be masked? I've had both unmasked for 1–2 months without even noticing until this issue came up and like you said it doesn't seem related to musl, and Alpine also seems to use PGO (not sure about clang) when building Firefox on amd64 (https://git.alpinelinux.org/aports/tree/community/firefox/APKBUILD#n614).

Thank you very much for your help and suggested fix and sorry if I wasted any of your time.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-23 22:28:56 UTC
The issue was/is that building with clang[-default-libcxx] (or otherwise not passing -stdlib=libc++ or whatever it is) would fail. I haven't verified that now works.
Comment 7 David Carlos Manuelda 2024-02-12 01:34:07 UTC
(In reply to sqrtd from comment #5)
> I've just compiled Firefox with your suggested fix with both PGO & clang on
> musl which are masked, and it built successfully, so is there any reason for
> it to still be masked? I've had both unmasked for 1–2 months without even
> noticing until this issue came up and like you said it doesn't seem related
> to musl, and Alpine also seems to use PGO (not sure about clang) when
> building Firefox on amd64
> (https://git.alpinelinux.org/aports/tree/community/firefox/APKBUILD#n614).
> 
> Thank you very much for your help and suggested fix and sorry if I wasted
> any of your time.

Just for the record, they use also clang/clang++ to compile: https://git.alpinelinux.org/aports/tree/community/firefox/APKBUILD#n639
Comment 8 Joonas Niilola gentoo-dev 2024-02-12 05:45:28 UTC
While this bug may not be fixed (relate to -dbus), pgo is now available on musl with commit d48fc6e32f86ef142c73c7c546d23d607334319e