Closed Bug 1800857 Opened 2 years ago Closed 1 year ago

Segmentation fault (core dumped) when building beta snap (amd64)

Categories

(Firefox Build System :: General, defect)

Firefox 108
Desktop
Linux
defect

Tracking

(firefox-esr102 unaffected, firefox107 unaffected, firefox108 fixed, firefox109 fixed)

RESOLVED FIXED
Tracking Status
firefox-esr102 --- unaffected
firefox107 --- unaffected
firefox108 --- fixed
firefox109 --- fixed

People

(Reporter: olivier, Assigned: gerard-majax)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Snaps of firefox are automatically built at https://launchpad.net/~mozilla-snaps/firefox/+snap/firefox-snap-beta for each new beta version. Starting with 108.0b1-1, the build fails for the amd64 architecture with the following error:

54:43.67 We know it took a while, but your build finally finished successfully!
54:43.67 If you are building Firefox often, SCCache can save you a lot of time. You can learn more here: https://firefox-source-docs.mozilla.org/setup/configuring_build_options.html#sccache
54:43.68 /usr/bin/make -C . -j4 -s -w package
54:43.72 make: Entering directory '/build/firefox/parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented'
54:43.72 make[1]: Entering directory '/build/firefox/parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented/browser/installer'
54:43.75 make[2]: Entering directory '/build/firefox/parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented/browser/installer'
54:43.76 make[3]: Entering directory '/build/firefox/parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented/browser/installer'
54:47.52 ../../dist/firefox/libnspr4.so: Reduced by 24384 bytes
54:47.53 ../../dist/firefox/libplc4.so: No gain. Skipping
54:47.54 ../../dist/firefox/libplds4.so: No gain. Skipping
54:51.99 ../../dist/firefox/libxul.so: Reduced by 19254864 bytes
54:52.73 ../../dist/firefox/libmozgtk.so: No gain. Skipping
54:52.74 ../../dist/firefox/libmozwayland.so: No gain. Skipping
54:52.81 ../../dist/firefox/libmozsqlite3.so: Reduced by 53056 bytes
54:52.82 ../../dist/firefox/liblgpllibs.so: Reduced by 3904 bytes
54:52.84 ../../dist/firefox/libmozavutil.so: Reduced by 28480 bytes
54:52.88 ../../dist/firefox/libmozavcodec.so: Reduced by 130880 bytes
54:52.90 ../../dist/firefox/libfreeblpriv3.so: Reduced by 7992 bytes
54:52.91 ../../dist/firefox/libnss3.so: Reduced by 7992 bytes
54:52.93 ../../dist/firefox/libnssckbi.so: Reduced by 53048 bytes
54:52.94 ../../dist/firefox/libnssutil3.so: Reduced by 24368 bytes
54:52.95 ../../dist/firefox/libsmime3.so: No gain. Skipping
54:52.96 ../../dist/firefox/libssl3.so: Reduced by 20272 bytes
54:52.97 ../../dist/firefox/libsoftokn3.so: Reduced by 7992 bytes
54:52.99 ../../dist/firefox/libipcclientcerts.so: Reduced by 7992 bytes
54:53.01 ../../dist/firefox/libmozsandbox.so: Reduced by 32568 bytes
54:53.07 ../../dist/firefox/gmp-clearkey/0.1/libclearkey.so: Reduced by 3904 bytes
54:53.10 Compressing...
55:20.90   (stdin):  3.442:1,  2.324 bits/byte, 70.95% saved, 378552320 in, 109983729 out.
55:20.90 make[3]: Leaving directory '/build/firefox/parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented/browser/installer'
55:21.48 Segmentation fault (core dumped)
55:21.48 make[2]: *** [/build/firefox/parts/firefox/build/toolkit/mozapps/installer/packager.mk:113: make-package] Error 139
55:21.48 make[2]: Leaving directory '/build/firefox/parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented/browser/installer'
55:21.48 make[1]: *** [/build/firefox/parts/firefox/build/config/rules.mk:361: default] Error 2
55:21.48 make[1]: Leaving directory '/build/firefox/parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented/browser/installer'
55:21.48 make: *** [/build/firefox/parts/firefox/build/browser/build.mk:6: package] Error 2
55:21.48 make: Leaving directory '/build/firefox/parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented'

Note that nightly builds of 108.0a1 (done in a different environment) don't seem to be affected by this problem, so perhaps it's a Launchpad-specific problem.

I'm currently running a local build in a LXC container to try and reproduce the problem.

Blocks: snap

Segfault because of consuming too much memory? That's often how it manifests.

The Bugbug bot thinks this bug should belong to the 'Firefox Build System::General' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → General
Product: Firefox → Firefox Build System

Same problem when building the beta branch rebased on core22.

(In reply to Olivier Tilloy from comment #4)

Same problem when building the beta branch rebased on core22.

This is badly broken for me:

$ time SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY=96G SNAPCRAFT_BUILD_ENVIRONMENT_CPU=160 snap run snapcraft 2>&1 | tee build_beta_core22.log
Traceback (most recent call last):
  File "/snap/snapcraft/8528/bin/snapcraft", line 8, in <module>
    sys.exit(run())
  File "/snap/snapcraft/8528/lib/python3.8/site-packages/snapcraft/cli.py", line 228, in run
    _run_dispatcher(dispatcher)
  File "/snap/snapcraft/8528/lib/python3.8/site-packages/snapcraft/cli.py", line 204, in _run_dispatcher
    dispatcher.run()
  File "/snap/snapcraft/8528/lib/python3.8/site-packages/craft_cli/dispatcher.py", line 448, in run
    return self._loaded_command.run(self._parsed_command_args)
  File "/snap/snapcraft/8528/lib/python3.8/site-packages/snapcraft/commands/lifecycle.py", line 259, in run
    super().run(parsed_args)
  File "/snap/snapcraft/8528/lib/python3.8/site-packages/snapcraft/commands/lifecycle.py", line 132, in run
    parts_lifecycle.run(self.name, parsed_args)
  File "/snap/snapcraft/8528/lib/python3.8/site-packages/snapcraft/parts/lifecycle.py", line 208, in run
    _run_command(
  File "/snap/snapcraft/8528/lib/python3.8/site-packages/snapcraft/parts/lifecycle.py", line 249, in _run_command
    _run_in_provider(project, command_name, parsed_args)
  File "/snap/snapcraft/8528/lib/python3.8/site-packages/snapcraft/parts/lifecycle.py", line 475, in _run_in_provider
    providers.ensure_provider_is_available(provider)
  File "/snap/snapcraft/8528/lib/python3.8/site-packages/snapcraft/providers.py", line 74, in ensure_provider_is_available
    if not LXDProvider.is_provider_installed() and not confirm_with_user(
  File "/snap/snapcraft/8528/lib/python3.8/site-packages/snapcraft/utils.py", line 259, in confirm_with_user
    with emit.pause():
  File "/snap/snapcraft/8528/lib/python3.8/site-packages/craft_cli/messages.py", line 694, in func
    raise RuntimeError("Emitter is stopped already")
RuntimeError: Emitter is stopped already

But origin/beta on core20, snapcraft run seems to work better.

(In reply to Olivier Tilloy from comment #0)

Snaps of firefox are automatically built at https://launchpad.net/~mozilla-snaps/firefox/+snap/firefox-snap-beta for each new beta version. Starting with 108.0b1-1, the build fails for the amd64 architecture with the following error:

54:43.67 We know it took a while, but your build finally finished successfully!
54:43.67 If you are building Firefox often, SCCache can save you a lot of time. You can learn more here: https://firefox-source-docs.mozilla.org/setup/configuring_build_options.html#sccache
54:43.68 /usr/bin/make -C . -j4 -s -w package
54:43.72 make: Entering directory '/build/firefox/parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented'
54:43.72 make[1]: Entering directory '/build/firefox/parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented/browser/installer'
54:43.75 make[2]: Entering directory '/build/firefox/parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented/browser/installer'
54:43.76 make[3]: Entering directory '/build/firefox/parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented/browser/installer'
54:47.52 ../../dist/firefox/libnspr4.so: Reduced by 24384 bytes
54:47.53 ../../dist/firefox/libplc4.so: No gain. Skipping
54:47.54 ../../dist/firefox/libplds4.so: No gain. Skipping
54:51.99 ../../dist/firefox/libxul.so: Reduced by 19254864 bytes
54:52.73 ../../dist/firefox/libmozgtk.so: No gain. Skipping
54:52.74 ../../dist/firefox/libmozwayland.so: No gain. Skipping
54:52.81 ../../dist/firefox/libmozsqlite3.so: Reduced by 53056 bytes
54:52.82 ../../dist/firefox/liblgpllibs.so: Reduced by 3904 bytes
54:52.84 ../../dist/firefox/libmozavutil.so: Reduced by 28480 bytes
54:52.88 ../../dist/firefox/libmozavcodec.so: Reduced by 130880 bytes
54:52.90 ../../dist/firefox/libfreeblpriv3.so: Reduced by 7992 bytes
54:52.91 ../../dist/firefox/libnss3.so: Reduced by 7992 bytes
54:52.93 ../../dist/firefox/libnssckbi.so: Reduced by 53048 bytes
54:52.94 ../../dist/firefox/libnssutil3.so: Reduced by 24368 bytes
54:52.95 ../../dist/firefox/libsmime3.so: No gain. Skipping
54:52.96 ../../dist/firefox/libssl3.so: Reduced by 20272 bytes
54:52.97 ../../dist/firefox/libsoftokn3.so: Reduced by 7992 bytes
54:52.99 ../../dist/firefox/libipcclientcerts.so: Reduced by 7992 bytes
54:53.01 ../../dist/firefox/libmozsandbox.so: Reduced by 32568 bytes
54:53.07 ../../dist/firefox/gmp-clearkey/0.1/libclearkey.so: Reduced by 3904 bytes
54:53.10 Compressing...
55:20.90   (stdin):  3.442:1,  2.324 bits/byte, 70.95% saved, 378552320 in, 109983729 out.
55:20.90 make[3]: Leaving directory '/build/firefox/parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented/browser/installer'
55:21.48 Segmentation fault (core dumped)
55:21.48 make[2]: *** [/build/firefox/parts/firefox/build/toolkit/mozapps/installer/packager.mk:113: make-package] Error 139
55:21.48 make[2]: Leaving directory '/build/firefox/parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented/browser/installer'
55:21.48 make[1]: *** [/build/firefox/parts/firefox/build/config/rules.mk:361: default] Error 2
55:21.48 make[1]: Leaving directory '/build/firefox/parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented/browser/installer'
55:21.48 make: *** [/build/firefox/parts/firefox/build/browser/build.mk:6: package] Error 2
55:21.48 make: Leaving directory '/build/firefox/parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented'

Reproducing locally

Wondering if it's not related to MOZ_PGO, I've cleaned the snapcraft env, removed MOZ_PGO=1 definitions and now it is failing differently:

 0:23.24 error: linking with `/root/parts/firefox/build/build/cargo-linker` failed: exit status: 1
 0:23.24   |
 0:23.24   = note: "/root/parts/firefox/build/build/cargo-linker" "-m64" "/tmp/rustctfWbSO/symbols.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/testing/geckodriver/./release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.0.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/testing/geck
odriver/./release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.1.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/testing/geckodriver/./release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.10.rcgu.o" "/root/parts/firefox/build/obj-x8
6_64-pc-linux-gnu/testing/geckodriver/./release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.11.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/testing/geckodriver/./release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.12.rcgu.o" "/
root/parts/firefox/build/obj-x86_64-pc-linux-gnu/testing/geckodriver/./release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.13.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/testing/geckodriver/./release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_b
uild.c436f010-cgu.14.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/testing/geckodriver/./release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.15.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/testing/geckodriver/./release/build/proc-macro2-637d3fceeb053ee8/build_script_build-
637d3fceeb053ee8.build_script_build.c436f010-cgu.2.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/testing/geckodriver/./release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.3.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/testing/geckodriver/./release/build/proc-macro2-637d3fc
eeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.4.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/testing/geckodriver/./release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.5.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/testing/geckodriver/./rele
ase/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.6.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/testing/geckodriver/./release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.7.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-g
nu/testing/geckodriver/./release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.8.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/testing/geckodriver/./release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.9.rcgu.o" "/root/parts/firefo
x/build/obj-x86_64-pc-linux-gnu/testing/geckodriver/./release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.1b8gzlj9r1tohf9a.rcgu.o" "-Wl,--as-needed" "-L" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/testing/geckodriver/./release/deps" "-L" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/root/stage
/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-05737cf45bd30456.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-9f873b61fdec9b03.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-7f13930fcac1846f.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-098633b847612f3b.rlib" "/ro
ot/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-f14b73d282b0245e.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-2c5b4433ebc1d822.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-59591a7b405fe395.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-384947c6
d5f697ff.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-b08a86c6880b47a8.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-58adeee671f9ba8e.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-f156b880fc73e7f0.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librus
tc_std_workspace_alloc-4458c5022988e1ab.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-02e61e5ec4aa9e8b.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-a0d9b33b5161957b.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-04cec55a79224c36.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknow
n-linux-gnu/lib/liballoc-3fb6d8496dc7d6a6.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-7d46c016841a97d4.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-a1f7b8b60464cc57.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-272ca28f0b8538d5.rlib" "-Wl,-Bdyna
mic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/testing/geckodriver/./release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8" "-Wl,--gc-sections" "-pie" "-Wl,-z
relro,-znow" "-nodefaultlibs"
 0:23.24   = note: /snap/gnome-3-38-2004-sdk/current/usr/bin/ld.gold: fatal error: LLVM gold plugin has failed to create LTO module: Opaque pointers are only supported in -opaque-pointers mode (Producer: 'LLVM15.0.0-rust-1.65.0-stable' Reader: 'LLVM 14.0.0')
 0:23.24           clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
 0:23.24 error: could not compile `proc-macro2` due to previous error
 0:23.34 dom/media/platforms/ffmpeg/ffmpeg59
 0:23.58 make[4]: *** [/root/parts/firefox/build/config/makefiles/rust.mk:498: force-cargo-program-build] Error 101
 0:23.59 make[3]: *** [/root/parts/firefox/build/config/recurse.mk:72: testing/geckodriver/target] Error 2
 0:23.59 make[3]: *** Waiting for unfinished jobs....
 0:24.05 error: linking with `/root/parts/firefox/build/build/cargo-linker` failed: exit status: 1
 0:24.05   |
 0:24.05   = note: "/root/parts/firefox/build/build/cargo-linker" "-m64" "/tmp/rustcpCLu5l/symbols.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.0.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/release/build/proc-macro2-637d3fce
eb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.1.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.10.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/release/build/proc-macro2-637d3fceeb053ee8/build
_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.11.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.12.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/release/build/proc-macro2-637d3fceeb053ee8/build_script_build
-637d3fceeb053ee8.build_script_build.c436f010-cgu.13.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.14.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb05
3ee8.build_script_build.c436f010-cgu.15.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.2.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_scr
ipt_build.c436f010-cgu.3.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.4.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f
010-cgu.5.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.6.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.7.rcgu.
o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.8.rcgu.o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.build_script_build.c436f010-cgu.9.rcgu.o" "/root/parts
/firefox/build/obj-x86_64-pc-linux-gnu/release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8.1b8gzlj9r1tohf9a.rcgu.o" "-Wl,--as-needed" "-L" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/release/deps" "-L" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux
-gnu/lib/libstd-05737cf45bd30456.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-9f873b61fdec9b03.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-7f13930fcac1846f.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-098633b847612f3b.rlib" "/root/stage/usr/lib/rustlib/x86_64-unkno
wn-linux-gnu/lib/libaddr2line-f14b73d282b0245e.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-2c5b4433ebc1d822.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-59591a7b405fe395.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-384947c6d5f697ff.rlib" "/root/stage/usr/lib/r
ustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-b08a86c6880b47a8.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-58adeee671f9ba8e.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-f156b880fc73e7f0.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-4458c5022988e1
ab.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-02e61e5ec4aa9e8b.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-a0d9b33b5161957b.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-04cec55a79224c36.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-3fb6d8496dc7
d6a6.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-7d46c016841a97d4.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-a1f7b8b60464cc57.rlib" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-272ca28f0b8538d5.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpth
read" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/root/stage/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/release/build/proc-macro2-637d3fceeb053ee8/build_script_build-637d3fceeb053ee8" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro,-znow" "-nodefaultlibs"
 0:24.05   = note: /snap/gnome-3-38-2004-sdk/current/usr/bin/ld.gold: fatal error: LLVM gold plugin has failed to create LTO module: Opaque pointers are only supported in -opaque-pointers mode (Producer: 'LLVM15.0.0-rust-1.65.0-stable' Reader: 'LLVM 14.0.0')
 0:24.05           clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
 0:24.05 error: could not compile `proc-macro2` due to previous error
 0:24.43 make[4]: *** [/root/parts/firefox/build/config/makefiles/rust.mk:432: force-cargo-library-build] Error 101

Add -no-opaque-pointers to the flags

(In reply to Sylvestre Ledru [:Sylvestre] from comment #8)

Add -no-opaque-pointers to the flags

Which flags? export LDFLAGS=-no-opaque-pointers ?

C & CXXFLAGS I think

Olivier, can you add -v to your mach build so that logs can be more useful? Presumably, it's xpcshell from here that crashes, but it would be better not to have to guess now and in the future. Anyways, xpcshell crashing is usually an indication of something going terribly wrong in the compiler(s). And the first thing that can go wrong in a mix like clang 14 (llvm 14) + rust 1.65 (llvm 15) is something similar to but not exactly https://github.com/llvm/llvm-project/issues/52683. I wouldn't trust llvm 14 with compiling llvm 15 IR either.

(In reply to Sylvestre Ledru [:Sylvestre] from comment #10)

C & CXXFLAGS I think

That won't work (and LDFLAGS won't work either) as what's enabling opaque pointers is rust. You'd need to use the right flags to disable them there, whatever they are (IIRC it's something-something opaque-pointers=0)

Ran locally with -v -j1, and got the following output:

242:11.31 Compressing...
242:11.31 cd ../../dist && /bin/tar -c --owner=0 --group=0 --numeric-owner --mode=go-w --exclude=.mkdir.done -f - firefox | bzip2 -vf > firefox-108.0.en-US.linux-x86_64.tar.bz2
242:47.79   (stdin):  3.437:1,  2.328 bits/byte, 70.91% saved, 378429440 in, 110099733 out.
242:47.79 make[3]: Leaving directory '/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented/browser/installer'
242:47.79 # Generate a file that describes the local Normandy client.
242:47.79 env LD_LIBRARY_PATH="/snap/gnome-3-38-2004-sdk/current/usr/lib/x86_64-linux-gnu:/snap/gnome-3-38-2004-sdk/current/usr/lib:../../dist//bin" \
242:47.79 	../../dist//bin/xpcshell \
242:47.79 	/root/parts/firefox/build/toolkit/components/normandy/metadata-script.js ../../dist//firefox-108.0.en-US.linux-x86_64.normandy.json
242:48.15 Segmentation fault (core dumped)
242:48.15 make[2]: *** [/root/parts/firefox/build/toolkit/mozapps/installer/packager.mk:113: make-package] Error 139
242:48.15 make[2]: Leaving directory '/root/parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented/browser/installer'
242:48.16 make[1]: *** [/root/parts/firefox/build/config/rules.mk:361: default] Error 2

(In reply to Mike Hommey [:glandium] from comment #11)

Olivier, can you add -v to your mach build so that logs can be more useful? Presumably, it's xpcshell from here that crashes, but it would be better not to have to guess now and in the future. Anyways, xpcshell crashing is usually an indication of something going terribly wrong in the compiler(s). And the first thing that can go wrong in a mix like clang 14 (llvm 14) + rust 1.65 (llvm 15) is something similar to but not exactly https://github.com/llvm/llvm-project/issues/52683. I wouldn't trust llvm 14 with compiling llvm 15 IR either.

(In reply to Sylvestre Ledru [:Sylvestre] from comment #10)

C & CXXFLAGS I think

That won't work (and LDFLAGS won't work either) as what's enabling opaque pointers is rust. You'd need to use the right flags to disable them there, whatever they are (IIRC it's something-something opaque-pointers=0)

There seems to be no x86-64 linux binary release available on https://github.com/llvm/llvm-project/releases/tag/llvmorg-15.0.0 unfortunately

The lack of linux x86-64 binary builds is tracked at https://github.com/llvm/llvm-project/issues/58004.

(In reply to Mike Hommey [:glandium] from comment #11)

And the first thing that can go wrong in a mix like clang 14 (llvm 14) + rust 1.65 (llvm 15)

I tried reverting the rustc version to 1.64 (which presumably is built with llvm 14) and I'm still getting the same error.

(In reply to Olivier Tilloy from comment #12)

242:47.79 # Generate a file that describes the local Normandy client.
242:47.79 env LD_LIBRARY_PATH="/snap/gnome-3-38-2004-sdk/current/usr/lib/x86_64-linux-gnu:/snap/gnome-3-38-2004-sdk/current/usr/lib:../../dist//bin" \
242:47.79 	../../dist//bin/xpcshell \
242:47.79 	/root/parts/firefox/build/toolkit/components/normandy/metadata-script.js ../../dist//firefox-108.0.en-US.linux-x86_64.normandy.json
242:48.15 Segmentation fault (core dumped)

This might be a red herring? When I get this error locally and snapcraft drops me in a shell in the build environment, running that exact command does generate firefox-108.0.en-US.linux-x86_64.normandy.json successfully.

Long shot, ../../dist//bin double / sometimes makes funny things

  • Downgrading rust to 1.64.0 and disabling PGO (and ld.gold and lto=cross) gets me a successfull build now.
  • Downgrading rust to 1.64.0 and disabling PGO (only), fails with: 5:34.11 /snap/gnome-3-38-2004-sdk/current/usr/bin/ld.gold: fatal error: out of file descriptors and couldn't close any
  • Downgrading rust to 1.64.0, enabling PGO and disabling ld.gold and lto=cross still crashes

So it seems to be PGO's xpcshell?

Get a stacktrace of the crash?

(In reply to Mike Hommey [:glandium] from comment #18)

Get a stacktrace of the crash?

No, and issuing a debug shell, manually running the faulty command does not reproduce the issue as olivier stated earlier.

Looks like the stack is better once analyzed outside of the snapcraft builder?:

(gdb) bt
#0  GetUnixSystemConfigDir (aFile=0x7ffc449eab10) at /root/parts/firefox/build/xpcom/io/SpecialSystemDirectory.cpp:196
#1  GetSpecialSystemDirectory (aSystemSystemDirectory=Unix_SystemConfigDirectory, aFile=0x7ffc449eab10) at /root/parts/firefox/build/xpcom/io/SpecialSystemDirectory.cpp:671
#2  0x00007fe4e8f823fc in nsDirectoryService::GetFile (this=<optimized out>, aProp=<optimized out>, aPersistent=0x7ffc449eabe0, aResult=0x7ffc449eabd8) at /root/parts/firefox/build/xpcom/io/nsDirectoryService.cpp:370
#3  0x00007fe4e8f813c6 in FindProviderFile (aElement=aElement@entry=0x7fe4e478ab10, aData=aData@entry=0x7ffc449eabd0) at /root/parts/firefox/build/xpcom/io/nsDirectoryService.cpp:175
#4  0x00007fe4e8f811da in nsDirectoryService::Get (this=0x7fe4e478ab00, aProp=0x7fe4f1792b81 "SysConfD", aUuid=..., aResult=0x7ffc449eaca8) at /root/parts/firefox/build/xpcom/io/nsDirectoryService.cpp:220
#5  0x00007fe4e9039bdb in NS_GetSpecialDirectory (aResult=0x7ffc449eaca8, aSpecialDirName=<optimized out>) at /root/parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented/dist/include/nsDirectoryServiceUtils.h:25
#6  mozilla::Preferences::InitInitialObjects (aIsStartup=false) at /root/parts/firefox/build/modules/libpref/Preferences.cpp:4865
#7  0x00007fe4e9039296 in mozilla::Preferences::GetInstanceForService () at /root/parts/firefox/build/modules/libpref/Preferences.cpp:3566
#8  0x00007fe4e8fb5995 in mozilla::xpcom::CreateInstanceImpl (aID=53376, aIID=..., aResult=0x7ffc449eae98) at StaticComponents.cpp:10432
#9  0x00007fe4e8fc7ff4 in (anonymous namespace)::EntryWrapper::CreateInstance (this=0x7ffc449eafe8, aIID=..., aResult=0x7ffc449eae98) at /root/parts/firefox/build/xpcom/components/nsComponentManager.cpp:184
#10 nsComponentManagerImpl::GetServiceLocked (this=this@entry=0x7fe4e470d000, aLock=..., aEntry=..., aIID=..., aResult=aResult@entry=0x7ffc449eb068) at /root/parts/firefox/build/xpcom/components/nsComponentManager.cpp:975
#11 0x00007fe4e8fc8ccf in nsComponentManagerImpl::GetServiceByContractID (this=0x7fe4e470d000, aContractID=0x7fe4f17929ed "@mozilla.org/preferences-service;1", aIID=..., aResult=aResult@entry=0x7ffc449eb068) at /root/parts/firefox/build/xpcom/components/nsComponentManager.cpp:1164
#12 0x00007fe4e8fcb949 in CallGetService (aContractID=0x3 <error: Cannot access memory at address 0x3>, aIID=..., aResult=<optimized out>) at /root/parts/firefox/build/xpcom/components/nsComponentManagerUtils.cpp:61
#13 nsGetServiceByContractID::operator() (this=0x7fe4f178cfef, aIID=..., aInstancePtr=0x7ffc449eb068) at /root/parts/firefox/build/xpcom/components/nsComponentManagerUtils.cpp:240
#14 0x00007fe4e8efabda in nsCOMPtr_base::assign_from_gs_contractid (this=0x7ffc449eb0b8, aGS=..., aIID=...) at /root/parts/firefox/build/xpcom/base/nsCOMPtr.cpp:82
#15 0x00007fe4e9082c3f in nsCOMPtr<nsIPrefService>::nsCOMPtr (this=0x7ffc449eb0b8, aGS=...) at /root/parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented/dist/include/nsCOMPtr.h:627
#16 mozilla::Preferences::InitStaticMembers () at /root/parts/firefox/build/modules/libpref/Preferences.cpp:3648
#17 mozilla::Preferences::RegisterCallbackImpl<char const**> (aCallback=0x7fe4e9288ae0 <nsIDNService::PrefChanged(char const*, void*)>, aPrefNode=@0x7ffc449eb100: 0x7fe4f6df1f90 <gCallbackPrefs>, aData=0x7fe4e47511c0, aMatchKind=mozilla::Preferences::PrefixMatch, aIsPriority=false) at /root/parts/firefox/build/modules/libpref/Preferences.cpp:5383
#18 0x00007fe4e9082abd in mozilla::Preferences::RegisterCallbacks (aCallback=0x7fe4e470d080, aPrefs=0x7fe4f6df1f90 <gCallbackPrefs>, aData=0x3, aMatchKind=(unknown: 0xff6da240)) at /root/parts/firefox/build/modules/libpref/Preferences.cpp:5420
#19 0x00007fe4e9288a5a in mozilla::Preferences::RegisterPrefixCallbacks<nsIDNService> (aCallback=0x7fe4e470d080, aPrefs=0x3, aClosure=0x7fe4e47511c0) at /root/parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented/dist/include/mozilla/Preferences.h:344
#20 nsIDNService::Init (this=0x7fe4e47511c0) at /root/parts/firefox/build/netwerk/dns/nsIDNService.cpp:95
#21 0x00007fe4e8fb8e73 in mozilla::xpcom::CreateInstanceImpl (aID=<optimized out>, aIID=..., aResult=0x7ffc449eb1d8) at StaticComponents.cpp:9370
#22 0x00007fe4e8fc7ff4 in (anonymous namespace)::EntryWrapper::CreateInstance (this=0x7ffc449eb328, aIID=..., aResult=0x7ffc449eb1d8) at /root/parts/firefox/build/xpcom/components/nsComponentManager.cpp:184
#23 nsComponentManagerImpl::GetServiceLocked (this=this@entry=0x7fe4e470d000, aLock=..., aEntry=..., aIID=..., aResult=aResult@entry=0x7ffc449eb3a8) at /root/parts/firefox/build/xpcom/components/nsComponentManager.cpp:975
#24 0x00007fe4e8fc8ccf in nsComponentManagerImpl::GetServiceByContractID (this=0x7fe4e470d000, aContractID=0x7fe4f17adba3 "@mozilla.org/network/idn-service;1", aIID=..., aResult=aResult@entry=0x7ffc449eb3a8) at /root/parts/firefox/build/xpcom/components/nsComponentManager.cpp:1164
#25 0x00007fe4e8fcb949 in CallGetService (aContractID=0x3 <error: Cannot access memory at address 0x3>, aIID=..., aResult=<optimized out>) at /root/parts/firefox/build/xpcom/components/nsComponentManagerUtils.cpp:61
#26 nsGetServiceByContractID::operator() (this=0x7fe4f178cfef, aIID=..., aInstancePtr=0x7ffc449eb3a8) at /root/parts/firefox/build/xpcom/components/nsComponentManagerUtils.cpp:240
#27 0x00007fe4e8efabda in nsCOMPtr_base::assign_from_gs_contractid (this=0x7ffc449eb3e8, aGS=..., aIID=...) at /root/parts/firefox/build/xpcom/base/nsCOMPtr.cpp:82
#28 0x00007fe4e91d7886 in nsCOMPtr<nsIIDNService>::nsCOMPtr (this=0x7ffc449eb3e8, aGS=...) at /root/parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented/dist/include/nsCOMPtr.h:627
#29 mozilla::net::nsStandardURL::InitGlobalObjects () at /root/parts/firefox/build/netwerk/base/nsStandardURL.cpp:343
#30 0x00007fe4e9a9abe1 in nsNetStartup () at /root/parts/firefox/build/netwerk/build/nsNetModule.cpp:215
#31 0x00007fe4e8faea2b in mozilla::xpcom::CallInitFunc (aIdx=3) at StaticComponents.cpp:9101
#32 mozilla::xpcom::CreateInstanceImpl (aID=53376, aIID=..., aResult=0x7ffc449eb4c8) at StaticComponents.cpp:11849
#33 0x00007fe4e8fc7ff4 in (anonymous namespace)::EntryWrapper::CreateInstance (this=0x7ffc449eb618, aIID=..., aResult=0x7ffc449eb4c8) at /root/parts/firefox/build/xpcom/components/nsComponentManager.cpp:184
#34 nsComponentManagerImpl::GetServiceLocked (this=this@entry=0x7fe4e470d000, aLock=..., aEntry=..., aIID=..., aResult=aResult@entry=0x7fe4f94d4ed8 <nsScriptSecurityManager::sIOService>) at /root/parts/firefox/build/xpcom/components/nsComponentManager.cpp:975
#35 0x00007fe4e8fc8ccf in nsComponentManagerImpl::GetServiceByContractID (this=0x7fe4e470d000, aContractID=0x7fe4f1791fb0 "@mozilla.org/network/io-service;1", aIID=..., aResult=0x7fe4f94d4ed8 <nsScriptSecurityManager::sIOService>) at /root/parts/firefox/build/xpcom/components/nsComponentManager.cpp:1164
#36 0x00007fe4e8fcb48f in CallGetService (aContractID=0x3 <error: Cannot access memory at address 0x3>, aIID=..., aResult=0x55efff6da240 <gMozCrashReason>) at /root/parts/firefox/build/xpcom/components/nsComponentManagerUtils.cpp:61
#37 0x00007fe4e9e48252 in CallGetService<nsIIOService> (aContractID=0x7fe4e470d080 "", aDestination=0x3) at /root/parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented/dist/include/nsServiceManagerUtils.h:52
#38 nsScriptSecurityManager::Init (this=this@entry=0x7fe4e478be80) at /root/parts/firefox/build/caps/nsScriptSecurityManager.cpp:1551
#39 0x00007fe4e9e48758 in nsScriptSecurityManager::InitStatics () at /root/parts/firefox/build/caps/nsScriptSecurityManager.cpp:1612
#40 0x00007fe4e9cf4e50 in nsXPConnect::InitStatics () at /root/parts/firefox/build/js/xpconnect/src/nsXPConnect.cpp:161
#41 0x00007fe4e9cc3331 in xpcModuleCtor () at /root/parts/firefox/build/js/xpconnect/src/XPCModule.cpp:11
#42 0x00007fe4edba7c11 in nsLayoutModuleInitialize () at /root/parts/firefox/build/layout/build/nsLayoutModule.cpp:100
#43 0x00007fe4e8fc54c3 in nsComponentManagerImpl::Init (this=0x7fe4e470d000) at /root/parts/firefox/build/xpcom/components/nsComponentManager.cpp:371
#44 0x00007fe4e902b6f3 in NS_InitXPCOM (aResult=0x0, aBinDirectory=0x7fe4e477b9d0, aAppFileLocationProvider=<optimized out>, aInitJSContext=false) at /root/parts/firefox/build/xpcom/build/XPCOMInit.cpp:421
#45 0x00007fe4e9cd6d6a in XRE_XPCShellMain (argc=3, argv=0x7ffc449ebda8, envp=<optimized out>, aShellData=<optimized out>) at /root/parts/firefox/build/js/xpconnect/src/XPCShellImpl.cpp:1216
#46 0x000055efff56707f in main (argc=3, argv=0x7ffc449ebda8, envp=0x7fe4e475a100) at /root/parts/firefox/build/js/xpconnect/shell/xpcshell.cpp:81

So in current's code it would be https://searchfox.org/mozilla-central/rev/aa329cf7506ddd966542e642ec00223fd7461599/xpcom/io/SpecialSystemDirectory.cpp#196 ? Who is to blame for that code, I really wonder.

snapcraft-firefox ../parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented/browser/installer# env LD_LIBRARY_PATH="/snap/gnome-3-38-2004-sdk/current/usr/lib/x86_64-linux-gnu:/snap/gnome-3-38-2004-sdk/current/usr/lib:../../dist//bin" ../../dist//bin/xpcshell /root/parts/firefox/build/toolkit/components/normandy/metadata-script.js ../../dist//firefox-108.0.en-US.linux-x86_64.normandy.json
snapcraft-firefox ../parts/firefox/build/obj-x86_64-pc-linux-gnu/instrumented/browser/installer# env SNAP_INSTANCE_NAME=aaa LD_LIBRARY_PATH="/snap/gnome-3-38-2004-sdk/current/usr/lib/x86_64-linux-gnu:/snap/gnome-3-38-2004-sdk/current/usr/lib:../../dist//bin" ../../dist//bin/xpcshell /root/parts/firefox/build/toolkit/components/normandy/metadata-script.js ../../dist//firefox-108.0.en-US.linux-x86_64.normandy.json
Segmentation fault
Assignee: nobody → lissyx+mozillians
Regressed by: 1785278

Set release status flags based on info from the regressing bug 1785278

Locally the build is still failing on some weird linker things, I still dont get why ld.gold is picked from GNOME SDK's Snap instead of the system's one (and I already had to force CC/CXX to the firefox snap's staged clang).

But I can confirm that with a quick hack, then the segfault is fixed.

diff --git a/widget/gtk/WidgetUtilsGtk.cpp b/widget/gtk/WidgetUtilsGtk.cpp
index f0719d50daa74..eec75caf3b767 100644
--- a/widget/gtk/WidgetUtilsGtk.cpp
+++ b/widget/gtk/WidgetUtilsGtk.cpp
@@ -114,7 +114,9 @@ void SetLastMousePressEvent(GdkEvent* aEvent) {
   sLastMousePressEvent = event.release();
 }

-bool IsRunningUnderSnap() { return g_getenv("SNAP_INSTANCE_NAME") != nullptr; }
+bool IsRunningUnderSnap() {
+  return g_getenv("SNAP_INSTANCE_NAME") != nullptr && strcmp(GetSnapInstanceName(), "snapcraft") != 0;
+}

 bool IsRunningUnderFlatpak() {
   // https://gitlab.gnome.org/GNOME/gtk/-/blob/4300a5c609306ce77cbc8a3580c19201dccd8d13/gdk/gdk.c#L472

During the snap build, we are indeed in snap run snapcraft so the SNAP_INSTANCE_NAME is snapcraft.

Great piece of investigation Alexandre, thanks!

I just pushed this workaround to the snap's build recipe, and builds will be triggered automatically shortly.

Like the patch proposed by Alexandre above, that's just a workaround though. I think we need to get to the bottom of the issue and understand why xpcshell fails to locate the appInfo service when run in the snap's build environment. Since it happens only for PGO-enabled builds, and we have a custom $LD_LIBRARY_PATH set for those, perhaps that can explain the problem?

The amd64 beta build is now failing with:

65:42.52   = note: /snap/gnome-3-38-2004-sdk/current/usr/bin/ld.gold: fatal error: LLVM gold plugin has failed to create LTO module: Opaque pointers are only supported in -opaque-pointers mode (Producer: 'LLVM15.0.0-rust-1.65.0-stable' Reader: 'LLVM 14.0.0')
65:42.52           clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
65:42.53 error: could not compile `proc-macro2` due to previous error
65:42.79 make[4]: *** [/build/firefox/parts/firefox/build/config/makefiles/rust.mk:498: force-cargo-program-build] Error 101
65:42.79 make[3]: *** [/build/firefox/parts/firefox/build/config/recurse.mk:72: testing/geckodriver/target] Error 2

I have reverted the bump to rustc 1.65, let's see if the build succeeds with 1.64 (which was built with LLVM 14).

Building with rustc 1.64, together with unsetting SNAP_INSTANCE_NAME, did the trick.

We will need to find a way to build with LLVM 15 to unblock building with rustc 1.65, but I guess this bug can be closed now.

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED

(In reply to Olivier Tilloy from comment #27)

Building with rustc 1.64, together with unsetting SNAP_INSTANCE_NAME, did the trick.

We will need to find a way to build with LLVM 15 to unblock building with rustc 1.65, but I guess this bug can be closed now.

So I got confirmation that under xpcshell it is expected we dont have nsIXULAppInfo and thus the current crash is legit. Tests register a mock interface: https://searchfox.org/mozilla-central/rev/92d3050ecbbdd077ffa4cb78e0dffc4bd5021109/testing/modules/AppInfo.sys.mjs#113 this is why it was working on tests.

Maybe there is still room to be less strict, but when I reproduced locally and gave a try to returning an NS_ERROR_FAILURE it was then crashing at some other place.

See Also: → 1803146
You need to log in before you can comment on or make changes to this bug.