[Crash] Fatal CLR error (80131506) previewing any SVG when WebView2 controller creation fails — initialization failure is silently ignored
メンテナーはふだん 4 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
調査の方向性
Start with QuickLook.Plugin.HtmlViewer/WebpagePanel.cs and WebView_CoreWebView2InitializationCompleted, then trace how QuickLook.Plugin.ImageViewer/WebHandler.cs routes SVGs through SvgImagePanel and the ImageMagick fallback. Check how initialization failures are logged and how the existing RenderSvgWeb=false path works. Done means a failed WebView2 initialization is handled safely so SVG preview does not leave a broken control that can crash QuickLook.
索引モデルが issue の本文から書いたものです。
説明
Summary
QuickLook 4.5.0 kills the whole process when pressing Space on any .svg file, if WebView2 CoreWebView2Controller creation fails on the machine. The crash is a fatal CLR internal error (exit code 80131506) triggered by a NULL COM interface pointer marshaled from the half-initialized WebView2 window procedure. It is 100% reproducible for every SVG file on the affected machine.
WebpagePanel.WebView_CoreWebView2InitializationCompleted ignores e.IsSuccess == false completely (no logging, no disposal, no fallback), leaving a broken WebView2 WPF control in the visual tree whose subclassed window proc still receives messages.
Environment
- QuickLook 4.5.0 (both MSI install and Scoop zip build affected)
- Windows 11 24H2 (build 26100), .NET Framework 4.8 (
clr.dll4.8.9266.0) - WebView2 Evergreen Runtime stuck at 100.0.1185.36 (April 2022) — while the bundled WebView2 SDK is 1.0.3912.50 (2025)
RenderSvgWebat its default (true) →.svgrouted toSvgImagePanel(WebView2) instead of the ImageMagick fallback
Steps to reproduce
- Have a WebView2 runtime whose
CreateCoreWebView2ControllerAsyncfails (in our case: severely outdated Evergreen runtime; the failure had been logged asCOMException 0x80040404 E_ABORTrepeatedly for months). - Press Space on any
.svgin Explorer. - QuickLook.exe dies instantly. Other file previews stop working until it is restarted.
Crash signature
Event Log (Application Error 1000 + .NET Runtime 1023), identical across 3 crashes over 7 weeks:
Faulting module: clr.dll 4.8.9266.0
Exception code: 0xC0000005, offset 0x14EB0F
Exit code: 80131506 (fatal CLR error / ExecutionEngineException)
Full-dump analysis (WinDbg + SOS, crash on the main UI thread):
[HelperMethodFrame_1OBJ] System.StubHelpers.InterfaceMarshaler.ConvertToManaged(IntPtr, IntPtr, IntPtr, Int32)
DomainBoundILStubClass.IL_STUB_COMtoCLR(IntPtr, IntPtr, Int32, IntPtr, IntPtr)
[ComMethodFrame]
[InlinedCallFrame] MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame)
System.Windows.Application.RunDispatcher(Object)
QuickLook.App.Main()
--- native frames above ---
user32!CallWindowProcW → EmbeddedBrowserWebView.dll (WebView2 window proc)
The faulting instruction is cmp qword ptr [rax+8], rcx with rax = 0: the COM→CLR marshal stub receives a NULL interface pointer returned from the broken WebView2 window procedure and the CLR dies dereferencing it.
Evidence that controller creation was already failing on this machine — QuickLook.Exception.log (unobserved task exceptions, rethrown by the finalizer):
========8/19/2026 20:09:23======== (and 9/1, 9/2 — 6 E_ABORT occurrences total)
System.AggregateException: A Task's exception(s) were not observed ...
---> System.Runtime.InteropServices.COMException: Operation aborted (Exception from HRESULT: 0x80040404 (E_ABORT))
at Microsoft.Web.WebView2.Core.CoreWebView2Environment.<CreateCoreWebView2ControllerAsync>d__159.MoveNext()
at Microsoft.Web.WebView2.Wpf.WebView2.<InitializeController>d__19.MoveNext()
Root cause
Two layers:
- Machine-level: outdated WebView2 runtime →
CreateCoreWebView2ControllerAsyncaborts. (Fixed on our side by installing the current Evergreen runtime.) - QuickLook robustness bug:
WebpagePanel.WebView_CoreWebView2InitializationCompleted(QuickLook.Plugin.HtmlViewer/WebpagePanel.cs) only acts whene.IsSuccessis true:
protected virtual void WebView_CoreWebView2InitializationCompleted(object sender, CoreWebView2InitializationCompletedEventArgs e)
{
if (e.IsSuccess)
{
_webView.CoreWebView2.AddWebResourceRequestedFilter("*", CoreWebView2WebResourceContext.All);
_webView.CoreWebView2.WebResourceRequested += WebView_WebResourceRequested;
}
// e.IsSuccess == false → silently ignored: no log, no dispose, no fallback
}
WebHandler.TryView has already replaced the ImageMagick render path with SvgImagePanel, so a failed WebView2 init leaves the user with a live-but-broken control that deterministically crashes the process on the next dispatched message.
Suggested fixes
- In
WebView_CoreWebView2InitializationCompleted, handle!e.IsSuccess: log viaProcessHelper.WriteLog, dispose the control, and surface a benign error placeholder instead of the dead control. - For
ImageViewerspecifically: on WebView2 init failure, fall back to the ImageMagick render path (theRenderSvgWeb=falsebranch already exists inWebHandler— reuse it). - Optionally: validate
CoreWebView2Environment.GetAvailableBrowserVersionString()against the minimum runtime version required by the bundled SDK; reuse the existingCreateDownloadButtonUI for "runtime too old" in addition to "runtime missing".
Workaround for affected users
Add to QuickLook.Plugin.ImageViewer.config (portable installs: %APPDATA%\pooi.moe\QuickLook\ or scoop persist dir):
<Settings>
<RenderSvgWeb>False</RenderSvgWeb>
</Settings>
This restores SVG preview via ImageMagick rendering and stops the crash immediately. (Verified on the affected machine.)
Full crash dumps (QuickLook.exe.*.dmp, 3 files) are available if needed.
- 主要言語
- C#
- スター
- 25.7k
- フォーク
- 1.4k
- 平均マージ
- 4日 8分
- マージ済み PR(30日)
- 3
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
QL-Win/QuickLook のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 60/100
QL-Win/QuickLook#2028 · コメント 3 件 ·
メンテナーはふだん 4 日以内に返信
-
[Bug] If the first character entered into the search box is a space, the preview window will close.対応中かも @MORTEM3845 が 14 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
QL-Win/QuickLook#2056 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
WebView2 panels become permanently unavailable until restart (shared UDF + incompatible AdditionalBrowserArguments)対応中かも @Henglie が今日担当しました。 オープンbug
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
メンテナーはふだん 4 日以内に返信
QL-Win/QuickLook の issue をすべて見る
似ている issue
-
needs-triage
難易度 1/5 1〜3時間 初心者へのやさしさ 76/100
Azure/azure-sdk-for-net#64658 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
dotnet/aspnetcore#70370 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NethermindEth/nethermind#15684 ·
メンテナーはふだん 1 日以内に返信
-
area/ai-assistant squad/flyt
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
Altinn/altinn-studio#21798 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
SubtitleEdit/subtitleedit#16699 ·
メンテナーはふだん 1 日以内に返信