Navigating an iframe during the parents load event might instead restore the iframes SH entry if parent IsLoadingFromSessionHistory
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr153 | --- | unaffected |
| firefox157 | --- | unaffected |
| firefox158 | --- | wontfix |
| firefox159 | --- | wontfix |
| firefox160 | --- | verified |
People
(Reporter: tsmith, Assigned: vhilla)
References
(Blocks 3 open bugs, Regression, )
Details
(4 keywords, Whiteboard: [bugmon:bisected,confirmed], [wptsync upstream])
Attachments
(1 file, 1 external file, 1 obsolete file)
|
180 bytes,
text/html
|
Details |
Found while fuzzing m-c 20260921-f1cfb0e0b987 (--enable-debug --enable-fuzzing)
To reproduce via Grizzly Replay:
$ pip install fuzzfetch grizzly-framework --upgrade
$ python -m fuzzfetch -d --fuzzing -n firefox
$ python -m grizzly.replay.bugzilla ./firefox/firefox <bugid>
Assertion failure: !IsForceReloadType(loadType) (Should've purged entry in PrepareReloadEntry), at checkouts/gecko/docshell/base/CanonicalBrowsingContext.cpp:616
#0 0x7fffe6b668d5 in MOZ_CrashSequence /builds/worker/workspace/obj-build/dist/include/mozilla/Assertions.h:261:3
#1 0x7fffe6b668d5 in mozilla::dom::CanonicalBrowsingContext::AdoptChildSHEntry(mozilla::Maybe<mozilla::dom::LoadingSessionHistoryInfo>&) /builds/worker/workspace/obj-build/docshell/base/./../../../../checkouts/gecko/docshell/base/CanonicalBrowsingContext.cpp:615:3
#2 0x7fffe59d8db9 in mozilla::dom::ContentParent::RecvAdoptChildSHEntry(mozilla::dom::MaybeDiscarded<mozilla::dom::BrowsingContext> const&, std::function<void (mozilla::Maybe<mozilla::dom::LoadingSessionHistoryInfo> const&)>&&) /builds/worker/workspace/obj-build/dom/ipc/./../../../../checkouts/gecko/dom/ipc/ContentParent.cpp:7768:29
#3 0x7fffe5b83508 in mozilla::dom::PContentParent::OnMessageReceived(IPC::Message const&) /builds/worker/workspace/obj-build/dom/ipc/./../../ipc/ipdl/PContentParent.cpp:7846:97
#4 0x7fffe0dcb00e in mozilla::ipc::MessageChannel::DispatchAsyncMessage(mozilla::ipc::ActorLifecycleProxy*, IPC::Message const&) /builds/worker/workspace/obj-build/ipc/glue/./../../../../checkouts/gecko/ipc/glue/MessageChannel.cpp:1797:25
#5 0x7fffe0dc8594 in mozilla::ipc::MessageChannel::DispatchMessage(mozilla::ipc::ActorLifecycleProxy*, std::unique_ptr<IPC::Message, std::default_delete<IPC::Message>>) /builds/worker/workspace/obj-build/ipc/glue/./../../../../checkouts/gecko/ipc/glue/MessageChannel.cpp:1723:9
#6 0x7fffe0dc8f97 in mozilla::ipc::MessageChannel::RunMessage(mozilla::ipc::ActorLifecycleProxy*, mozilla::ipc::MessageChannel::MessageTask&) /builds/worker/workspace/obj-build/ipc/glue/./../../../../checkouts/gecko/ipc/glue/MessageChannel.cpp:1512:3
#7 0x7fffe0dc9f79 in mozilla::ipc::MessageChannel::MessageTask::Run() /builds/worker/workspace/obj-build/ipc/glue/./../../../../checkouts/gecko/ipc/glue/MessageChannel.cpp:1614:14
#8 0x7fffe0c9d9f7 in mozilla::RunnableTask::Run() /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:721:16
#9 0x7fffe0c92975 in mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:1367:20
#10 0x7fffe0c914d7 in mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:1190:15
#11 0x7fffe0c91945 in mozilla::TaskController::ProcessPendingMTTask(bool) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:657:36
#12 0x7fffe0c9d116 in operator() /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:349:37
#13 0x7fffe0c9d116 in mozilla::detail::RunnableFunction<mozilla::TaskController::TaskController()::$_0>::Run() /builds/worker/checkouts/gecko/xpcom/threads/nsThreadUtils.h:535:5
#14 0x7fffe0cb2973 in nsThread::ProcessNextEvent(bool, bool*) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/nsThread.cpp:1319:16
#15 0x7fffe0cb824f in NS_ProcessNextEvent(nsIThread*, bool) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/nsThreadUtils.cpp:471:32
#16 0x7fffe0dd0ee5 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /builds/worker/workspace/obj-build/ipc/glue/./../../../../checkouts/gecko/ipc/glue/MessagePump.cpp:83:21
#17 0x7fffe0d2baa1 in RunHandler /builds/worker/workspace/obj-build/ipc/chromium/./../../../../checkouts/gecko/ipc/chromium/src/base/message_loop.cc:364:3
#18 0x7fffe0d2baa1 in MessageLoop::Run() /builds/worker/workspace/obj-build/ipc/chromium/./../../../../checkouts/gecko/ipc/chromium/src/base/message_loop.cc:346:3
#19 0x7fffe6261958 in nsBaseAppShell::Run() /builds/worker/workspace/obj-build/widget/./../../../checkouts/gecko/widget/nsBaseAppShell.cpp:151:27
#20 0x7fffe6344404 in nsAppShell::Run() /builds/worker/workspace/obj-build/widget/gtk/./../../../../checkouts/gecko/widget/gtk/nsAppShell.cpp:580:33
#21 0x7fffe7283b24 in nsAppStartup::Run() /builds/worker/workspace/obj-build/toolkit/components/startup/./../../../../../checkouts/gecko/toolkit/components/startup/nsAppStartup.cpp:308:30
#22 0x7fffe73d9efa in XREMain::XRE_mainRun() /builds/worker/checkouts/gecko/toolkit/xre/nsAppRunner.cpp:6495:22
#23 0x7fffe73db4b5 in XREMain::XRE_main(int, char**, mozilla::BootstrapConfig const&) /builds/worker/checkouts/gecko/toolkit/xre/nsAppRunner.cpp:6747:8
#24 0x7fffe73dbf92 in XRE_main(int, char**, mozilla::BootstrapConfig const&) /builds/worker/checkouts/gecko/toolkit/xre/nsAppRunner.cpp:6820:21
#25 0x5555555dc30a in do_main /builds/worker/checkouts/gecko/browser/app/nsBrowserApp.cpp:271:22
#26 0x5555555dc30a in main /builds/worker/checkouts/gecko/browser/app/nsBrowserApp.cpp:542:16
| Reporter | ||
Comment 1•2 months ago
|
||
This has also been detected via live site testing.
Comment 2•2 months ago
|
||
Verified bug as reproducible on mozilla-central 20260924164300-39878598097d.
The bug appears to have been introduced in the following build range:
Start: 33fb450f38182272074552a7ae639b8b7fa9eb49 (20260921071029)
End: f52f9d0d4f1b153a0d6d2bbefcb48ec274498e8b (20260921085140)
Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=33fb450f38182272074552a7ae639b8b7fa9eb49&tochange=f52f9d0d4f1b153a0d6d2bbefcb48ec274498e8b
Comment 3•2 months ago
|
||
Set release status flags based on info from the regressing bug 2037346
:vhilla, since you are the author of the regressor, bug 2037346, could you take a look? Also, could you set the severity field?
For more information, please visit BugBot documentation.
Comment 4•1 month ago
|
||
Simon, this may be of your interest, too. Thanks.
I'd also appreciate the severity confirmation - does S3 look right given that it's not a production visible, while it still warrants a bit deeper dive as it's introduced by a recent change?
| Assignee | ||
Comment 5•1 month ago
|
||
There was a pre-existing issue here: location.reload(true) caused srcdoc not to appear and not to have a SH entry. Part 1 D323222 means that also happens on browser UI force reload, part 3 D299053 means it happens for normal reload too. Interestingly, the srcdoc content does appear on Nightly but there is still no SH entry.
| Assignee | ||
Comment 6•1 month ago
•
|
||
This creates quite weird states because the iframe can be navigated but we won't create SH entries for it. When the assertion occurs, the entry URI is about:blank.
I wonder where that entry comes from, I guess it's an initial about:blank load on the iframe.
| Assignee | ||
Comment 7•1 month ago
•
|
||
Doing a.src = "about:blank" instead of a.srcdoc = "x" in onload has the same effect. I guess we start an iframe load during the parent load handler, so MaybeHandleSubframeHistory sees ...parentDS.get())->IsLoadingFromSessionHistory() being true. That's a pre-existing issue though and I don't yet understand why we don't just continue with AdoptChildSHEntry, don't return an entry, continue the load and get a new SH entry.
Updated•1 month ago
|
| Assignee | ||
Comment 8•1 month ago
|
||
(In reply to Vincent Hilla [:vhilla] from comment #6)
I wonder where that entry comes from, I guess it's an initial
about:blankload on the iframe.
Claude says the issue with the second load taking the SH part is then that AdoptChildSHEntry clears that child entry, but doesn't clear mActiveEntry on the child BC. Usually with reloads, the child BC wouldn't have an entry yet, but in this case, we incorrectly treat this second load as a load from SH. SessionHistoryCommit would then go through NotTop: Adding entry with an active entry and add an entry to the detached current entry.
| Assignee | ||
Comment 9•1 month ago
•
|
||
So there was a pre-existing issue, but instead of a.srcdoc='a' adopting the initial about:blank entry from SH and not loading srcdoc, we now load srcdoc but are left without SH entry. Other loads should have similar issues.
To hit this regression, we need an initial about:blank and navigate it during the parent load handler, then reload (or force-reload in Beta/Release where docshell.shistory.restoreSubframesOnReload=true).
I think S3 is fine, but I'm unsure how to fix it.
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Comment hidden (Intermittent Failures Robot) |
| Assignee | ||
Comment 11•1 month ago
|
||
Maybe we can check for OriginalFrameSrc. Try: https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=103370
| Assignee | ||
Comment 12•1 month ago
|
||
Updated•1 month ago
|
Updated•1 month ago
|
| Comment hidden (obsolete) |
| Assignee | ||
Comment 14•1 month ago
|
||
Comment 15•1 month ago
|
||
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/63604 for changes under testing/web-platform/tests
Comment 17•1 month ago
|
||
| bugherder | ||
Updated•1 month ago
|
Upstream PR merged by moz-wptsync-bot
Comment 19•1 month ago
|
||
Verified bug as fixed on rev mozilla-central 20261013160609-5a4718f5221d.
Successfully recorded a pernosco session. A link to the pernosco session will be added here shortly.
Removing bugmon keyword as no further action possible. Please review the bug and re-add the keyword for further analysis.
Comment 20•1 month ago
|
||
A pernosco session for this bug can be found here.
Comment 21•1 month ago
|
||
Updated•1 month ago
|
Updated•7 days ago
|
Description
•