Artifact builds nondeterministically drop the fake GMP plugin libraries from the test archive
Categories
(Firefox Build System :: General, defect)
Tracking
(firefox156 fixed)
| Tracking | Status | |
|---|---|---|
| firefox156 | --- | fixed |
People
(Reporter: pehrsons, Assigned: pehrsons)
References
Details
Attachments
(1 external file)
Summary
ArtifactJob.test_artifact_patterns in python/mozbuild/mozbuild/artifacts.py is a set, but its
consumers (process_tests_zip_artifact, write_tests_tar_artifact) iterate it and break on the first
matching pattern. Two entries overlap:
("bin/plugins/gmp-*/*/*", ("bin/plugins", "bin")), # correct
("bin/plugins/*", ("bin/plugins", "plugins")), # also matches - trailing * matches the subtree
mozpath.match("bin/plugins/gmp-fakeopenh264/1.0/libfakeopenh264.so", "bin/plugins/*") returns True,
so which rule wins depends on set iteration order, i.e. on PYTHONHASHSEED, which is not pinned anywhere
in the build system. Measured over 60 seeds: 35/60 (~58%) produce the wrong destination.
When it loses the flip, libfake.so and libfakeopenh264.so are written to dist/plugins/ instead of
dist/bin/. test_archive.py packages GMP plugins from dist/bin only (GMP_TEST_PLUGIN_DIRS,
test_archive.py:212), so the libraries are silently absent from the test archive - while
manifest.json / fakeopenh264.info are still present, because those come from the source tree via
FINAL_TARGET. Gecko therefore discovers the plugin and advertises H264, then the GMP child process
cannot load the library:
Hit MOZ_CRASH(Plugin file does not exist) at dom/media/gmp/GMPChild.cpp:301
PROCESS-CRASH | MOZ_CRASH(Plugin file does not exist) [@ mozilla::gmp::GMPChild::GetUTF8LibPath]
This is latent, not a recent regression - it predates the 2020 black reformat. The last content change
to the set was bug 2025276 (2026-05-07).
Impact
Artifact builds only, so in practice wpt-sync try pushes and local mach artifact builds. Never
autoland/central, never a try push with a real build. A developer running ./mach wpt on an artifact
build gets H264 crashes roughly three times in five, depending on when they last ran
mach artifact install.
Steps to reproduce
- Do a linux64 artifact build (
ac_add_options --enable-artifact-builds). tar tf <objdir>/dist/target.common.tests.tar.zst | grep gmp-fake- About 58% of the time
libfake.so/libfakeopenh264.soare missing.manifest.jsonand
fakeopenh264.infoare present either way. - Run any H264 wpt, e.g.
/webrtc/simulcast/h264.https.html- it crashes.
Evidence
Two wpt-sync try pushes, same task label test-linux2404-64/debug-web-platform-tests-webrtc, same build
config (USE_ARTIFACT=1, same mozconfig):
- Passes: https://treeherder.mozilla.org/jobs?repo=try&revision=619f12d38a240198c195f0597fb2cf799057002f
- build log:
Adding bin/gmp-fakeopenh264/1.0/libfakeopenh264.so to processed archive - tests archive contains
libfake.so,libfakeopenh264.so,manifest.json,fakeopenh264.info
- build log:
- Fails: https://treeherder.mozilla.org/jobs?repo=try&revision=522d4cb581f17be863814373725917fb061136af
- build log:
Adding plugins/gmp-fakeopenh264/1.0/libfakeopenh264.so to processed archive - tests archive contains only
manifest.jsonandfakeopenh264.info
- build log:
Note the failing build did read the .so out of the upstream archive - it just wrote it to the wrong
destination. This is not an upstream-artifact problem.
Frequency, over the last 150 wpt-sync try pushes. Only 9 scheduled linux web-platform-tests-webrtc
jobs at all, which is why this stayed hidden:
08-08 08:58 63073ee2e162 build=ARTIFACT gmp-crash=YES
08-08 11:26 3042cc6020b5 build=full gmp-crash=no
08-10 08:13 cdafd1c51092 build=ARTIFACT gmp-crash=YES
08-10 11:18 9c0b57352b6b build=full gmp-crash=no
08-12 07:38 619f12d38a24 build=ARTIFACT gmp-crash=no
08-12 11:29 ace61220b88b build=full gmp-crash=no
08-14 08:53 a308a879bc00 build=ARTIFACT gmp-crash=YES
08-14 13:33 522d4cb581f1 build=ARTIFACT gmp-crash=YES
08-14 16:42 1092520c9cf1 build=full gmp-crash=no
4 of 5 artifact pushes crashed, 0 of 4 full builds did.
Fix
Change both test_artifact_patterns definitions (ArtifactJob at artifacts.py:153, and
WinArtifactJob's override at :855) from set to tuple. The specific gmp-* pattern is already
written above the general one, so preserving source order is the entire fix. Plus a
TestTestArtifactPatterns regression test, since the failure mode is a wrong destination rather than an
error.
Verified: ./mach python-test python/mozbuild/mozbuild/test/test_artifacts.py gives 15 passed,
./mach format gives 0 problems, and the destination is now stable across PYTHONHASHSEED 0-7.
Landing this only fixes future builds. Anyone with a poisoned ~/.mozbuild/package-frontend cache or an
existing objdir needs a fresh mach artifact install to pick up the relocated .so.
| Assignee | ||
Comment 1•3 months ago
|
||
test_artifact_patterns was a set, but its consumers iterate it and break on the
first matching pattern, and two of its entries overlap: mozpath.match() treats
the trailing * in "bin/plugins/" as matching a whole subtree, so it also
matches the gmp plugin paths that "bin/plugins/gmp-//" is meant to claim.
Which one won therefore depended on set iteration order, i.e. on PYTHONHASHSEED,
which nothing in the build system pins. Roughly 58% of seeds picked the wrong
one.
When that happened, libfake.so and libfakeopenh264.so landed in dist/plugins
instead of dist/bin. test_archive.py only packages GMP plugins from dist/bin, so
the libraries went missing from the test archive while manifest.json and
fakeopenh264.info stayed, those being installed from the source tree. Gecko then
discovered the plugin and advertised H264, and the GMP child process crashed with
MOZ_CRASH(Plugin file does not exist) as soon as anything tried to use it.
Keeping the patterns in source order fixes it, since the specific gmp-* pattern
is already written above the general one.
Updated•3 months ago
|
Comment 3•3 months ago
|
||
| bugherder | ||
Description
•