Closed Bug 2014565 Opened 9 months ago Closed 8 months ago

Assertion failure: false (Dictionary should be ready before decompression), at /builds/worker/checkouts/gecko/netwerk/streamconv/converters/nsHTTPCompressConv.cpp:70

Categories

(Core :: Networking: Cache, defect, P2)

defect

Tracking

()

RESOLVED FIXED
150 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- unaffected
firefox148 --- unaffected
firefox149 --- wontfix
firefox150 --- fixed

People

(Reporter: tsmith, Assigned: jesup)

References

(Blocks 1 open bug, )

Details

(Keywords: assertion, Whiteboard: [necko-triaged])

Attachments

(2 external files)

Found with m-c 20260204-9b4c9f14356c (--enable-debug)

This was found by visiting a live website with a debug build. I have not been able to repeoduce the issue myself. The assertion was introduced by bug 2013394.

STR:

  • Launch browser and visit site

This issue was triggered by visiting http://www.reuters.com/.

Assertion failure: false (Dictionary should be ready before decompression), at /builds/worker/checkouts/gecko/netwerk/streamconv/converters/nsHTTPCompressConv.cpp:70

0|0|xul.dll|mozilla::net::BrotliWrapper::Init(nsIRequest*)|git:github.com/mozilla-firefox/firefox:netwerk/streamconv/converters/nsHTTPCompressConv.cpp:4960eb24f62c92a9f1b34eefe114e0916fb1e916|70|0x305
0|1|xul.dll|mozilla::net::nsHTTPCompressConv::OnDataAvailable(nsIRequest*, nsIInputStream*, unsigned long long, unsigned int)|git:github.com/mozilla-firefox/firefox:netwerk/streamconv/converters/nsHTTPCompressConv.cpp:4960eb24f62c92a9f1b34eefe114e0916fb1e916|835|0x16b
0|2|xul.dll|mozilla::net::nsHttpChannel::OnDataAvailable(nsIRequest*, nsIInputStream*, unsigned long long, unsigned int)|git:github.com/mozilla-firefox/firefox:netwerk/protocol/http/nsHttpChannel.cpp:4960eb24f62c92a9f1b34eefe114e0916fb1e916|10728|0x59e
0|3|xul.dll|nsInputStreamPump::OnStateTransfer()|git:github.com/mozilla-firefox/firefox:netwerk/base/nsInputStreamPump.cpp:4960eb24f62c92a9f1b34eefe114e0916fb1e916|611|0x41e
0|4|xul.dll|nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream*)|git:github.com/mozilla-firefox/firefox:netwerk/base/nsInputStreamPump.cpp:4960eb24f62c92a9f1b34eefe114e0916fb1e916|432|0xf7
0|5|xul.dll|NS_NewCancelableRunnableFunction<`lambda at /builds/worker/checkouts/gecko/xpcom/io/nsPipe3.cpp:71:35'>::FuncCancelableRunnable::Run()|git:github.com/mozilla-firefox/firefox:xpcom/threads/nsThreadUtils.h:4960eb24f62c92a9f1b34eefe114e0916fb1e916|637|0x26
0|6|xul.dll|mozilla::RunnableTask::Run()|git:github.com/mozilla-firefox/firefox:xpcom/threads/TaskController.cpp:4960eb24f62c92a9f1b34eefe114e0916fb1e916|705|0x1d
0|7|xul.dll|mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex &> const&)|git:github.com/mozilla-firefox/firefox:xpcom/threads/TaskController.cpp:4960eb24f62c92a9f1b34eefe114e0916fb1e916|1325|0x6b4
0|8|xul.dll|mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex &> const&)|git:github.com/mozilla-firefox/firefox:xpcom/threads/TaskController.cpp:4960eb24f62c92a9f1b34eefe114e0916fb1e916|1148|0x57
0|9|xul.dll|mozilla::TaskController::ProcessPendingMTTask(bool)|git:github.com/mozilla-firefox/firefox:xpcom/threads/TaskController.cpp:4960eb24f62c92a9f1b34eefe114e0916fb1e916|641|0x69
0|10|xul.dll|mozilla::detail::RunnableFunction<`lambda at /builds/worker/checkouts/gecko/xpcom/threads/TaskController.cpp:336:7'>::Run()|git:github.com/mozilla-firefox/firefox:xpcom/threads/nsThreadUtils.h:4960eb24f62c92a9f1b34eefe114e0916fb1e916|549|0x16
0|11|xul.dll|nsThread::ProcessNextEvent(bool, bool*)|git:github.com/mozilla-firefox/firefox:xpcom/threads/nsThread.cpp:4960eb24f62c92a9f1b34eefe114e0916fb1e916|1168|0x5d0
0|12|xul.dll|NS_ProcessNextEvent(nsIThread*, bool)|git:github.com/mozilla-firefox/firefox:xpcom/threads/nsThreadUtils.cpp:4960eb24f62c92a9f1b34eefe114e0916fb1e916|461|0x70
0|13|xul.dll|mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*)|git:github.com/mozilla-firefox/firefox:ipc/glue/MessagePump.cpp:4960eb24f62c92a9f1b34eefe114e0916fb1e916|107|0x13c
0|14|xul.dll|MessageLoop::RunHandler()|git:github.com/mozilla-firefox/firefox:ipc/chromium/src/base/message_loop.cc:4960eb24f62c92a9f1b34eefe114e0916fb1e916|366|0x3e
0|15|xul.dll|MessageLoop::Run()|git:github.com/mozilla-firefox/firefox:ipc/chromium/src/base/message_loop.cc:4960eb24f62c92a9f1b34eefe114e0916fb1e916|348|0x6e
0|16|xul.dll|nsBaseAppShell::Run()|git:github.com/mozilla-firefox/firefox:widget/nsBaseAppShell.cpp:4960eb24f62c92a9f1b34eefe114e0916fb1e916|152|0x27
0|17|xul.dll|nsAppShell::Run()|git:github.com/mozilla-firefox/firefox:widget/windows/nsAppShell.cpp:4960eb24f62c92a9f1b34eefe114e0916fb1e916|673|0x17d
0|18|xul.dll|nsAppStartup::Run()|git:github.com/mozilla-firefox/firefox:toolkit/components/startup/nsAppStartup.cpp:4960eb24f62c92a9f1b34eefe114e0916fb1e916|290|0x76
0|19|xul.dll|XREMain::XRE_mainRun()|git:github.com/mozilla-firefox/firefox:toolkit/xre/nsAppRunner.cpp:4960eb24f62c92a9f1b34eefe114e0916fb1e916|5931|0x2010
0|20|xul.dll|XREMain::XRE_main(int, char**, mozilla::BootstrapConfig const&)|git:github.com/mozilla-firefox/firefox:toolkit/xre/nsAppRunner.cpp:4960eb24f62c92a9f1b34eefe114e0916fb1e916|6186|0x759
0|21|xul.dll|XRE_main(int, char**, mozilla::BootstrapConfig const&)|git:github.com/mozilla-firefox/firefox:toolkit/xre/nsAppRunner.cpp:4960eb24f62c92a9f1b34eefe114e0916fb1e916|6259|0xff
0|22|firefox.exe|NS_internal_main(int, char**, char**)|git:github.com/mozilla-firefox/firefox:browser/app/nsBrowserApp.cpp:4960eb24f62c92a9f1b34eefe114e0916fb1e916|532|0x574
0|23|firefox.exe|wmain(int, wchar_t**)|git:github.com/mozilla-firefox/firefox:toolkit/xre/nsWindowsWMain.cpp:4960eb24f62c92a9f1b34eefe114e0916fb1e916|150|0x246
0|24|firefox.exe|__scrt_common_main_seh()|/builds/worker/workspace/obj-build/browser/app/D:/a/_work/1/s/src/vctools/crt/vcstartup/src/startup/exe_common.inl|288|0x10b
Assignee: nobody → rjesup

OnStopRequest and OnCacheEntryAvailable can be called on cache I/O threads
due to CHECK_MULTITHREADED flag, but were accessing shared data without
proper thread safety. This patch adds:

  1. mPendingDictionaryData for accumulating data on cache I/O thread
  2. Atomic flags for mDictionaryDataComplete, mStopReceived, mNotCached
  3. MainThread assertions for methods accessing MainThread-only data
  4. Dispatch to MainThread for hash comparison and cleanup callbacks
  5. Move callback arrays to locals before invoking to avoid races

This refactoring patch (no logic changes):

  1. Makes inline accessor methods non-inline for clarity
  2. Simplify conditional logic in WriteOnHash/UnblockAddEntry
  3. Rename RemoveDictionaryFor->RemoveDictionaryOMT and make RemoveDictionary static
  4. Update comments to reflect threading model
  5. Add diagnostic assertions for unexpected states
  6. Reorder member declarations for clarity
Severity: -- → S3
Priority: -- → P2
Whiteboard: [necko-triaged]
Pushed by rjesup@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/e6fdca4a263c https://hg.mozilla.org/integration/autoland/rev/45033450d81c Fix threading safety issues in Dictionary cache callbacks r=necko-reviewers,valentin https://github.com/mozilla-firefox/firefox/commit/400ec7728792 https://hg.mozilla.org/integration/autoland/rev/0df5b7f9d4c2 Cleanup and refactor Dictionary code after threading fixes r=necko-reviewers,valentin
Pushed by imoraru@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/142bccc54751 https://hg.mozilla.org/integration/autoland/rev/9de03ecc70cf Revert "Bug 2014565: Cleanup and refactor Dictionary code after threading fixes r=necko-reviewers,valentin" for causing leaks related to Dictionary.

Revert for causing leaks related to Dictionary.

Flags: needinfo?(rjesup)
Pushed by rjesup@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/d416aae451c1 https://hg.mozilla.org/integration/autoland/rev/bd6fa1da4b37 Fix threading safety issues in Dictionary cache callbacks r=necko-reviewers,valentin https://github.com/mozilla-firefox/firefox/commit/3cf9210da5e0 https://hg.mozilla.org/integration/autoland/rev/3dcec394ec83 Cleanup and refactor Dictionary code after threading fixes r=necko-reviewers,valentin
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 150 Branch
QA Whiteboard: [qa-triage-done-c151/b150]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: