FanControl.Releases icon indicating copy to clipboard operation
FanControl.Releases copied to clipboard

V240 instant crash upon launch

Open iddqdosc opened this issue 1 year ago • 28 comments

If you are experiencing a crash

Event 1025; .NET Runtime

Application: FanControl.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
   at ADLXWrapper.Bindings.ADLXPINVOKE.ADLXExt_GetCurrentMetrics1(System.Runtime.InteropServices.HandleRef, System.Runtime.InteropServices.HandleRef, System.Runtime.InteropServices.HandleRef, ADLXWrapper.GPUMetricsStruct1 ByRef)
   at ADLXWrapper.PerformanceMonitor.GetGPUMetricsStruct1(ADLXWrapper.GPU)
   at FanControl.Domain.BackendProviders.ADLX.GPUMetricsProvider..ctor(ADLXWrapper.PerformanceMonitor, ADLXWrapper.GPU, Boolean)
   at FanControl.Domain.BackendProviders.ADLX.ADLXWrapperBackendProvider.<Open>b__28_5(System.ValueTuple`2<ADLXWrapper.GPU,Int32>)
   at System.Linq.Enumerable+WhereSelectArrayIterator`2[[System.ValueTuple`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
   at System.Linq.Buffer`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]..ctor(System.Collections.Generic.IEnumerable`1<System.__Canon>)
   at System.Linq.Enumerable.ToArray[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>)
   at FanControl.Domain.BackendProviders.ADLX.ADLXWrapperBackendProvider.Open()
   at FanControl.Domain.ComputerAccessLayer.Initialize()
   at FanControl.Bootstrap+<Startup>d__17.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[FanControl.Bootstrap+<Startup>d__17, FanControl, Version=240.0.0.0, Culture=neutral, PublicKeyToken=null]](<Startup>d__17 ByRef)
   at FanControl.Bootstrap.Startup(System.Windows.StartupEventArgs)
   at FanControl.App+<OnStartup>d__3.MoveNext()
   at System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start[[FanControl.App+<OnStartup>d__3, FanControl, Version=240.0.0.0, Culture=neutral, PublicKeyToken=null]](<OnStartup>d__3 ByRef)
   at FanControl.App.OnStartup(System.Windows.StartupEventArgs)
   at System.Windows.Application.<.ctor>b__1_0(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
   at System.Windows.Application.RunDispatcher(System.Object)
   at System.Windows.Application.RunInternal(System.Windows.Window)
   at FanControl.App.Main()
Event 1000, Application Error

Faulting application name: FanControl.exe, version: 240.0.0.0, time stamp: 0x886751e9
Faulting module name: amdadlx64.dll, version: 31.0.24026.1002, time stamp: 0x6618d415
Exception code: 0xc0000005
Fault offset: 0x000000000069e418
Faulting process id: 0x0x4C38
Faulting application start time: 0x0x1DC2A4DD5CC26D1
Faulting application path: M:\Downloads\FanControl_240_net_4_8\FanControl.exe
Faulting module path: C:\Windows\SYSTEM32\amdadlx64.dll
Report Id: 22f62e4e-998b-42eb-bc1e-8a449f128711
Faulting package full name: 
Faulting package-relative application ID: 

Describe the bug I had been using V214 portable without issues since February 2025, until Microsoft Defender flagged FanControl a few days ago.

When I try to run V240, the app crashes instantly on launch, with no visible error message except what’s logged in Event Viewer (see above, Event IDs 1026 and 1000).

I also tested V237 (both portable and installer, both .NET versions), following all PawnIO/.NET installation steps. Defender immediately flags the executable in all cases. If I wipe everything clean, add an exclusion, and try again, the executable is no longer flagged, but the same instant crash occurs.

In short: V214 worked flawlessly for 6 months, but V237 and V240 cannot be opened at all.

Is there a log.txt file next to FanControl.exe with recent date entries? No.

Relevant hardware specs and setup Ryzen 9 7950X AsRock X670E Taichi motherboard 128GB DDR5 Radeon RX 6800XT Taichi (latest PRO edition drivers Windows 11 Pro 22H2 build 22621.3880

Thank you in advance!

iddqdosc avatar Sep 20 '25 17:09 iddqdosc

Looks like C:\Program Files (x86)\FanControl\FanControl.sys is now detected as a virus:

Image

rogerfar avatar Sep 20 '25 17:09 rogerfar

Looks like C:\Program Files (x86)\FanControl\FanControl.sys is now detected as a virus: Image

This is unrelated to V240 and my issue.

iddqdosc avatar Sep 20 '25 17:09 iddqdosc

I have the same issue.

Specs : ASUS ROG B650 Ryzen 5 7600X 32GB DDR5 Radeon RX 6800 XT

Agglow avatar Sep 20 '25 21:09 Agglow

I may have found the problem. Your RX 6XXX series probably doesn't support the iadlxgpumetrics1.

Rem0o avatar Sep 20 '25 22:09 Rem0o

I may have found the problem. Your RX 6XXX series probably doesn't support the iadlxgpumetrics1.

Thank you for the clarification, sir. I don't know what iadlxgpumetrics1 does, but since V214 worked without any issues, I assume this component was introduced in later releases?

iddqdosc avatar Sep 20 '25 23:09 iddqdosc

Yes it added new temp sensors for newer gpus.

Rem0o avatar Sep 21 '25 15:09 Rem0o

just wanted to chime in, I had the exact same issue, and could at least manage to start fancontrol by renaming adlxwrapper.dll to .bak for now

schattenaether-master avatar Sep 22 '25 12:09 schattenaether-master

See V241, confirm if that fixes the issue.

Rem0o avatar Sep 25 '25 14:09 Rem0o

See V241, confirm if that fixes the issue.

Thanks for the update. Unfortunately, I'm still experiencing the same crash. Here are the Event Viewer errors:

Event 1026; .NET Runtime

Application: FanControl.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
   at ADLXWrapper.Bindings.ADLXPINVOKE.ADLXExt_GetCurrentMetrics1(System.Runtime.InteropServices.HandleRef, System.Runtime.InteropServices.HandleRef, System.Runtime.InteropServices.HandleRef, ADLXWrapper.GPUMetricsStruct1 ByRef)
   at ADLXWrapper.PerformanceMonitor.GetGPUMetricsStruct1(ADLXWrapper.GPU)
   at FanControl.Domain.BackendProviders.ADLX.GPUMetricsProvider..ctor(ADLXWrapper.PerformanceMonitor, ADLXWrapper.GPU, Boolean)
   at FanControl.Domain.BackendProviders.ADLX.ADLXWrapperBackendProvider.<Open>b__28_5(System.ValueTuple`2<ADLXWrapper.GPU,Int32>)
   at System.Linq.Enumerable+WhereSelectArrayIterator`2[[System.ValueTuple`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
   at System.Linq.Buffer`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]..ctor(System.Collections.Generic.IEnumerable`1<System.__Canon>)
   at System.Linq.Enumerable.ToArray[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>)
   at FanControl.Domain.BackendProviders.ADLX.ADLXWrapperBackendProvider.Open()
   at FanControl.Domain.ComputerAccessLayer.Initialize()
   at FanControl.Bootstrap+<Startup>d__17.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[FanControl.Bootstrap+<Startup>d__17, FanControl, Version=241.0.0.0, Culture=neutral, PublicKeyToken=null]](<Startup>d__17 ByRef)
   at FanControl.Bootstrap.Startup(System.Windows.StartupEventArgs)
   at FanControl.App+<OnStartup>d__3.MoveNext()
   at System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start[[FanControl.App+<OnStartup>d__3, FanControl, Version=241.0.0.0, Culture=neutral, PublicKeyToken=null]](<OnStartup>d__3 ByRef)
   at FanControl.App.OnStartup(System.Windows.StartupEventArgs)
   at System.Windows.Application.<.ctor>b__1_0(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
   at System.Windows.Application.RunDispatcher(System.Object)
   at System.Windows.Application.RunInternal(System.Windows.Window)
   at FanControl.App.Main()
Event 1000, Application Error

Faulting application name: FanControl.exe, version: 241.0.0.0, time stamp: 0x95ed4c33
Faulting module name: amdadlx64.dll, version: 31.0.24026.1002, time stamp: 0x6618d415
Exception code: 0xc0000005
Fault offset: 0x000000000069e418
Faulting process id: 0x0x1A3C
Faulting application start time: 0x0x1DC2E954940A991
Faulting application path: M:\Downloads\FanControl\FanControl.exe
Faulting module path: C:\Windows\SYSTEM32\amdadlx64.dll
Report Id: a642719f-bf63-4c51-9888-3b0d9cf1087d
Faulting package full name: 
Faulting package-relative application ID: 

iddqdosc avatar Sep 26 '25 03:09 iddqdosc

I got no clue why you still get an access violation. I'm running a RX 7600 myself and I can't get the same crash.

I made this test program to test where/why I think you get this access violation. Run it and it will tell you before it's about to read the gpu data. Hit any key and if you get a crash/access violation right there, we found it.

ADLX_Test_program.zip

Rem0o avatar Sep 26 '25 03:09 Rem0o

Also, are you running the latest version of the driver? 31.0.24026.1002 doesn't seem up to date.

Rem0o avatar Sep 26 '25 04:09 Rem0o

Hi, I'm having similar/same problem. I've run ADLX script

ADLXWrapper Init
Detected GPU: AMD Radeon RX 6750 XT
Supported metrics:
GPU temp: True
GPU total board power: False
GPU fan: True
GPU hotspot: True
GPU Memory temp: True

Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at ADLXWrapper.Bindings.ADLXPINVOKE.IADLXGPUMetricsSupport1_IsSupportedNPUFrequency(HandleRef jarg1, Boolean& jarg2)
   at ADLXWrapper.Bindings.IADLXGPUMetricsSupport1.IsSupportedNPUFrequency(Boolean& supported) in C:\Users\remme\Documents\Github\ADLXWrapper\ADLXWrapper\Bindings\IADLXGPUMetricsSupport1.cs:line 67
   at ADLXWrapper.GPUMetricsSupport1.IsSupportedNPUFrequency() in C:\Users\remme\Documents\Github\ADLXWrapper\ADLXWrapper\GPUMetricsSupport1.cs:line 56
   at ADLXWrapper.TestApp.Program.<DoStuff>d__1.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at ADLXWrapper.TestApp.Program.DoStuff(CompositeDisposable disposables, ADLXWrapper wrapper)
   at ADLXWrapper.TestApp.Program.<Main>d__0.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at ADLXWrapper.TestApp.Program.Main(String[] args)
   at ADLXWrapper.TestApp.Program.<Main>(String[] args)

stribor14 avatar Sep 26 '25 16:09 stribor14

Alright this is mad.

IADLXGPUMetrics is the default metric getter. Now there is a IADLXGPUMetrics1, which is a newer version which added memory temp. You can clearly read that memory temp, so Metrics1 should work. But metrics1 also added NPU stuff. There is a method called IsSupportedNPUFrequency() on that same interface.

However when we call that method, instead of retuning ADLX_NOT_SUPPORTED, it crashes with an access violation. It is as if the actual object underneath is neither IADLXGPUMetrics or IADLXGPUMetrics1, but IADLXGPUMetrics + added memory temp, but that interface doesn't exist in any header file in ADLX.

Rem0o avatar Sep 26 '25 16:09 Rem0o

ADLXWrapperTestapp_2.zip

I slightly tweaked the way we get IADLXGPUMetricsSupport1, see if that goes further.

Rem0o avatar Sep 26 '25 16:09 Rem0o

ADLXWrapper Init
Detected GPU: AMD Radeon RX 6750 XT
Supported metrics:
GPU temp: True
GPU total board power: False
GPU fan: True
GPU hotspot: True
GPU Memory temp: True
NPU frequency: False
NPU activity level: False
NPU is not supported on this GPU, but we will try to read it anyway to see if we get an access violation exception.
Press any key to try and read the NPU activity level.
Caught expected exception: ADLX_NOT_SUPPORTED
Success!
We will now try to read all metrics at once in a struct.
Press any key to try and read struct.
Success!

Press any key to exit

stribor14 avatar Sep 26 '25 17:09 stribor14

library.zip

Alright I've integrated that tweak in a FanControl.Library.dll

Take the 4.8 or 8.0 depending on your install and smack that on top in a copy of your installation.

So copy your fancontrol folder somewhere, put the dlls on top, start that.

See if it FanControl works then.

Rem0o avatar Sep 26 '25 17:09 Rem0o

It opened! Now it doesn't detect my GPU, but at least it works for everything else!

Should I open new issue for that?

Image

stribor14 avatar Sep 26 '25 18:09 stribor14

Do you get any exceptions now in logs.txt? Most likely there is an exception which prevents the detection of your current sensors.

Rem0o avatar Sep 26 '25 19:09 Rem0o

sorry, you can delete previous comment (and this one): I still used old ADLX plugin, and afterwards I realized it wroks with built in now.

When I had problems, I tried fresh installation without any plugin, and your patch worked on a fresh installation. It's just that I immediately returned plugins and configurations from backup.

stribor14 avatar Sep 26 '25 19:09 stribor14

No worries, glad we got it figured out. The "patched" version will make it to the next release. Thanks for testing my shady test builds 😅

Rem0o avatar Sep 26 '25 19:09 Rem0o