It is currently March 28th, 2024, 10:44 pm

[Bug?] UsageMonitor plugin error

Report bugs with the Rainmeter application and suggest features.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Bug?] UsageMonitor plugin error

Post by balala »

Yincognito wrote: July 14th, 2020, 1:56 am I did experience UsageMonitor crashes in the past, but the error messages appeared in the Windows Event Viewer, and weren't related (as far as the message was about) to string values. Nowadays they don't seem to happen anymore for me.

Another thing that happens sometimes with UsageMonitor is that it - very quickly - reports a number (and not the name of a process) on a skin's first load. This one, although it still happens, does so very rarely.
I'm not an expert in PerfMon questions, but a while ago here on the forum has been a post about the possibility to get the performance counter database corrupted and how can it be fixed. Here is the post: https://forum.rainmeter.net/viewtopic.php?p=179985&sid=cd9c84147b5af6e14b1ef61849373b8f#p179985
Could be your case as well?
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Bug?] UsageMonitor plugin error

Post by Yincognito »

balala wrote: July 14th, 2020, 8:47 am I'm not an expert in PerfMon questions, but a while ago here on the forum has been a post about the possibility to get the performance counter database corrupted and how can it be fixed. Here is the post: https://forum.rainmeter.net/viewtopic.php?p=179985&sid=cd9c84147b5af6e14b1ef61849373b8f#p179985
Could be your case as well?
Yes, I know, but thanks for pointing out that anyway. As I said, this problem happened in the past for me, nowadays not anymore. :thumbup:

EDIT: I couldn't replicate pul53dr1v3r's problem either.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Bug?] UsageMonitor plugin error

Post by balala »

Yincognito wrote: July 14th, 2020, 3:12 pm EDIT: I couldn't replicate pul53dr1v3r's problem either.
Nor me so far, so I recommend to pul53dr1v3r to follow the description in the above link. May help and if it doesn't, for sure doesn't hurt...
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Bug?] UsageMonitor plugin error

Post by Yincognito »

balala wrote: July 14th, 2020, 5:57 pm Nor me so far, so I recommend to pul53dr1v3r to follow the description in the above link. May help and if it doesn't, for sure doesn't hurt...
Sure thing.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Bug?] UsageMonitor plugin error

Post by balala »

pul53dr1v3r wrote: July 13th, 2020, 7:33 pm if you're still testing it, have you gotten any error so far?
I left it running for almost five hours and still no errors. The skin is working, as said no errors in log. So take into account this recommendation: https://forum.rainmeter.net/viewtopic.php?f=122&t=28353&start=170#p180057
User avatar
Brian
Developer
Posts: 2673
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: [Bug?] UsageMonitor plugin error

Post by Brian »

So, after running the TopCPU skin (using 10 processes) for almost 36 hours inside the VS2019 debugger, I finally got the error a couple of times.

While the problem has been identified, mitigating the issue remains elusive so far.

Stay tuned...

-Brian

PS - I moved the topic to the bugs section since the issue has been confirmed.
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Bug?] UsageMonitor plugin error

Post by Yincognito »

Brian wrote: July 15th, 2020, 6:47 pmSo, after running the TopCPU skin (using 10 processes) for almost 36 hours [...]
Now that is professionalism. Respect. :rosegift:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
pul53dr1v3r
Posts: 442
Joined: July 30th, 2014, 10:30 am

Re: [Bug?] UsageMonitor plugin error

Post by pul53dr1v3r »

balala wrote: July 14th, 2020, 8:41 pm
I left it running for almost five hours and still no errors. The skin is working, as said no errors in log. So take into account this recommendation: https://forum.rainmeter.net/viewtopic.php?f=122&t=28353&start=170#p180057
it's very short period of time to get the error, in general, as Brian experienced. Sometimes it won't occur for days and sometimes it does twice in a minute. :x
i also tried to rebuild performance counter settings from database, but i got the error next day, ~1h after i turned on my PC.

Brian wrote: July 15th, 2020, 6:47 pm So, after running the TopCPU skin (using 10 processes) for almost 36 hours inside the VS2019 debugger, I finally got the error a couple of times.

While the problem has been identified, mitigating the issue remains elusive so far.
Oh finally. i'm "glad" that you got it so a doubt that it could be an individual issue is out of the question. Just requires some patience, and probably very good nerves. :thumbdown:

Today i got it twice in one hour, after almost 2 days of "silence":

ERRO (14:12:59.871) RainformerHWi\TopProcesses\TopRAM\TopRAM.ini - [MeasureTop2RAM]: UsageMonitor crashed trying to return the new String value of this measure
DBUG (14:12:59.872) : Object reference not set to an instance of an object.
DBUG (14:12:59.883) : at UsageMonitor.Plugin.GetString(IntPtr data)


ERRO (14:46:34.853) RainformerHWi\TopProcesses\TopCPU\TopCPU.ini - [MeasureTop1RAM]: UsageMonitor crashed trying to update this measure
DBUG (14:46:34.854) : Object reference not set to an instance of an object.
DBUG (14:46:34.854) : at UsageMonitor.Plugin.Update(IntPtr data)
User avatar
tjhrulz
Developer
Posts: 267
Joined: October 13th, 2016, 1:28 am
Location: Earth

Re: [Bug?] UsageMonitor plugin error

Post by tjhrulz »

Alright so I have been looking into this issue and had it running for about a week now using a prototype version of the plugin I was working on months ago to try to fix the over 100% bug before ultimately giving up on it due to realizing that the issue lies with Microsoft CPU performance counters actually not scaling the way Microsoft says they do in their own documentation and that Task Manager's detail pane lies to you but I never figured out how they lie to you as it is not exactly divided by thread count from my testing (I actually thing it stems from the SIMD commands that are baked into modern processors as I can almost guarantee the bug happens when using a program that takes advantage of them) but that is a story for another day.

However when working on this I also built the system to better handle collision with other threads and counters getting purged which is my bet what is happening here since I have yet to encounter an error thrown after using my skin built to thrash this for a week.

Given though that bugs like this that are infrequent are easier to confirm with friends testing as well I figure I will upload this to have you guys test as well. Do note that this being a plugin built into Rainmeter needs to go into your C:\Program Files\Rainmeter\Plugins folder and also if you notice a small performance hit over normal usage monitor ignore that as this version still has debugging symbols left in it since I did not want to have to kill my test to build it for release.


Edit: Forgot to upload the file, also due note that this is for the x86-64 version of Rainmeter since that is what 99.99% of you should be running anyways
You do not have the required permissions to view the files attached to this post.
User avatar
tjhrulz
Developer
Posts: 267
Joined: October 13th, 2016, 1:28 am
Location: Earth

Re: [Bug?] UsageMonitor plugin error

Post by tjhrulz »

dvo wrote: July 31st, 2020, 7:31 am
dvo, I looked into it in the past and Microsoft's documentation for it is non existent. The official support for that system is sandboxed and thus you only have access to what your program puts in it (This is why programs seem to fight over it all the time as it is a poorly written system built with obfuscation in mind IMO) While working with Azack on a different low level project for windows a year or two ago I found some undocumented APIs that may be able to be exploited to do it, although I could not get them to work in my limited testing. Knowing that and that MS seems to have the attitude since Windows 10 released that it has been long enough since the Windows XP monopoly lawsuits that they can go back to breaking everything that uses their new APIs that they have not been forced to document with every windows update I doubt something like that will every come to be.