Rem0o / FanControl.Releases

This is the release repository for Fan Control, a highly customizable fan controlling software for Windows.
Other
14.3k stars 450 forks source link

Not responding and unable to End Task after waking PC (Windows10) up from Sleep (v177) #2249

Open vdumitrache opened 9 months ago

vdumitrache commented 9 months ago

image

Sometimes after waking PC up from Sleep, the application is Not Responding, and I am unable to even End Task from task manager.

andersmelander commented 9 months ago

I too have this problem; After resume from sleep the main window can be opened via the tray icon but the window is empty (no controls, speeds, or curves), and does not respond to input; The window is completely frozen and can't even be moved or resized. Nothing of interest (I assume) in the log file and nothing in the eventlog. This is the entry in the log file:

26-01-2024 07:29:20: NvAPIWrapper.Native.Exceptions.NVIDIAApiException: NVAPI_ERROR
   at NvAPIWrapper.Native.GPUApi.GetThermalSettings(PhysicalGPUHandle physicalGPUHandle, ThermalSettingsTarget sensorTarget)
   at NvAPIWrapper.GPU.GPUThermalInformation.get_ThermalSensors()
   at FanControl.Domain.BackendProviders.NVApiWrapper.NVApiTempSensor.Update()
   at FanControl.Domain.BackendProviders.NVApiWrapper.NVApiWrapperBackendProvider.Update()

After I kill the process with Process Explorer and restart FanControl everything is running as normal - until the next sleep/resume.

Process Explorer shows me this call stack for one of the threads. It looks relevant:

win32u.dll!NtUserMsgWaitForMultipleObjectsEx+0x14
USER32.dll!MsgWaitForMultipleObjectsEx+0x9e
combase.dll!CoMarshalInterface+0x9b09
combase.dll!Ordinal87+0x13d5
combase.dll!CoWaitForMultipleHandles+0x76
clr.dll!IEE+0x633e
clr.dll!CoUninitializeEE+0x33984
clr.dll!CoUninitializeEE+0x33661
clr.dll!TranslateSecurityAttributes+0xafbb6
[Managed to Unmanaged Transition]
C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll!System.Windows.Threading.DispatcherSynchronizationContext.Wait+0x2a
[Unmanaged to Managed Transition]
clr.dll!DllCanUnloadNowInternal+0x5813
clr.dll!StrongNameTokenFromPublicKey+0x3a6fb
clr.dll!CoUninitializeEE+0x1b3ba
clr.dll!CorLaunchApplication+0x4db9
clr.dll!ParseManifest+0x19fe4f
clr.dll!CoUninitializeEE+0x33661
clr.dll!StrongNameTokenFromPublicKey+0x14237
clr.dll!TranslateSecurityAttributes+0xa269e
clr.dll!TranslateSecurityAttributes+0xa2552
clr.dll!ParseManifest+0x1fae19
clr.dll!SetRuntimeInfo+0x1169
0x0000000000000000
[Managed to Unmanaged Transition]
D:\Tools\FanControl\FanControl.Library.dll!FanControl.Domain.ComputerAccessLayer.Close+0x5e
D:\Tools\FanControl\FanControl.exe!FanControl.Bootstrap.SystemEvents_PowerModeChanged+0x74
[Unmanaged to Managed Transition]
clr.dll!DllCanUnloadNowInternal+0x5813
clr.dll!StrongNameTokenFromPublicKey+0x3a6fb
clr.dll!StrongNameTokenFromPublicKey+0x52852
clr.dll!StrongNameTokenFromPublicKey+0x52c67
[Managed to Unmanaged Transition]
C:\WINDOWS\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll!System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal+0xd8
C:\WINDOWS\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll!System.Delegate.DynamicInvokeImpl+0xa0
C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll!SystemEventInvokeInfo.InvokeCallback+0x26
C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall+0xfd
C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen+0x36
C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl+0x172
C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll!System.Windows.Threading.DispatcherSynchronizationContext.Send+0x84
C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll!SystemEventInvokeInfo.Invoke+0xa0
C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll!Microsoft.Win32.SystemEvents.RaiseEvent+0x12e
C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll!Microsoft.Win32.SystemEvents.OnPowerModeChanged+0xd3
C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll!Microsoft.Win32.SystemEvents.WindowProc+0x23c
[Unmanaged to Managed Transition]
[Native Frame: IL Method without Metadata]
clr.dll!DllCanUnloadNowInternal+0x41ee
USER32.dll!CallWindowProcW+0x3f8
USER32.dll!DispatchMessageW+0x39c
USER32.dll!InitDManipHook+0x58a
ntdll.dll!KiUserCallbackDispatcher+0x24
win32u.dll!NtUserGetMessage+0x14
USER32.dll!GetMessageW+0x2e
[Native Frame: IL Method without Metadata]
[Managed to Unmanaged Transition]
C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll!MS.Win32.UnsafeNativeMethods.GetMessageW+0x12
C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll!System.Windows.Threading.Dispatcher.GetMessage+0x68
C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl+0xaf
C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll!System.Windows.Application.RunDispatcher+0x71
C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll!System.Windows.Application.RunInternal+0x8c
D:\Tools\FanControl\FanControl.exe!FanControl.App.Main+0x42
[Unmanaged to Managed Transition]
clr.dll!DllCanUnloadNowInternal+0x5813
clr.dll!StrongNameTokenFromPublicKey+0x3a6fb
clr.dll!CoUninitializeEE+0x1b3ba
clr.dll!CreateAssemblyNameObject+0x10715
clr.dll!CreateAssemblyNameObject+0x1041e
clr.dll!CreateAssemblyNameObject+0x101b5
clr.dll!CreateAssemblyNameObject+0x1110f
clr.dll!CreateAssemblyNameObject+0x111fd
clr.dll!CorExeMain+0x14
mscoreei.dll!CorExeMain+0xfa
MSCOREE.DLL!CorExeMain+0x72
KERNEL32.dll!BaseThreadInitThunk+0x14
ntdll.dll!RtlUserThreadStart+0x21
l-currie commented 8 months ago

I am also getting this issue on Windows 10. The custom fan settings, unfortunately, stop working for me when this happens. I need to kill the task in Task Manager and then relaunch it.

andersmelander commented 8 months ago

I'm now using Windows Task Scheduler to work around this problem since it gets pretty old having to kill and restart FanControl 10-15 times a day.

A) In Task Scheduler create a new task:

B) Modify the existing FanControl task (the one that starts FanControl at login). If it doesn't exist, create a new one.

JS-E commented 8 months ago

Yeah i have this too :/ Even after i kill it it seems to have a problem reading the speeds and controlling fans

ericswpark commented 4 months ago

Same issue here on V193. FanControl freezes, and while the main menu shows up nothing inside is populated:

image

The window is not draggable, and none of the options inside are clickable.

Right-clicking on the taskbar icon brings up the context menu, but again it is not interactable, and the menu does not go away when clicking outside of it:

image

PawSan commented 4 months ago

+1

andersmelander commented 3 months ago

I'm now using Windows Task Scheduler to work around this problem since it gets pretty old having to kill and restart FanControl 10-15 times a day.

billede billede

Rem0o commented 3 months ago

Task killing the process won't tell explorer to remove the tray icons.

andersmelander commented 3 months ago

Yes, I know. This was just a friendly reminder that this problem still exist and the work-around I outlined above doesn't always work.

Rem0o commented 3 months ago

Are you on V196? Is the problem still you get a non-responding process?

andersmelander commented 3 months ago

I'm always on the latest release whatever that is (AFK right now). Symptoms are as described above. Let me know if there's any additional info I can give you.

tpill90 commented 2 months ago

@andersmelander I took some time (longer than I'd like to admit...) to get your above fix scripted out via Powershell. Hopefully it should help make it easier for anyone else to get this fix setup with a quick copy + paste. I'll paste it below :

$pathToFancontrolExe = "C:\Replace\With\Your\Path\To\FanControl.exe"

# Initialize com service
$scheduleService = New-Object -ComObject schedule.service
$scheduleService.Connect()
$rootFolder = $scheduleService.GetFolder("\")

# Configuring job to stop FanControl on sleep
$stopFancontrolTask = $scheduleService.NewTask(0)
$stopFancontrolTask.RegistrationInfo.Description = ''
$stopFancontrolTask.Settings.Enabled = $True
$stopFancontrolTask.Settings.AllowDemandStart = $True

$trigger1 = $stopFancontrolTask.triggers.Create(0)
$trigger1.Enabled = $true
$trigger1.Id = '187'
$trigger1.Subscription = "<QueryList><Query Id='0' Path='System'><Select Path='System'>*[System[Provider[@Name='Kernel-Power'] and EventID=187]]</Select></Query></QueryList>"
$trigger2 = $stopFancontrolTask.triggers.Create(0)
$trigger2.Enabled = $true
$trigger2.Id = '42'
$trigger2.Subscription = "<QueryList><Query Id='0' Path='System'><Select Path='System'>*[System[Provider[@Name='Kernel-Power'] and EventID=42]]</Select></Query></QueryList>"

$action = $stopFancontrolTask.Actions.Create(0)
$action.Path = 'taskkill'
$action.Arguments = "/F /IM FanControl.exe"

$rootFolder.RegisterTaskDefinition("Stop FanControl on sleep", $stopFancontrolTask, 6, [System.Security.Principal.WindowsIdentity]::GetCurrent().Name, $null, 3) | Out-Null

# Configuring job to start FanControl when logging in or turning the machine on
# https://learn.microsoft.com/en-us/windows/win32/taskschd/logon-trigger-example--scripting-
$startFancontrolTask = $scheduleService.NewTask(0)
$startFancontrolTask.RegistrationInfo.Description = ''
$startFancontrolTask.Settings.Enabled = $True
$startFancontrolTask.Settings.AllowDemandStart = $True

$trigger1 = $startFancontrolTask.triggers.Create(0)
$trigger1.Enabled = $true
$trigger1.Id = '107'
$trigger1.Subscription = "<QueryList><Query Id='0' Path='System'><Select Path='System'>*[System[Provider[@Name='Kernel-Power'] and EventID=107]]</Select></Query></QueryList>"
$trigger2 = $startFancontrolTask.triggers.Create(11)
$trigger2.Enabled = $true
$trigger2.StateChange = 8

$action = $startFancontrolTask.Actions.Create(0)
$action.Path = $pathToFancontrolExe
$action.WorkingDirectory = Split-Path $pathToFancontrolExe

$rootFolder.RegisterTaskDefinition("Start FanControl on unlock", $startFancontrolTask, 6, [System.Security.Principal.WindowsIdentity]::GetCurrent().Name, $null, 3) | Out-Null

All that needs to be done in order to use this is to simply update $pathToFancontrolExe to point to where your install of FanControl is.

sam0thius commented 2 months ago

I'm always on the latest release whatever that is (AFK right now). Symptoms are as described above. Let me know if there's any additional info I can give you.

Same here, Fan Control V199 crashes after resume from sleep. No visible errors here per say, just that the tray icon disappears once I hover over it with the mouse cursor.