Closed Bug 1836825 Opened 2 years ago Closed 2 years ago

DevTools fails to load with gray window when opened from `./mach wpt`

Categories

(DevTools :: General, defect)

defect

Tracking

(firefox116 fixed)

RESOLVED FIXED
116 Branch
Tracking Status
firefox116 --- fixed

People

(Reporter: saschanaz, Assigned: saschanaz)

References

Details

Attachments

(1 file)

Thank you for helping make Firefox better. If you are reporting a defect, please complete the following:

What were you doing?

Please tell us what site you were on, and what steps led to the error you are reporting

  1. Run ./mach wpt /html/semantics/disabled-elements/event-propagate-disabled.tentative.html on Windows non-artifact local build
  2. Open DevTools
  3. See it opens

What happened?

This error consistently happens when opening DevTools:

 4:50.48 pid:836 JavaScript error: resource://devtools/shared/loader/base-loader.sys.mjs, line 192: Error: Module `resource://devtools/shared/loader/builtin-modules.js` is not found at resource://devtools/shared/loader/builtin-modules.js

What should have happened?

It should open without errors

Anything else we should know?

This is regressed for a fair amount of time but I never cared much to bisect. 🙄

Thanks for filing,

Can you share your mozconfig file here? You also mention this breaks on non-artifact, does it mean it works on artifact builds.
If you run Firefox and open devtools there is no issue either?

Thanks

Flags: needinfo?(krosylight)
mk_add_options AUTOCLOBBER=1
ac_add_options --disable-optimize

I did not try artifact builds, I just wanted to be as specific as possible. And yes it works when running ./mach run.

Flags: needinfo?(krosylight)

Thanks for checking, nothing of odd in this mozconfig file.
This sounds like a build/packaging issue, because there's no reason a build would have devtools/shared/loader/base-loader.sys.mjs but not devtools/shared/loader/builtin-modules.js

Is there any way ./mach wpt could be using another binary than the one you use when doing ./mach run?

If you try to hit resource://devtools/shared/loader/builtin-modules.js in a tab of the browser which was opened for ./mach wpt does it load a file (trying to see if this would be a loader issue).

Flags: needinfo?(krosylight)

(In reply to Julian Descottes [:jdescottes] from comment #3)

Is there any way ./mach wpt could be using another binary than the one you use when doing ./mach run?

I doubt that's the case, about:support shows the same binary: \obj-x86_64-pc-windows-msvc\dist\bin\firefox.exe.

If you try to hit resource://devtools/shared/loader/builtin-modules.js in a tab of the browser which was opened for ./mach wpt does it load a file (trying to see if this would be a loader issue).

Interestingly:

Access to the file was denied

The file at /C:/Users/sasch/Documents/GitHub/gecko-dev/obj-x86_64-pc-windows-msvc/dist/bin/browser/chrome/devtools/modules/devtools/shared/loader/builtin-modules.js is not readable.

    It may have been removed, moved, or file permissions may be preventing access.

But the path exist (as a symlink to devtools/shared/loader/builtin-modules.js), so I'm confused. This doesn't happen on ./mach run, maybe some different sandbox rule is applied for WPT?

Flags: needinfo?(krosylight)

I wonder if the fact that Firefox is started from the wptrunner in this case means it could have different permissions than when you run it from ./mach run. And it's also puzzling that this would only be an issue for builtin-modules.js but not for base-loader.sys.mjs. Could it be related to the extension of the file?

Mike, is this a known issue on windows, where certain files can't be accessed even when other files in the same folder are loaded just fine?

Flags: needinfo?(mh+mozilla)

Kagami, could you try to load two additional paths, same as what you did for comment 4:

  • resource://devtools/shared/loader/Loader.sys.mjs
  • resource://devtools/shared/loader/browser-loader.js

Could you also try to set the following env variable MOZ_DISABLE_CONTENT_SANDBOX=1 to see if it helps

Flags: needinfo?(krosylight)

No file in resource://devtools/ is accessible through the address bar, including base-loader.sys.mjs. Disabling the sandbox helps and also allows devtools to open.

I guess I need to bisect...

Flags: needinfo?(krosylight)

Did not bisect because of build issues, but it seems AddDeveloperRepoDirToPolicy fails because of the lack of environment variable: https://searchfox.org/mozilla-central/rev/fb55a4ee44a9a95d099aa806ca494eb988252ded/security/sandbox/win/src/sandboxbroker/sandboxBroker.cpp#246-250, on WPT but not on ./mach run.

Hello Bob and James, do you know why WPT is not getting env var for the sandbox rule? Maybe either WPT or sandbox started doing something special?

Flags: needinfo?(james)
Flags: needinfo?(bobowencode)

But then how can this not happen on macOS but only on Windows? 🤔

(In reply to Kagami [:saschanaz] from comment #10)

But then how can this not happen on macOS but only on Windows? 🤔

FWIW, Nicolas from the team tested this on Windows and didn't reproduce the issue.

(In reply to Julian Descottes [:jdescottes] from comment #11)

(In reply to Kagami [:saschanaz] from comment #10)

But then how can this not happen on macOS but only on Windows? 🤔

FWIW, Nicolas from the team tested this on Windows and didn't reproduce the issue.

Can you check whether Nicolas enabled Developer Mode on Windows, which enables symlink support?

Flags: needinfo?(jdescottes)

(per discussion on Matrix, Nicolas also tried after enabling this, but could not reproduce)

Flags: needinfo?(jdescottes)

(In reply to Kagami [:saschanaz] from comment #9)

Did not bisect because of build issues, but it seems AddDeveloperRepoDirToPolicy fails because of the lack of environment variable: https://searchfox.org/mozilla-central/rev/fb55a4ee44a9a95d099aa806ca494eb988252ded/security/sandbox/win/src/sandboxbroker/sandboxBroker.cpp#246-250, on WPT but not on ./mach run.

Hello Bob and James, do you know why WPT is not getting env var for the sandbox rule? Maybe either WPT or sandbox started doing something special?

I don't think there's been a sandbox change to affect this and it seems from comment 10 that this doesn't affect Windows.

Flags: needinfo?(bobowencode)

Not sure why Linux is okay without this, but this feels right.

(macOS does not depend on MOZ_DEVELOPER_REPO_DIR since https://bugzilla.mozilla.org/show_bug.cgi?id=1380690)

Assignee: nobody → krosylight
Status: NEW → ASSIGNED
Attachment #9339083 - Attachment description: Bug 1836825 - Set MOZ_DEVELOPER_REPO_DIR in mozrunner.test_environment() r=jgraham → Bug 1836825 - Set MOZ_DEVELOPER_REPO/OBJ_DIR in mozrunner.test_environment() r=jgraham
Attachment #9339083 - Attachment description: Bug 1836825 - Set MOZ_DEVELOPER_REPO/OBJ_DIR in mozrunner.test_environment() r=jgraham → Bug 1836825 - Set MOZ_DEVELOPER_REPO_DIR in mozrunner.test_environment() r=jgraham
See Also: → 1838481
Attachment #9339083 - Attachment description: Bug 1836825 - Set MOZ_DEVELOPER_REPO_DIR in mozrunner.test_environment() r=jgraham → Bug 1836825 - Set MOZ_DEVELOPER_REPO_DIR in mozrunner.test_environment() r=#firefox-build-system-reviewers
Flags: needinfo?(mh+mozilla)
Pushed by krosylight@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/762fe7706638 Set MOZ_DEVELOPER_REPO_DIR in mozrunner.test_environment() r=gbrown
Flags: needinfo?(james)
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 116 Branch
QA Whiteboard: [qa-116b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: