Closed Bug 2054487 Opened 5 days ago Closed 2 days ago

Perma beta/esr toolkit/components/viewsource/test/browser/browser_srcdoc.js | single tracking bug

Categories

(Toolkit :: View Source, defect, P5)

defect

Tracking

()

RESOLVED FIXED
154 Branch
Tracking Status
firefox-esr115 --- affected
firefox-esr140 --- affected
firefox152 --- unaffected
firefox153 + affected
firefox154 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: vhilla)

References

(Regression)

Details

(Keywords: intermittent-failure, intermittent-testcase, regression, Whiteboard: [collect_confirm_failure])

Attachments

(5 files)

Filed by: abutkovits [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=578324792&repo=mozilla-esr140&task=VIvXVCshThS5oPTYeqT4yQ.0
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/VIvXVCshThS5oPTYeqT4yQ/runs/0/artifacts/public/logs/live_backing.log


[task 2026-07-13T11:36:30.799Z] 11:36:30     INFO - TEST-START | toolkit/components/viewsource/test/browser/browser_srcdoc.js
[task 2026-07-13T11:37:15.842Z] 11:37:15     INFO - TEST-INFO | started process screentopng
[task 2026-07-13T11:37:15.994Z] 11:37:15     INFO - TEST-INFO | screentopng: exit 0
[task 2026-07-13T11:37:15.994Z] 11:37:15     INFO - Buffered messages logged at 11:36:30
[task 2026-07-13T11:37:15.994Z] 11:37:15     INFO - Entering test bound 
[task 2026-07-13T11:37:15.995Z] 11:37:15     INFO - Console message: [JavaScript Warning: "This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>”." {file: "data:text/html,<html><iframe srcdoc='<a href="about:mozilla">good</a>' id="f"></iframe></html>" line: 0}]
[task 2026-07-13T11:37:15.995Z] 11:37:15     INFO - Buffered messages finished
[task 2026-07-13T11:37:15.995Z] 11:37:15     INFO - TEST-UNEXPECTED-FAIL | toolkit/components/viewsource/test/browser/browser_srcdoc.js | Test timed out - 
[task 2026-07-13T11:37:15.996Z] 11:37:15     INFO - GECKO(60545) | Completed ShutdownLeaks collections in process 60545
[task 2026-07-13T11:37:15.996Z] 11:37:15     INFO - TEST-START | Shutdown
[task 2026-07-13T11:37:15.997Z] 11:37:15     INFO - Browser Chrome Test Summary
[task 2026-07-13T11:37:15.997Z] 11:37:15     INFO - Passed:  37
[task 2026-07-13T11:37:15.998Z] 11:37:15     INFO - Failed:  1
[task 2026-07-13T11:37:15.998Z] 11:37:15     INFO - Todo:    0
[task 2026-07-13T11:37:15.999Z] 11:37:15     INFO - Mode:    e10s
[task 2026-07-13T11:37:15.999Z] 11:37:15     INFO - *** End BrowserChrome Test Results ***
[task 2026-07-13T11:37:15.999Z] 11:37:15     INFO - GECKO(60545) | [GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
[task 2026-07-13T11:37:16.269Z] 11:37:16     INFO - GECKO(60545) | 1783942636268	Marionette	TRACE	Received observer notification quit-application
[task 2026-07-13T11:37:16.270Z] 11:37:16     INFO - GECKO(60545) | 1783942636268	Marionette	INFO	Stopped listening on port 2828
[task 2026-07-13T11:37:16.298Z] 11:37:16     INFO - GECKO(60545) | 1783942636297	Marionette	DEBUG	Marionette stopped listening
[task 2026-07-13T11:37:16.458Z] 11:37:16     INFO - TEST-INFO | Main app process: exit 0
[task 2026-07-13T11:37:16.459Z] 11:37:16     INFO - TEST-UNEXPECTED-FAIL | toolkit/components/viewsource/test/browser/browser_srcdoc.js | Application shut down (without crashing) in the middle of a test!
[task 2026-07-13T11:37:16.459Z] 11:37:16     INFO - TEST-INFO took 45205ms
[task 2026-07-13T11:37:16.459Z] 11:37:16     INFO - runtests.py | Application ran for: 0:00:56.764721
[task 2026-07-13T11:37:16.460Z] 11:37:16     INFO - zombiecheck | Reading PID log: /tmp/tmp87l3tw9ipidlog
[task 2026-07-13T11:37:16.460Z] 11:37:16     INFO - ==> process 60545 launched child process 60619
[task 2026-07-13T11:37:16.460Z] 11:37:16     INFO - ==> process 60545 launched child process 60625
[task 2026-07-13T11:37:16.461Z] 11:37:16     INFO - ==> process 60545 launched child process 60668
[task 2026-07-13T11:37:16.461Z] 11:37:16     INFO - ==> process 60545 launched child process 60709
[task 2026-07-13T11:37:16.461Z] 11:37:16     INFO - ==> process 60545 launched child process 60721
[task 2026-07-13T11:37:16.462Z] 11:37:16     INFO - ==> process 60545 launched child process 60730
[task 2026-07-13T11:37:16.462Z] 11:37:16     INFO - ==> process 60545 launched child process 60742
[task 2026-07-13T11:37:16.463Z] 11:37:16     INFO - ==> process 60545 launched child process 60755
[task 2026-07-13T11:37:16.463Z] 11:37:16     INFO - ==> process 60545 launched child process 60870
[task 2026-07-13T11:37:16.463Z] 11:37:16     INFO - ==> process 60545 launched child process 60873
[task 2026-07-13T11:37:16.463Z] 11:37:16     INFO - ==> process 60545 launched child process 60877
[task 2026-07-13T11:37:16.464Z] 11:37:16     INFO - ==> process 60545 launched child process 60938
[task 2026-07-13T11:37:16.464Z] 11:37:16     INFO - ==> process 60545 launched child process 60994
[task 2026-07-13T11:37:16.466Z] 11:37:16     INFO - ==> process 60545 launched child process 60997
[task 2026-07-13T11:37:16.466Z] 11:37:16     INFO - ==> process 60545 launched child process 61091
[task 2026-07-13T11:37:16.466Z] 11:37:16     INFO - ==> process 60545 launched child process 61093
[task 2026-07-13T11:37:16.466Z] 11:37:16     INFO - ==> process 60545 launched child process 61157
[task 2026-07-13T11:37:16.467Z] 11:37:16     INFO - zombiecheck | Checking for orphan process with PID: 60994
[task 2026-07-13T11:37:16.467Z] 11:37:16     INFO - zombiecheck | Checking for orphan process with PID: 61091
[task 2026-07-13T11:37:16.467Z] 11:37:16     INFO - zombiecheck | Checking for orphan process with PID: 60709
[task 2026-07-13T11:37:16.468Z] 11:37:16     INFO - zombiecheck | Checking for orphan process with PID: 60742
[task 2026-07-13T11:37:16.468Z] 11:37:16     INFO - zombiecheck | Checking for orphan process with PID: 60870
[task 2026-07-13T11:37:16.468Z] 11:37:16     INFO - zombiecheck | Checking for orphan process with PID: 60997
[task 2026-07-13T11:37:16.469Z] 11:37:16     INFO - zombiecheck | Checking for orphan process with PID: 60873
[task 2026-07-13T11:37:16.469Z] 11:37:16     INFO - zombiecheck | Checking for orphan process with PID: 60938
[task 2026-07-13T11:37:16.470Z] 11:37:16     INFO - zombiecheck | Checking for orphan process with PID: 60619
[task 2026-07-13T11:37:16.471Z] 11:37:16     INFO - zombiecheck | Checking for orphan process with PID: 61093
[task 2026-07-13T11:37:16.471Z] 11:37:16     INFO - zombiecheck | Checking for orphan process with PID: 60877
[task 2026-07-13T11:37:16.471Z] 11:37:16     INFO - zombiecheck | Checking for orphan process with PID: 61157
[task 2026-07-13T11:37:16.471Z] 11:37:16     INFO - zombiecheck | Checking for orphan process with PID: 60625
[task 2026-07-13T11:37:16.471Z] 11:37:16     INFO - zombiecheck | Checking for orphan process with PID: 60721
[task 2026-07-13T11:37:16.471Z] 11:37:16     INFO - zombiecheck | Checking for orphan process with PID: 60755
[task 2026-07-13T11:37:16.471Z] 11:37:16     INFO - zombiecheck | Checking for orphan process with PID: 60730
[task 2026-07-13T11:37:16.472Z] 11:37:16     INFO - zombiecheck | Checking for orphan process with PID: 60668
[task 2026-07-13T11:37:16.472Z] 11:37:16     INFO - Stopping web server
Flags: needinfo?(vhilla)

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

I suspect this shows up as a crash in debug and also applies to esr115.

Summary: Perma esr140 toolkit/components/viewsource/test/browser/browser_srcdoc.js | single tracking bug → Perma beta/esr toolkit/components/viewsource/test/browser/browser_srcdoc.js | single tracking bug

This fails on older branches, but not central due to bug 2041458.

Main https://pernos.co/debug/b5DZHW5UY7CHO1NdLz6Srg/index.html, CheckForIncoherentResultPrincipal calls GetChannelResultPrincipalIfNotSandboxed with a channel whose inner URI is moz-safe-about:srcdoc, so it gets a null principal. In that case, CheckForIncoherentResultPrincipal early-exits.

Beta https://pernos.co/debug/x19Uner9C6ENNZJNSM9K8w/index.html does the same, but without bug 2041458, GenerateOriginNoSuffixFromURI succeeds and we get a view-source:about:srcdoc content principal. CheckForIncoherentResultPrincipal doesn't early exit, we compare that content principal with the loading principal. For a top level load, i.e. view-source, the loading principal is null and checks fail.

See Also: → 2041458

I'm unsure what to do about this.

  • In the current state, view source on any srcdoc will time out in beta and earlier. That might be ok till we have a fix.
  • If we back out bug 2048851 from beta and ESR, view source on data: URIs instead times out. Seems similar in severity.

My current feeling is that my fix from bug 2048851 isn't great. Though the code that was there before also wasn't, see comment. view-source isn't specified, so there likely isn't a "correct" here.

  • LoadPageAsViewSource could set the current document's principal as principal to inherit.
  • Or perhaps we can try to enforce that view-source and its inner channel get a null principal. They don't need to execute script and can be completely sandboxed to be safe. It would be a bit awkward though if the inner channel loads data that belongs to a specific origin while having a null principal. This might be as simple as having LoadPageAsViewSource set the principal to inherit to NullPrincipal rather than null. DoURILoad would then set SEC_FORCE_INHERIT_PRINCIPAL and GetChannelResultPrincipal will return that null principal.
Assignee: nobody → vhilla
Status: NEW → ASSIGNED
Attachment #9608805 - Flags: approval-mozilla-beta?
Flags: needinfo?(vhilla)
Attachment #9608805 - Flags: approval-mozilla-beta?
Status: ASSIGNED → RESOLVED
Closed: 2 days ago
Resolution: --- → FIXED
Target Milestone: --- → 154 Branch

The patch landed in nightly and beta is affected, along with ESR.
:vhilla, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(vhilla)
Attached file test.html

This is covered by tests, but here's also a manual version.

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: Without this, view-source will timeout on srcdoc documents.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: no
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing: See test.html, view source should work for both iframes.
  • Risk associated with taking this patch: low
  • Explanation of risk level: view-source on documents that inherit a principal is perhaps an edge case. I ran tests for the beta branch this time and they passed. It's also a small change and I think we have a good understanding of what it does.
  • String changes made/needed?: No
  • Is Android affected?: yes
Attachment #9610042 - Flags: approval-mozilla-beta?
Attachment #9610048 - Flags: approval-mozilla-esr140?

firefox-esr140 Uplift Approval Request

  • User impact if declined/Reason for urgency: Without this, view-source will timeout on srcdoc documents.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: no
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing: See test.html, view source should work for both iframes.
  • Risk associated with taking this patch: low
  • Explanation of risk level: view-source on documents that inherit a principal is perhaps an edge case. I ran tests for the beta branch this time and they passed. It's also a small change and I think we have a good understanding of what it does.
  • String changes made/needed?: No
  • Is Android affected?: yes
Attachment #9610050 - Flags: approval-mozilla-esr115?

firefox-esr115 Uplift Approval Request

  • User impact if declined/Reason for urgency: Without this, view-source will timeout on srcdoc documents.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: no
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing: See test.html, view source should work for both iframes.
  • Risk associated with taking this patch: low
  • Explanation of risk level: view-source on documents that inherit a principal is perhaps an edge case. I ran tests for the beta branch this time and they passed. It's also a small change and I think we have a good understanding of what it does.
  • String changes made/needed?: No
  • Is Android affected?: yes
Flags: needinfo?(vhilla)
Attachment #9610042 - Flags: approval-mozilla-beta? → approval-mozilla-release?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: