Tyrrrz / LightBulb

Reduces eye strain by adjusting screen gamma based on the current time
MIT License
2.23k stars 141 forks source link

WndProc: Object reference not set to an instance of an object #275

Closed boromyr closed 5 months ago

boromyr commented 5 months ago

Version

2.4.8

Platform

Windows 11 22635.3420

Steps to reproduce

The application crashes after a few minutes with two error messages.

Details

---------------------------
Error
---------------------------
System.AccessViolationException: Attempt to read or write to protected memory. This condition often indicates that other parts of memory are damaged.

   in DotnetRuntimeBootstrapper.AppHost.Core.Dotnet.DotnetHost.Run(IntPtr handle)

   in DotnetRuntimeBootstrapper.AppHost.Core.Dotnet.DotnetHost.Run(String targetFilePath, String[] args)

   in DotnetRuntimeBootstrapper.AppHost.Core.TargetAssembly.Run(String[] args)

   in DotnetRuntimeBootstrapper.AppHost.Core.BootstrapperBase.Run(TargetAssembly targetAssembly, String[] args)

   in DotnetRuntimeBootstrapper.AppHost.Core.BootstrapperBase.Run(String[] args)
---------------------------
OK   
---------------------------
---------------------------
Fatal Error
---------------------------
System.NullReferenceException: Object reference not set to an instance of an object.

   at LightBulb.PlatformInterop.Internal.WndProcMessage.GetLParam[T]() in D:\a\LightBulb\LightBulb\LightBulb.PlatformInterop\Internal\WndProcMessage.cs:line 9

   at LightBulb.PlatformInterop.PowerSettingNotification.<>c__DisplayClass0_0.<.ctor>b__0(WndProcMessage m) in D:\a\LightBulb\LightBulb\LightBulb.PlatformInterop\PowerSettingNotification.cs:line 15

   at LightBulb.PlatformInterop.Internal.WndProcSponge.<>c__DisplayClass8_0.<Listen>g__OnMessageBroadcasted|0(Object _, WndProcMessage message) in D:\a\LightBulb\LightBulb\LightBulb.PlatformInterop\Internal\WndProcSponge.cs:line 27

   at LightBulb.PlatformInterop.Internal.WndProcBroadcaster.BroadcastMessage(UInt32 message, IntPtr wParam, IntPtr lParam) in D:\a\LightBulb\LightBulb\LightBulb.PlatformInterop\Internal\WndProcBroadcaster.cs:line 10

   at LightBulb.PlatformInterop.Internal.WndProcSponge.<>c__DisplayClass14_0.<TryCreate>b__0(IntPtr windowHandle, UInt32 message, IntPtr wParam, IntPtr lParam) in D:\a\LightBulb\LightBulb\LightBulb.PlatformInterop\Internal\WndProcSponge.cs:line 65

   at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg)

   at Avalonia.Win32.Win32DispatcherImpl.RunLoop(CancellationToken cancellationToken)

   at Avalonia.Threading.DispatcherFrame.Run(IControlledDispatcherImpl impl)

   at Avalonia.Threading.Dispatcher.PushFrame(DispatcherFrame frame)

   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken)

   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args)

   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, Action`1 lifetimeBuilder)

   at LightBulb.Program.Main(String[] args) in D:\a\LightBulb\LightBulb\LightBulb\Program.cs:line 48
---------------------------
OK   
---------------------------

Checklist

Tyrrrz commented 5 months ago

Hello.

Can you please test the build from below and see if you can still reproduce the error?

https://github.com/Tyrrrz/LightBulb/actions/runs/8585040815?pr=276

boromyr commented 5 months ago

Seems to be working properly so far