Closed Bug 1386826 Opened 2 years ago Closed 2 years ago
Reftest and crashtest doesn't run locally on linux, after sandbox tightening
59 bytes, text/x-review-board-request
2 years ago
Summary: Unable to run reftests locally, after sandbox tightening → Reftest and crashtest doesn't run locally on linux, after sandbox tightening
(In reply to Daniel Holbert [:dholbert] (PTO August 3-7) from comment #0) > "hg bisect" tells me this was a regression from bug 1308400. Specifically, the first-bad build is from this changeset: https://hg.mozilla.org/integration/mozilla-inbound/rev/167f91f87172
In my case, this works when my object dir is within the repo, but when its configured to be outside the repo, the test hangs.
(In reply to Haik Aftandilian [:haik] from comment #2) > In my case, this works when my object dir is within the repo, but when its > configured to be outside the repo, the test hangs. I don't know if it's related to the problem, but I checked with dholbert and he also has the object dir outside the repo (despite the above path "/scratch/work/builds/mozilla-inbound/obj" suggesting otherwise.)
Yes, my objdir is indeed outside of my repo -- I have: source: /scratch/work/builds/mozilla-inbound/mozilla obj: /scratch/work/builds/mozilla-inbound/obj So it's likely that my problem is caused by the whitelist not including objdir-outside-the-repo, as haik suggests.
(I verified that reftests run correctly if I remove my "MOZ_OBJDIR=@TOPSRCDIR@/../obj" line from .mozconfig and rebuild. So indeed, my results match haik's.) (Apparently this doesn't help on Windows, though, per Bug 1386502 comment 10.)
I also have my objdir outside the source dir, and I reproduced this with MOZ_SANDBOX_LOGGING=t: Sandbox: SandboxBroker: denied op=stat rflags=400000 perms=0 path=/home/jld/src/obj.gecko-dev/obj-x86_64-pc-linux-gnu/_tests/reftest/reftest/chrome/reftest/content/reftest-content.js for pid=69071 Sandbox: Failed errno -13 op 2 flags 0400000 path /home/jld/src/obj.gecko-dev/obj-x86_64-pc-linux-gnu/_tests/reftest/reftest/chrome/reftest/content/reftest-content.js Sandbox: SandboxBroker: denied op=access rflags=0 perms=0 path=/home/jld/src/obj.gecko-dev/obj-x86_64-pc-linux-gnu/_tests/reftest/reftest/chrome/reftest/content/reftest-content.js for pid=69071 Sandbox: Failed errno -13 op 1 flags 00 path /home/jld/src/obj.gecko-dev/obj-x86_64-pc-linux-gnu/_tests/reftest/reftest/chrome/reftest/content/reftest-content.js Chrome file doesn't exist: /home/jld/src/obj.gecko-dev/obj-x86_64-pc-linux-gnu/_tests/reftest/reftest/chrome/reftest/content/reftest-content.js I'd suggest just allowing access to all directories in the chrome:// registry, but it looks like it might be nontrivial to extract that information.
(In reply to Jed Davis [:jld] (⏰UTC-6) from comment #6) > I'd suggest just allowing access to all directories in the chrome:// > registry, but it looks like it might be nontrivial to extract that > information. As an alternative, what about using NS_GRE_DIR/../..? (Only on development builds.)
(In reply to Haik Aftandilian [:haik] from comment #7) > As an alternative, what about using NS_GRE_DIR/../..? (Only on development > builds.) If we're going to do things like that then I think I prefer lowering the sandbox to level 2 for these testsuites. I think the fundamental problem here is that the tests need MOZ_DEVELOPER_OBJ_DIR which is currently not used on Linux, meaning that this is also a simple fix, but also meaning we won't be able to get rid of those env vars just yet. Note that this isn't needed for try itself, which is why my test on removing them didn't notice it. (And there was no OBJ_DIR to remove on Linux in the first place.
After some digging, the problem isn't MOZ_DEVELOPER_OBJ_DIR (because Linux doesn't actually rely on those). We need to duplicate: https://hg.mozilla.org/integration/autoland/rev/b57aac875b65 But pointing to the objdir, instead of the repodir. It's possible Linux actually only strictly needs the objdir now that it has symlink handling, but macOS likely needs both (until symlinks are replaced by hardlinks).
Comment on attachment 8898301 [details] Bug 1386826 - Whitelist the objdir, so _tests gets covered. https://reviewboard.mozilla.org/r/169670/#review174890 thanks
Attachment #8898301 - Flags: review?(jmaher) → review+
(In reply to Gian-Carlo Pascutto [:gcp] from comment #9) > It's possible Linux actually only strictly needs the objdir now that it has symlink handling, From the try pushes (which included a variation that removed srcdir handling) this seem not to be true.
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/40a865254b32 Whitelist the objdir, so _tests gets covered. r=jmaher
Depends on: 1392640
You need to log in before you can comment on or make changes to this bug.