Unbounded memory growth + log flood when .NET runtime is serviced while FanControl is running (DispatcherUnhandledException retry loop)

Aperta
#4,256 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
desktop

Direzione di ricerca

Start with the DispatcherUnhandledException handler in the application startup code and the NumericUpDown control in FanControl.Views.Controls, where the FileNotFoundException is thrown during construction. Find where Handled = true is set and where the log file rotation happens. Done means a repeated identical dispatcher exception no longer loops forever, and the log stays bounded, as agreed in the maintainer discussion.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug
If the .NET shared runtime FanControl started on is removed by a servicing update while FanControl keeps running, the next lazy assembly load from the UI fails, and FanControl gets stuck in an endless exception/re-layout loop. It never recovers: memory grows without limit, and the log rotates every few seconds.

What happened

  • FanControl V282 (framework-dependent, net10.0) started on 2026-10-17 on Microsoft.NETCore.App 10.0.13.
  • On 2026-10-27, a .NET update installed 10.0.14 and removed the Microsoft.NETCore.App\10.0.13 folder. FanControl kept running.
  • On 2026-11-02, laying out NumericUpDown failed:
Unhandled exception (Application.Current.DispatcherUnhandledException) : System.Windows.Markup.XamlParseException: The invocation of the constructor on type 'FanControl.Views.Controls.NumericUpDown' that matches the specified binding constraints threw an exception.
 ---> System.IO.FileNotFoundException:
File name: 'System.Reflection.Metadata, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at FanControl.Views.Controls.NumericUpDown..ctor()
   ...
   at System.Windows.FrameworkElement.ApplyTemplate()
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.Controls.WrapPanel.MeasureOverride(Size constraint)
  • The exception is handled in DispatcherUnhandledException, WPF measures the control again, and the same exception is thrown again, over and over.
  • After about 25 hours, the process had about 51 GB of private memory on a 48 GB machine. There were 4,391 rotated log files of about 5 MB each (~22 GB), with a new one every ~7 seconds.
  • Restarting FanControl fixes it: it starts on 10.0.14 at ~230 MB with no errors.

Expected behavior
A failure that can't be recovered from, such as a missing runtime assembly (FileNotFoundException/FileLoadException for a framework assembly), should not be swallowed and retried forever. Suggestions:

  • Detect repeated identical dispatcher exceptions and restart the app (or show one prompt to restart) instead of setting Handled = true every time.
  • Throttle or deduplicate logging of the same exception, and cap the total size of the log folder.
  • Optionally, detect that the runtime directory (RuntimeEnvironment.GetRuntimeDirectory()) no longer exists and restart the app.

Environment

  • FanControl V282 (282.0.0.0+76fd5b3f), installed in C:\Program Files (x86)\FanControl, started at logon by a scheduled task
  • Windows 11 Pro 10.0.26200
  • .NET runtimes installed afterwards: NETCore.App 10.0.14, WindowsDesktop.App 10.0.14
Lingua principale
Nessun dato sulla lingua
Stelle
21.1k
Fork
619
Merge medio
12g 8h
PR unite (30g)
2

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Rem0o/FanControl.Releases

Tutte le issue di Rem0o/FanControl.Releases

Issue simili

Altre issue su Desktop Dev

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.