keifufu / WebNowPlaying-Rainmeter

Rainmeter Adapter for WebNowPlaying
MIT License
100 stars 4 forks source link

Random Rainmeter Crashes with versions greater than 1.2.0 #8

Closed BigBagss closed 1 year ago

BigBagss commented 1 year ago

TL;DR: Rainmeter crashes at random times with versions greater than 1.2.0. windows event viewer Log included.

hi, thank you for this great plugin!

for some reason new releases (>1.2.0) cause Rainmeter to crash at random times (sometimes no crashes for a couple of days, sometimes a few times a day.)

this is the log i found in windows event viewer, i hope this helps:

Application: Rainmeter.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.OperationCanceledException
   at System.Threading.CancellationToken.ThrowOperationCanceledException()
   at System.Net.WebSockets.WebSocketBase.ThrowIfConvertibleException(System.String, System.Exception, System.Threading.CancellationToken, Boolean)
   at System.Net.WebSockets.WebSocketBase+<CloseOutputAsyncCore>d__51.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at System.Net.WebSockets.WebSocketBase+<CloseAsyncCore>d__56.MoveNext()

Exception Info: System.Net.WebSockets.WebSocketException
   at System.Net.WebSockets.WebSocketBase.ThrowIfAborted(Boolean, System.Exception)
   at System.Net.WebSockets.WebSocketBase.ThrowIfConvertibleException(System.String, System.Exception, System.Threading.CancellationToken, Boolean)
   at System.Net.WebSockets.WebSocketBase+<CloseAsyncCore>d__56.MoveNext()

Exception Info: System.Net.WebSockets.WebSocketException
   at System.Net.WebSockets.WebSocketBase.ThrowIfAborted(Boolean, System.Exception)
   at System.Net.WebSockets.WebSocketBase.ThrowIfConvertibleException(System.String, System.Exception, System.Threading.CancellationToken, Boolean)
   at System.Net.WebSockets.WebSocketBase+<CloseAsyncCore>d__56.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at WNPReduxAdapterLibrary.WNPHttpServer+<ProcessWebSocketRequest>d__7.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   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.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

and in the log i see WNPReduxAdapterLibrary so it's something with the plugin i guess.

i don't know much about this but it could be my antivirus (Kaspersky free) blocking this or something like that, not sure.

things i've tried:

only versions after 1.2.0 have this issue. (with 1.2.0 i have 0 crashes.) so i don't think this is an issue with Rainmeter/it's skins.

i am sorry if I'm missing the solution / something out about this in the documentation. thanks!

keifufu commented 1 year ago

Does this happen when you do something specific? Like executing a wnp bang like pausing/skipping, or when closing the browser?

BigBagss commented 1 year ago

funnily enough, this catches me mostly off guard when i leave my computer, and i am pretty sure the browser is minimized (sometimes with a few tabs of youtube videos). so i come back and see that rainmeter was closed.

keifufu commented 1 year ago

Please give this version a go: WebNowPlaying.zip

BigBagss commented 1 year ago

thanks for the help! i will update if i see any crashes with this version.

lehuymanhtan commented 1 year ago

Please give this version a go: WebNowPlaying.zip

I also had a similar problem like this. But in my case Rainmeter couldn't turn on. Tried this version and the latest but still not working.

BigBagss commented 1 year ago

weird, what used to happen is it would simply crash but i could re open rainmeter normally with no issues and it would crash some time later again. but ever since using the version above i had 0 crashes so far, seems like it's working for me.

maybe you have some old/broken plugin/skin causing those crashes...

keifufu commented 1 year ago

@lehuymanhtan If possible, please provide some Rainmeter logs or event viewer logs as without those there is nothing I can diagnose.

keifufu commented 1 year ago

@BigBagss Good to know it's going well so far, I'm hoping it'll stay that way. Have you had issues with it not reporting media at all, instead of crashing?

lehuymanhtan commented 1 year ago

@lehuymanhtan If possible, please provide some Rainmeter logs or event viewer logs as without those there is nothing I can diagnose.

I think I found out why my Rainmeter crashed. The plugin somehow can’t start the WebSocket. In version 1.2.0, if it can’t start the WebSocket, it writes it in the log. However, in newer versions, it crashes Rainmeter.

And here is crash log from Event Viewer:

Application: Rainmeter.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Net.HttpListenerException
   at System.Net.HttpListener.AddAllPrefixes()
   at System.Net.HttpListener.Start()
   at WNPReduxAdapterLibrary.WNPHttpServer+<StartThreaded>d__6.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   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.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
BigBagss commented 1 year ago

@BigBagss Good to know it's going well so far, I'm hoping it'll stay that way. Have you had issues with it not reporting media at all, instead of crashing?

nope, as far as i can tell everything is working normally. thanks!

keifufu commented 1 year ago

@lehuymanhtan I see, I can definitely catch this error but why can't it start it in the first place... Any other program running the same port?

lehuymanhtan commented 1 year ago

@lehuymanhtan I see, I can definitely catch this error but why can't it start it in the first place... Any other program running the same port?

Nope. I checked Process Hacker and found no applications running on that port. By the way, I have fixed it just by restarting my computer.

lehuymanhtan commented 1 year ago

Anyway, thank you all for your help.

keifufu commented 1 year ago

Interesting, I'll still implement better error handling for it soon.

mrinmaydhar commented 1 year ago

Please give this version a go: WebNowPlaying.zip

Just an FYI, this version did not work for me. Getting the same WebSocket error in EventViewer I replaced the DLL provided in the zip in the following location: C:\Users\<username>\OneDrive\Documents\Rainmeter\Skins\@Vault\Plugins\WebNowPlaying\2.0.5.0\64bit Event Viewer logs

If you need any logs, feel free to message me.

keifufu commented 1 year ago

@mrinmaydhar The plugin needs to be replaced in %AppData%\Rainmeter\Plugins, so you didn't actually replace it.

BigBagss commented 1 year ago

Please give this version a go: WebNowPlaying.zip

Just an FYI, this version did not work for me. Getting the same WebSocket error in EventViewer I replaced the DLL provided in the zip in the following location: C:\Users\<username>\OneDrive\Documents\Rainmeter\Skins\@Vault\Plugins\WebNowPlaying\2.0.5.0\64bit Event Viewer logs

If you need any logs, feel free to message me.

i had no crashes after using this version. here is everything i did:

also check in rainmeter About Rainmeter->Plugins to ensure that the new version is 2.0.5.1

keifufu commented 1 year ago

@BigBagss native API shouldn't be the cause btw as they don't touch websockets.

BigBagss commented 1 year ago

@BigBagss native API shouldn't be the cause btw as they don't touch websockets.

yeah i suspected something like that, i don't really use the native API so i left it disabled and had no crashes with the new version. thanks!

keifufu commented 1 year ago

I'll be waiting for a bit longer and if you still don't experience any crashes on the new version I'll release it and consider this closed.

mrinmaydhar commented 1 year ago

@BigBagss I've confirmed the version as 2.0.5.1 as you suggested in About Rainmeter. (Did not disable native API support, however) @keifufu I've also replaced the DLL as you mentioned. I'll keep a lookout for any more crashes. Thank you.

keifufu commented 1 year ago

Going to assume this has been resolved. Released v2.0.6 with this and another crash hopefully fixed.