Open Bug 2085138 Opened 1 month ago Updated 29 days ago

Assertion failure: !IsForceReloadType(loadType) (Should've purged entry in PrepareReloadEntry), at checkouts/gecko/docshell/base/CanonicalBrowsingContext.cpp:618

Categories

(Core :: DOM: Navigation, defect)

defect

Tracking

()

Tracking Status
firefox-esr153 --- unaffected
firefox159 --- wontfix
firefox160 --- wontfix
firefox161 --- fix-optional

People

(Reporter: tsmith, Unassigned)

References

(Blocks 2 open bugs, Regression, )

Details

(4 keywords, Whiteboard: [bugmon:bisected,confirmed])

Attachments

(1 file, 1 external file)

Attached file testcase.html —

Found while fuzzing m-c 20261020-b268695b69da (--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:618

#0 0x7ed8a02fa2d5 in MOZ_CrashSequence /builds/worker/workspace/obj-build/dist/include/mozilla/Assertions.h:261:3
#1 0x7ed8a02fa2d5 in mozilla::dom::CanonicalBrowsingContext::AdoptChildSHEntry(mozilla::Maybe<mozilla::dom::LoadingSessionHistoryInfo>&) /builds/worker/workspace/obj-build/docshell/base/./../../../../checkouts/gecko/docshell/base/CanonicalBrowsingContext.cpp:617:3
#2 0x7ed89f148c89 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:7807:29
#3 0x7ed89f2f613c in mozilla::dom::PContentParent::OnMessageReceived(IPC::Message const&) /builds/worker/workspace/obj-build/dom/ipc/./../../ipc/ipdl/PContentParent.cpp:7994:97
#4 0x7ed89a55b26e 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 0x7ed89a5587f4 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 0x7ed89a5591f7 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 0x7ed89a55a1d9 in mozilla::ipc::MessageChannel::MessageTask::Run() /builds/worker/workspace/obj-build/ipc/glue/./../../../../checkouts/gecko/ipc/glue/MessageChannel.cpp:1614:14
#8 0x7ed89a42b5b7 in mozilla::RunnableTask::Run() /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:756:16
#9 0x7ed89a4204f5 in mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:1401:20
#10 0x7ed89a41eff7 in mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:1221:15
#11 0x7ed89a41f465 in mozilla::TaskController::ProcessPendingMTTask(bool) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:692:36
#12 0x7ed89a42acd6 in operator() /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:380:37
#13 0x7ed89a42acd6 in mozilla::detail::RunnableFunction<mozilla::TaskController::TaskController()::$_0>::Run() /builds/worker/checkouts/gecko/xpcom/threads/nsThreadUtils.h:535:5
#14 0x7ed89a4405b3 in nsThread::ProcessNextEvent(bool, bool*) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/nsThread.cpp:1319:16
#15 0x7ed89a445ebf in NS_ProcessNextEvent(nsIThread*, bool) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/nsThreadUtils.cpp:471:32
#16 0x7ed89a561145 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /builds/worker/workspace/obj-build/ipc/glue/./../../../../checkouts/gecko/ipc/glue/MessagePump.cpp:83:21
#17 0x7ed89a4bc4b1 in RunHandler /builds/worker/workspace/obj-build/ipc/chromium/./../../../../checkouts/gecko/ipc/chromium/src/base/message_loop.cc:371:3
#18 0x7ed89a4bc4b1 in MessageLoop::Run() /builds/worker/workspace/obj-build/ipc/chromium/./../../../../checkouts/gecko/ipc/chromium/src/base/message_loop.cc:353:3
#19 0x7ed89f9e33b8 in nsBaseAppShell::Run() /builds/worker/workspace/obj-build/widget/./../../../checkouts/gecko/widget/nsBaseAppShell.cpp:151:27
#20 0x7ed89fac8754 in nsAppShell::Run() /builds/worker/workspace/obj-build/widget/gtk/./../../../../checkouts/gecko/widget/gtk/nsAppShell.cpp:581:33
#21 0x7ed8a0a5ecb3 in nsAppStartup::Run() /builds/worker/workspace/obj-build/toolkit/components/startup/./../../../../../checkouts/gecko/toolkit/components/startup/nsAppStartup.cpp:308:30
#22 0x7ed8a0bbfbea in XREMain::XRE_mainRun() /builds/worker/checkouts/gecko/toolkit/xre/nsAppRunner.cpp:6550:22
#23 0x7ed8a0bc11a5 in XREMain::XRE_main(int, char**, mozilla::BootstrapConfig const&) /builds/worker/checkouts/gecko/toolkit/xre/nsAppRunner.cpp:6802:8
#24 0x7ed8a0bc1c82 in XRE_main(int, char**, mozilla::BootstrapConfig const&) /builds/worker/checkouts/gecko/toolkit/xre/nsAppRunner.cpp:6875:21
#25 0x573fd108626a in do_main /builds/worker/checkouts/gecko/browser/app/nsBrowserApp.cpp:271:22
#26 0x573fd108626a in main /builds/worker/checkouts/gecko/browser/app/nsBrowserApp.cpp:542:16

This has also been reported via live site testing

Verified bug as reproducible on mozilla-central 20261022214940-bbbd29a03fc7.
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

Keywords: regression
Whiteboard: [bugmon:bisected,confirmed]
Regressed by: 2037346

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.

Flags: needinfo?(vhilla)

I guess location.reload(true) sends NotifyOnHistoryReload which purges child SH entries. Then we continue parsing, load an initial about:blank and send SetActiveSessionHistoryEntry for it, create a new child entry. Then the new top document starts loading and we send AdoptChildSHEntry, hitting the assert. Non-blank iframes probably take longer and get stopped before they commit their entry.

That seems harmless but it's breaking the assumption behind the assert.

  • We could drop the assert and accept the race, AdoptChildSHEntry removes the entry anyway. But the assert already led to the discovery and fix of another bug 2075414.
  • Somehow prevent subframes from loading, either fire STOP_ALL earlier or check whether the parent has a pending force reload.
  • Claude suggests to move RemoveFrameEntries from PrepareReloadEntry to SessionHistoryCommit. Purging entries when we commit to the reload rather than when we start it seems good.
Flags: needinfo?(vhilla)
Severity: -- → S4

(In reply to Vincent Hilla [:vhilla] from comment #4)

  • Claude suggests to move RemoveFrameEntries from PrepareReloadEntry to SessionHistoryCommit. Purging entries when we commit to the reload rather than when we start it seems good.

https://treeherder.mozilla.org/jobs?repo=try&revision=bc64e451006e19a7908fc43956c47fee44fed663

  • docshell/test/navigation/browser_ghistorymaxsize_is_0.js
  • docshell/test/navigation/test_bug1536471.html
  • docshell/test/navigation/test_shiftReload_and_pushState.html
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: