d-uzlov / Rainmeter-Plugins-by-rxtd

A set of plugins for Rainmeter
GNU General Public License v3.0
10 stars 1 forks source link

Bug: Memory-leak followed by a crash when Granularity is set to invalid value. #4

Closed LI7XI closed 3 years ago

LI7XI commented 3 years ago

Steps to reproduce: When using Type TimeResampler, set Granularity to some invalid value, like a variable that is not declared, or incorrect math formula.

Update: Same thing happened when i accidentally added a space in TargetRate option: ... | TargetRat e 244 | Filter none

d-uzlov commented 3 years ago

Thank you for your report. I believe I have found the issue: when Granularity in TimeResampler is too low, it floods the plugin with gigabytes of data, and it inflates the memory usage of the plugin. However, the case with the "TargetRate" option shouldn't give you any issues. In this case plugin would only read option "TargetRat" (which doesn't exist, so it wouldn't even be parsed as a number), and since option "TargetRate" wasn't specified, it would have a default value. Maybe you have also changed something else?

Please, check the attached file to see if any of the issues you described here are present in this build. AudioAnalyzer.zip I assumed you use 64-bit version of rainmeter. If not, let me know, I will make a 32-bit version.

LI7XI commented 3 years ago

I believe I have found the issue: when Granularity in TimeResampler is too low, it floods the plugin with gigabytes of data, and it inflates the memory usage of the plugin. Please, check the attached file to see if any of the issues you described here are present in this build.

Unfortunately the issue still occurs here, it happens for something like: Granularity ([#SomeVariable]+) In this example The + sign will cause it.

Maybe you have also changed something else?

I doubt it but i'll double check. P.S The issue was setting TargetRate to some low value, like 244, when removing the parameter or using a value like 48000 the issue doesn't occur.

I assumed you use 64-bit version of rainmeter. If not, let me know, I will make a 32-bit version.

Yep it's 64-bit, but for some reason, my visualizers look faster and smoother, is it because this is 64-bit and the one i had before was 32-bit?

d-uzlov commented 3 years ago

Unfortunately the issue still occurs here, it happens for something like: Granularity ([#SomeVariable]+) In this example The + sign will cause it.

I can't reproduce it. Can you post you whole measure with variable values here? Just a parent measure description would be enough, without other stuff from the skin, like meters and measures.

Yep it's 64-bit, but for some reason, my visualizers look faster and smoother, is it because this is 64-bit and the one i had before was 32-bit?

I doubt it. Bitness of dlls must match bitness of the main application, otherwise dlls won't work at all.

d-uzlov commented 3 years ago

Also, can you reload your whole Rainmeter application and test again? If some other skin uses the same plugin, it's possible that you tested the old version, because old dll file was already loaded into memory, and your skin used that version instead of reading new file.

LI7XI commented 3 years ago

Can you post you whole measure with variable values here? Just a parent measure description would be enough, without other stuff from the skin, like meters and measures.

[MeasureAudio]
Measure=Plugin
Plugin=AudioAnalyzer_1_1
Type=Parent
MagicNumber=104

; AV means Audio Value, Originally it was a Measure that sums all Bands Values
; SD means Silence Detector, it's for controlling the skin when no audio is playing
Processing=AV

Processing-AV=channels auto | handlers AVfft, AVresampler, AVmapper, AVFinalOutput, SDFinalOutput | filter none
; ------------------------------------------------------------------------
Handler-AVfft=type fft | binWidth [#QualitySteps] | overlapBoost [#OverlapBoost] | cascadesCount 1 | windowFunction hann
; ------------------------------------------------------------------------
Handler-AVresampler=type BandResampler | source AVfft | bands linear 1 [#FreqMin] ([#FreqMax]*2) | cubicInterpolation true | minCascade 0 | maxCascade 0
; ------------------------------------------------------------------------
Handler-AVmapper=type ValueTransformer | source AVresampler | transform db map[from ([#MaxDB]) : ([#MinDB])] clamp
; ------------------------------------------------------------------------
Handler-AVFinalOutput=type TimeResampler | source AVmapper | attack [#WpAttack] | decay [#WpDecay] | Granularity ([#UpdateRate]+)
; notice the 'plus' above, it causes the issue
Handler-SDFinalOutput=type TimeResampler | source AVmapper | attack [#SDAttack] | decay [#SDDecay] | Granularity ([#UpdateRate])
; but it's working fine here
; ------------------------------------------------------------------------
UpdateDivider=[#SilenceUD]
Group=#GroupName#Measures
; ------------------------------------------------------------------------
Threading=Policy separateThread | UpdateRate [#Fps]
; ========================================================================

When there is audio playing, there is a bang that sets the update divider of all measures and meters to [#UpdateRate] value, usually it equals (30(the target fps) / 1000).

Also, can you reload your whole Rainmeter application and test again? If some other skin uses the same plugin, it's possible that you tested the old version, because old dll file was already loaded into memory, and your skin used that version instead of reading new file.

Reloaded twice before it crash and 3 times after it crashed, i refresh it after every reload and i even deleted the old versions of the plugin and kept the one you posted today, but still no luck. :/

d-uzlov commented 3 years ago

I also need all the variable values to make it work.

LI7XI commented 3 years ago

I also need all the variable values to make it work.

Fps=30
SilenceUD=#Fps#
ActiveUD=(#SilenceUD# / #Fps#)
UpdateRate=(1000 / #Fps#)
GroupName=Wallpaper
; ----------------
FreqMin=20
FreqMax=80
; ----------------
QualitySteps=6
OverlapBoost=2
; ----------------
SDAttack=0
SDDecay=900
; ----------------
WpAttack=40
WpDecay=80
; ----------------
MinDB=-5
MaxDB=-27

Child measures if needed:


[AudioValue]
Measure=plugin
Plugin=AudioAnalyzer_1_1
Type=Child
Parent=MeasureAudio
Index=0
Channel=auto
ValueId=AVFinalOutput
Group=#GroupName#Measures
; ------------------------------------

[SilenceDetector]
Measure=plugin
Plugin=AudioAnalyzer_1_1
Type=Child
Parent=MeasureAudio
Index=0
Channel=auto
ValueId=SDFinalOutput
; ------------------------------------
IfAboveValue=0.00001
IfAboveAction=[!SetOptionGroup #GroupName#Measures UpdateDivider [#ActiveUD]][!SetOptionGroup #GroupName#Meters UpdateDivider [#ActiveUD]][!UpdateMeasureGroup #GroupName#Measures][!UpdateMeterGroup #GroupName#Meters][!Redraw]
; -------------------
ifBelowValue=0.00001
ifBelowAction=[!SetOptionGroup #GroupName#Measures UpdateDivider [#SilenceUD]][!SetOptionGroup #GroupName#Meters UpdateDivider [#SilenceUD]]
; ============================
d-uzlov commented 3 years ago

I got the following messages in the log and nothing else:

DBUG (10:23:42.242) : can't parse '((1000 / 30)+)' as a number: Unexpected closing grouping operator, at position: ')'
ERRO (10:23:01.953) test suite\_test\test.ini - [MeasureAudio]: Proc 'AV': error: memory exceeded limit. Are your computer too slow for current settings?
ERRO (10:23:01.961) test suite\_test\test.ini - [MeasureAudio]: Proc 'AV': processing stopped

The version in the link above has a hard limit on the amount of memory that a single handler can use. It shouldn't be able to allocate more than a few megabytes for the whole plugin. Are you sure that you didn't make a mistake, for example, in the plugin name? Plugin in the archive above has name "AudioAnalyzer" instead of "AudioAnalyzer_1_1", if you didn't rename it.

LI7XI commented 3 years ago

Are you sure that you didn't make a mistake, for example, in the plugin name? Plugin in the archive above has name "AudioAnalyzer" instead of "AudioAnalyzer_1_1", if you didn't rename it.

Actually i wanted to ask, how to update the plugin?

What i did is i went to E:\Users\Documents\Rainmeter\Skins\@Vault\Plugins\AudioAnalyzer_1_1 then removed all old versions then created the following structure

Plugins → AudioAnalyzer_1_1 → 1.1.5.1 → 64bit → AudioAnalyzer_1_1.dll (i renamed the zipped plugin)

But now when i checked the plugins tab in About window, still it shows 1.1.5 as a version.

P.S i renamed the plugin name to AudioAnalyzerx (just to check) and replaced Plugin option with Plugin=AudioAnalyzerx.

  1. Plugin: Unable to load "AudioAnalyzerx"
  2. still shows the old(1.1.5) plugin in About window ._.

Even though i did restarted rainmeter and refreshed it many times.

d-uzlov commented 3 years ago

You have to replace .dll file in the c:\Users\<username>\AppData\Roaming\Rainmeter\Plugins\ or some corresponding path on your PC, if you don't use default rainmeter settings. I believe that @Vault folder is only used for archiving, and for ease of .rmskin creation.

Sorry, I should have explained this in my first post.

LI7XI commented 3 years ago

Sorry me, actually i thought about doing that then i said it may not be the correct way.

So i redid everything (renaming the measures to just AudioAnalyzer) and pasting the plugin in that folder, now... the skin makes rainmeter exit instantly once i load it. I used the safe mode to load it because normally it just exists, i didn't know even which skin causes that.

d-uzlov commented 3 years ago

Interesting. Could you spend some time and locate the exact skin that does this? This is clearly not an acceptable behaviuor, but I can't fix it without knowing what went wrong.

LI7XI commented 3 years ago

Could you spend some time and locate the exact skin that does this?

The skin that uses the exact measures i sent earlier. Btw i'm using Rainmeter v4.4.0.3404 if that helps.

d-uzlov commented 3 years ago

Attach the whole skin in a .zip archive to a post here, please.

LI7XI commented 3 years ago

RainVibe.zip

The skin that has the issue is called wallpaper, other skins may need Chameleon plugin to work. Update: all the skins has the same issue, but it's easier to deal with in wallpaper skin.

The file is located here: @Resources\Measures\Audio\Wallpaper\MeasureAudio.inc

d-uzlov commented 3 years ago

For me this skin loads without any issues or messages in the log, but it shows nothing. It showed something blurred for a split second, and then it became invisible, and refreshes doesn't do anything. And no crashes.

LI7XI commented 3 years ago

For me this skin loads without any issues or messages in the log, but it shows nothing. It showed something blurred for a split second, and then it became invisible, and refreshes doesn't do anything. And no crashes.

Set it to be "on desktop", the way it works, first it copies your current wallpaper, blurs it, then display it using bitmap meter. And if you played any music, the wallpaper brightness gonna interact with it using ColorMatrix.

It's weird that it doesn't work\shows errors. What is your rainmeter version?

d-uzlov commented 3 years ago

In the Skins tab in the About window I can see that it correctly determined my wallpapers, but then currentwp and finalwp point onto non-existent files. Though, the reason why this don't work should probably be discussed not in this issue.

The main thing is: it doesn't crash, and I can see that measures in the skin seems to correctly detect sound of different frequencies.

My rainmeter version was 4.4-r3338-beta. I updated to 4.4.0.3433-beta, and rainmeter started to show error messages in the logs: BitmapImage: Unable to open: C:\Users\user\Documents\Rainmeter\Skins\RainVibe\@Resources\Images/Wallpaper/Wallpaper.jpg (RainVibe\Wallpaper\Wallpaper.ini).

LI7XI commented 3 years ago

The main thing is: it doesn't crash, and I can see that measures in the skin seems to correctly detect sound of different frequencies.

I will try a fresh rainmeter install later on, and see if that will solve it or not. Huge thanks for your help!

LI7XI commented 3 years ago

I installed latest version of rainmeter but still same problem.

otherwise dlls won't work at all.

Hmm.. if possible, can you provide 32-bit version? Even though my windows clearly says it's 64-bit, i doubt that the plugin structure might be the issue.

P.S Never mind, here is what i did to make sure which plugin rainmeter will load: I placed both the last working version and the one your provided today in the plugins folder, renamed the first to AudioAnalyzer1151_32(i copied the 32-bit on purpose, 64 works just fine) and the second one to AudioAnalyzer1152_64, then restarted rainmeter and found it loading the AudioAnalyzer1152_64 version.

I really had no idea what is going on, i mean, if this bug is causing it, then it should just stop the process, not quit rainmeter. Btw, this happens even when using your examples skin, it's not just my suit.

d-uzlov commented 3 years ago

Since I can't replicate this, ideally I would ask you to make a debug builds of both rainmeter and my plugin, and run it in debug mode, to see what's really happening. Although, it's more likely related to some part of your setup, it shouldn't really happen with any setup provided my plugin doesn't have any errors.

But that's kinda advanced stuff, and since you haven't done it yourself already, I suppose you don't have the required skills and/or software.

LI7XI commented 3 years ago

But that's kinda advanced stuff, and since you haven't done it yourself already, I suppose you don't have the required skills and/or software.

Visual studio takes forever to load and i haven't touch this kinda stuff yet. Also i checked Debug Mode option in rainmeter settings but nothing shows an error in the file.

My last hope, could you create a simple skin with the plugin version your provided above? i'll remove all the traces of the old plugin here to make sure it's a problem in my skin.

I believe I have found the issue: when Granularity in TimeResampler is too low, it floods the plugin with gigabytes of data, and it inflates the memory usage of the plugin.

Btw, how is this even possible to happen? from where all this data is coming?

d-uzlov commented 3 years ago

My last hope, could you create a simple skin with the plugin version your provided above?

Here you go. AudioAnalyzer Test_1.1.5.1.zip I have also renamed plugin to AudioAnalyzer-test in this package to make sure it doesn't interfere with other versions of the plugin.

By the way, you can install a second instance of rainmeter using portable mode, to isolate it from all of your current skins and plugins.

d-uzlov commented 3 years ago

Btw, how is this even possible to happen? from where all this data is coming?

That's the purpose of TimeResampler: changes the amount of data, to ensure stable data flow.

Simplified principle of TimeResampler: TimeResampler receives data every X milliseconds (controlled by its input), and produces data every Granularity milliseconds. When it has received S blocks, such that S × X > Granularity, it produces S × X / Granularity number of blocks, to make sure that next handler in the chain gets a new data block at least every Granularity milliseconds. When granularity is near zero, S × X / Granularity is very big. Let say that one block is 1024 values, or 4 kilobytes. Granularity has a hard limit of 0.01 ms. So if your data updates every 16 ms, then overall there will be 16/0.01 == 1600 blocks each update cycle, or 6 MB per update per handler per cascade (if you have cascades and TimeResampler is before BandCascadeTransformer).

But then several things happen:

  1. Most handlers produce the same amount of blocks that it receives, so all of the handlers after TimeResampler will also produce 1600 blocks each 16 ms.
  2. It's kinda big amount of blocks, so it will take some time to process. If the time all the handlers take to process it exceeds 16 ms, then the next update will happen not after 16 ms but later, and in the next update TimeResampler will generate proportionally more blocks. More blocks mean longer update time, so next update will have even more data. And so on. Once your processing time has exceeded your one usual update cycle, memory consumption increases exponentially. Some slow handlers (like FFT) have a built-in time limit, but I guess that it's high enough to allow all the other handlers to deplete the memory, when TimeResampler goes crazy.
LI7XI commented 3 years ago

By the way, you can install a second instance of rainmeter using portable mode, to isolate it from all of your current skins and plugins.

Sadly, still same issue. :( Even with a fresh portable install.

That's the purpose of TimeResampler: changes the amount of data, ... when TimeResampler goes crazy. The version in the link above has a hard limit on the amount of memory that a single handler can use. It shouldn't be able to allocate more than a few megabytes for the whole plugin.

Now i understand how it works, but what is the max memory size the whole plugin can use? and what if you increased it? like let it use more than 20-30Mb.

LI7XI commented 3 years ago

Also (even though i wouldn't get it) can i see the code that solved the issue?

d-uzlov commented 3 years ago

Sadly, still same issue. :( Even with a fresh portable install.

If this works that way for a fresh installation, then I would say that the issue is in your system. As silly as it might sound, have you tried restarting the windows and running some windows diagnostics? And can you reproduce this on other computers?

Though, running plugin and/or Rainmeter through Visual Studio debugger seems to be the fastest method to learn the truth to me.

Now i understand how it works, but what is the max memory size the whole plugin can use? and what if you increased it? like let it use more than 20-30Mb.

It's 4 MB per handler (applied to data only, but all the other stuff hardly consumes few kilobytes). More than anyone could possibly need in the context of this plugin, in my opinion. Since when there is too much data memory consumption rises exponentially, so it won't work anyways, I don't see any reason to increase it.

Also (even though i wouldn't get it) can i see the code that solved the issue?

There is not much to see. There is this: if (totalDataCount > 1'000'000) { throw TooManyValuesException{ handlerName }; } and in another place I write log messages and stop updating the processing when TooManyValuesException happens.

LI7XI commented 3 years ago

And can you reproduce this on other computers?

Nope, i only have this one, but i do have windows 8 installed beside windows 10, also i'll check if that happens in safe mode as well.

Though, running plugin and/or Rainmeter through Visual Studio debugger seems to be the fastest method to learn the truth to me.

Right now i can't open it because it lags a lot (browser + vscode ate all the Ram). But can you tell me the steps to do it? When i go offline i'll restart the system and do the checks.

d-uzlov commented 3 years ago

There are two possibilities: plugin does something wrong and the app crashes or the Rainmeter itself does something wrong (well, or windows does something wrong, but this happens as a respond to either plugin or Rainmeter itself). Either way, you should download sources, compile it in debug mode (so that debugger can understand what is happening) and run debugger. You can do this for one component at a time, if you like, or both at the same time.

I haven't built Rainmeter for a long time, but IIRC the easiest way to test it is to build .exe in debug mode are copy it into Rainmeter installation folder, replacing original exe, and then connect to it.

Incase of plugin, you should build it, make sure that your skin sees the right plugin, then with unloaded skin (because when it loads Rainmeter crashes) connect debugger to Rainmeter and load skin.

To connect debugger to Rainmeter you should do this: in visual studio click the top menu: DebugAttach to process... and find Rainmeter in the list of currently running processes.

When the app crashes while debugger is connected to it, Visual Studio will show you the place where something happened, and you will be able to see what the context is, including the whole function call stack.

From there you could try to figure out what's happening by yourself, but the more productive alternative would be to to make a dump (Windows Task Manager → Right click on application → Create dump file) and send this dump to me, so I can see what's happened. Though, that doesn't stop you from browsing the call stack afterwards.

There is a possibility that you will always see that something happened in so called external code. This means that you don't have debug version of the app or library. If something happened inside some unknown code, then it is still important to understand what caused it, and call stack provides you with this opportunity.

Though, if you are seeing that the whole call stack is unknown code, then this is bad.

If when you run it several times and each time get something completely different, then it's likely that process memory gets corrupted. Test it several times and tell me if this happens. This is also very bad.

d-uzlov commented 3 years ago

Previously windows had cool ability to just take a snapshot of the app without connecting the debugger, by showing the window that app crashed, but apparently microsoft decided that this is not needed and disabled it in some windows update, and I spent few hours trying to turn it back on but I didn't manage to.

LI7XI commented 3 years ago

Earlier i tried to follow your steps but compiling rainmeter or any project in visual studio will fail because i need windows sdk. It takes time to install it and it's kinda big to download, so i left it for another time.

Luckily, i rebooted into safe mode to check, i found the issue still present, but i went to task manager, right-click on rainmeter and clicked debug, i found visual studio JIT debugger so i blindly chosen it and redid the steps for that issue, here is what i got:

Exception thrown at 0x00007FFD3C77E11E (AudioAnalyzer-test.dll) in Rainmeter.exe: 0xC0000005: Access violation reading location 0x0000000000000000. occurred

In output tab:

'Rainmeter.exe' (Win32): Loaded 'C:\Windows\System32\devobj.dll'. Exception thrown at 0x00007FFD3C77E11E (AudioAnalyzer-test.dll) in Rainmeter.exe: 0xC0000005: Access violation reading location 0x0000000000000000.

Note that this is the portable version of rainmeter. Is there anything else i can provide?

d-uzlov commented 3 years ago

I'm afraid this info doesn't tell me much. However, since you are able to stop the process when this occurs, you should be able to make a dump of the process. AudioAnalyzer-debug-3172978.zip Here is a debug build. It's painfully slow but for the most basic skins like the test one above it should work fine. Make sure to edit the skin file to use this dll, though. Make a dump through task manager when the app crashes, and send it to me somehow.

LI7XI commented 3 years ago

AudioAnalyzer-debug-3172978.zip

Plugin: Unable to load "AudioAnalyzer-debug-3172978" (error 126) Even though it's recognized in plugins tab. I changed names, used the portable version, different skins, nothing worked.

Here you go. AudioAnalyzer Test_1.1.5.1.zip

So i used this one to make the tests.

However, since you are able to stop the process when this occurs, you should be able to make a dump of the process. Make a dump through task manager when the app crashes, and send it to me somehow.

Without attaching the debugger, rainmeter exists instantly without being able to make a dump file. So i did the same as yesterday and when the error occurred, rainmeter still was available in task manager. So i made the dump file. But that file is over 200Mb (60Mb as .zip ) and that's kinda hard to upload. When i opened it with visual studio i got the following, i hope it helps:

Details Dump Summary ------------ Dump File: Rainmeter.dmp : C:\Rainmeter\Rainmeter.dmp Last Write Time: 16/02/2021 10:48:22 ص Process Name: Rainmeter.exe : C:\Rainmeter\Rainmeter.exe Process Architecture: x64 Exception Code: 0xC0000005 Exception Information: The thread tried to read from or write to a virtual address for which it does not have the appropriate access. Heap Information: Present System Information ------------------ OS Version: 10.0.18362 CLR Version(s): Modules ------- Module Name Module Path Module Version ----------- ----------- -------------- Rainmeter.exe C:\Rainmeter\Rainmeter.exe 4.4.0.3433 ntdll.dll C:\Windows\System32\ntdll.dll 10.0.18362.1139 kernel32.dll C:\Windows\System32\kernel32.dll 10.0.18362.1110 KERNELBASE.dll C:\Windows\System32\KERNELBASE.dll 10.0.18362.1139 user32.dll C:\Windows\System32\user32.dll 10.0.18362.1110 win32u.dll C:\Windows\System32\win32u.dll 10.0.18362.1139 gdi32.dll C:\Windows\System32\gdi32.dll 10.0.18362.1 gdi32full.dll C:\Windows\System32\gdi32full.dll 10.0.18362.1139 msvcp_win.dll C:\Windows\System32\msvcp_win.dll 10.0.18362.1110 ucrtbase.dll C:\Windows\System32\ucrtbase.dll 10.0.18362.1110 advapi32.dll C:\Windows\System32\advapi32.dll 10.0.18362.752 msvcrt.dll C:\Windows\System32\msvcrt.dll 7.0.18362.1 sechost.dll C:\Windows\System32\sechost.dll 10.0.18362.959 rpcrt4.dll C:\Windows\System32\rpcrt4.dll 10.0.18362.1110 shell32.dll C:\Windows\System32\shell32.dll 10.0.18362.1110 cfgmgr32.dll C:\Windows\System32\cfgmgr32.dll 10.0.18362.387 SHCore.dll C:\Windows\System32\SHCore.dll 10.0.18362.959 combase.dll C:\Windows\System32\combase.dll 10.0.18362.1139 bcryptPrimitives.dll C:\Windows\System32\bcryptPrimitives.dll 10.0.18362.836 windows.storage.dll C:\Windows\System32\windows.storage.dll 10.0.18362.1082 profapi.dll C:\Windows\System32\profapi.dll 10.0.18362.693 powrprof.dll C:\Windows\System32\powrprof.dll 10.0.18362.1 umpdc.dll C:\Windows\System32\umpdc.dll 0.0.0.0 shlwapi.dll C:\Windows\System32\shlwapi.dll 10.0.18362.1 kernel.appcore.dll C:\Windows\System32\kernel.appcore.dll 10.0.18362.1110 cryptsp.dll C:\Windows\System32\cryptsp.dll 10.0.18362.1 imm32.dll C:\Windows\System32\imm32.dll 10.0.18362.387 Rainmeter.dll C:\Rainmeter\Rainmeter.dll 4.4.0.3433 comctl32.dll C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.18362.1139_none_9e7bf2d3e4605ac6\comctl32.dll 6.10.18362.1139 comdlg32.dll C:\Windows\System32\comdlg32.dll 10.0.18362.900 ole32.dll C:\Windows\System32\ole32.dll 10.0.18362.1082 wininet.dll C:\Windows\System32\wininet.dll 11.0.18362.1082 oleaut32.dll C:\Windows\System32\oleaut32.dll 10.0.18362.1110 uxtheme.dll C:\Windows\System32\uxtheme.dll 10.0.18362.449 GdiPlus.dll C:\Windows\WinSxS\amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.18362.1139_none_cf66e5b93ef2d494\GdiPlus.dll 10.0.18362.1139 d2d1.dll C:\Windows\System32\d2d1.dll 10.0.18362.900 d3d11.dll C:\Windows\System32\d3d11.dll 10.0.18362.387 DWrite.dll C:\Windows\System32\DWrite.dll 10.0.18362.1082 dxgi.dll C:\Windows\System32\dxgi.dll 10.0.18362.1049 DXCore.dll C:\Windows\System32\DXCore.dll 10.0.18362.1 msctf.dll C:\Windows\System32\msctf.dll 10.0.18362.1139 igd10umd64.dll C:\Windows\System32\igd10umd64.dll 9.17.10.4459 clbcatq.dll C:\Windows\System32\clbcatq.dll 2001.12.10941.16384 windowscodecs.dll C:\Windows\System32\windowscodecs.dll 10.0.18362.959 IPHLPAPI.DLL C:\Windows\System32\IPHLPAPI.DLL 10.0.18362.1 nsi.dll C:\Windows\System32\nsi.dll 10.0.18362.449 dwmapi.dll C:\Windows\System32\dwmapi.dll 10.0.18362.267 xmllite.dll C:\Windows\System32\xmllite.dll 10.0.18362.295 cabinet.dll C:\Windows\System32\cabinet.dll 5.0.1.1 OneCoreUAPCommonProxyStub.dll C:\Windows\System32\OneCoreUAPCommonProxyStub.dll 10.0.18362.1082 propsys.dll C:\Windows\System32\propsys.dll 7.0.18362.815 Windows.StateRepositoryPS.dll C:\Windows\System32\Windows.StateRepositoryPS.dll 10.0.18362.1082 WinTypes.dll C:\Windows\System32\WinTypes.dll 10.0.18362.1139 cldapi.dll C:\Windows\System32\cldapi.dll 10.0.18362.1 bcrypt.dll C:\Windows\System32\bcrypt.dll 10.0.18362.267 fltLib.dll C:\Windows\System32\fltLib.dll 10.0.18362.1 sspicli.dll C:\Windows\System32\sspicli.dll 10.0.18362.1049 apphelp.dll C:\Windows\System32\apphelp.dll 10.0.18362.1139 OldNewExplorer64.dll E:\R3hab\Downloads\Archived\2019_\OldNewExplorer\OldNewExplorer64.dll 1.1.8.5 ntmarta.dll C:\Windows\System32\ntmarta.dll 10.0.18362.1 mssprxy.dll C:\Windows\System32\mssprxy.dll 7.0.18362.1049 iertutil.dll C:\Windows\System32\iertutil.dll 11.0.18362.1110 ws2_32.dll C:\Windows\System32\ws2_32.dll 10.0.18362.387 ondemandconnroutehelper.dll C:\Windows\System32\ondemandconnroutehelper.dll 10.0.18362.1 winhttp.dll C:\Windows\System32\winhttp.dll 10.0.18362.778 mswsock.dll C:\Windows\System32\mswsock.dll 10.0.18362.815 winnsi.dll C:\Windows\System32\winnsi.dll 10.0.18362.449 urlmon.dll C:\Windows\System32\urlmon.dll 11.0.18362.1110 CRYPTBASE.DLL C:\Windows\System32\CRYPTBASE.DLL 10.0.18362.1 dnsapi.dll C:\Windows\System32\dnsapi.dll 10.0.18362.1082 rasadhlp.dll C:\Windows\System32\rasadhlp.dll 10.0.18362.1 FWPUCLNT.DLL C:\Windows\System32\FWPUCLNT.DLL 10.0.18362.1110 schannel.dll C:\Windows\System32\schannel.dll 10.0.18362.1082 crypt32.dll C:\Windows\System32\crypt32.dll 10.0.18362.592 msasn1.dll C:\Windows\System32\msasn1.dll 10.0.18362.1 mskeyprotect.dll C:\Windows\System32\mskeyprotect.dll 10.0.18362.1 ncrypt.dll C:\Windows\System32\ncrypt.dll 10.0.18362.1 ntasn1.dll C:\Windows\System32\ntasn1.dll 10.0.18362.1 dpapi.dll C:\Windows\System32\dpapi.dll 10.0.18362.1 wintrust.dll C:\Windows\System32\wintrust.dll 10.0.18362.1139 rsaenh.dll C:\Windows\System32\rsaenh.dll 10.0.18362.1 cryptnet.dll C:\Windows\System32\cryptnet.dll 10.0.18362.1 ncryptsslp.dll C:\Windows\System32\ncryptsslp.dll 10.0.18362.1 TextInputFramework.dll C:\Windows\System32\TextInputFramework.dll 10.0.18362.693 CoreUIComponents.dll C:\Windows\System32\CoreUIComponents.dll 10.0.18362.1110 CoreMessaging.dll C:\Windows\System32\CoreMessaging.dll 10.0.18362.1049 edputil.dll C:\Windows\System32\edputil.dll 10.0.18362.1 appresolver.dll C:\Windows\System32\appresolver.dll 10.0.18362.356 userenv.dll C:\Windows\System32\userenv.dll 10.0.18362.1139 Bcp47Langs.dll C:\Windows\System32\Bcp47Langs.dll 10.0.18362.997 slc.dll C:\Windows\System32\slc.dll 10.0.18362.815 sppc.dll C:\Windows\System32\sppc.dll 10.0.18362.815 OneCoreCommonProxyStub.dll C:\Windows\System32\OneCoreCommonProxyStub.dll 10.0.18362.1 AudioAnalyzer-test.DLL C:\Rainmeter\Plugins\AudioAnalyzer-test.DLL 1.1.5.1 VCRUNTIME140_1.dll C:\Windows\System32\VCRUNTIME140_1.dll 14.26.28808.1 MSVCP140_2.dll C:\Windows\System32\MSVCP140_2.dll 14.26.28808.1 VCRUNTIME140.dll C:\Windows\System32\VCRUNTIME140.dll 14.26.28808.1 msvcp140.dll C:\Windows\System32\msvcp140.dll 14.26.28808.1 MMDevAPI.dll C:\Windows\System32\MMDevAPI.dll 10.0.18362.387 devobj.dll C:\Windows\System32\devobj.dll 10.0.18362.387 AudioSes.dll C:\Windows\System32\AudioSes.dll 10.0.18362.1110 resourcepolicyclient.dll C:\Windows\System32\resourcepolicyclient.dll 10.0.18362.959

Btw, is there something specific included in the dump file about the error?

d-uzlov commented 3 years ago

Plugin: Unable to load "AudioAnalyzer-debug-3172978" (error 126)

Oh, I didn't realize until now that debug builds also use debug dependencies, which are (very unfortunately) not a part of any public redistributable, and can only be found as a part of visual studio, and you, apparently, have an older version of visual studio than mine, so you don't have some of them.

EDIT: removed part about adding debug libraries to your PC because of the better solution below.

But that file is over 200Mb (60Mb as .zip ) and that's kinda hard to upload

Yeah. Mine are not as big (at least when I used a fresh installation of Rainmeter) but either way they would probably require to use some file sharing service, like google drive or MEGA.

Btw, is there something specific included in the dump file about the error?

They contain the whole state of the application memory. When debug builds are used, they allow debugger to match this state with the source code. But when release builds are used, dump files are kinda useless. At least I don't know how to get something from them in this case. Well "Exception thrown at 0x00007FFD3C77E11E (AudioAnalyzer-test.dll) in Rainmeter.exe: 0xC0000005: Access violation reading location 0x0000000000000000. occurred" told me that something wrong happened in my dll, and there is probably some place where system returned null pointer to me and I didn't expect it. But not much more.

Earlier i tried to follow your steps but compiling rainmeter or any project in visual studio will fail because i need windows sdk. It takes time to install it and it's kinda big to download, so i left it for another time.

By the way, don't you have any windows SDK installed? Both my project(s) and Rainmeter use certain version, but I believe that there should be nothing specific about these version, so if you change them in project settings to something you have installed then if should build without any issues.

d-uzlov commented 3 years ago

Hmm, on the other hand, I can make the compiler use release dependencies while still allowing debug. This build should run on your system just fine without any additional dlls. AudioAnalyzer-test-3172978.zip

LI7XI commented 3 years ago

Yeah. Mine are not as big (at least when I used a fresh installation of Rainmeter) but either way they would probably require to use some file sharing service, like google drive or MEGA.

Rainmeter.7z

By the way, don't you have any windows SDK installed?

I didn't know they are needed for c++ development on windows, so i didn't install them. I thought all you need is a compiler and you are good to go. Anyway i'll try to install it tomorrow.

AudioAnalyzer-test-3172978.zip

This one makes the error occurs, as expected. But here in visual studio it says:

AudioAnalyzer.pdb not loaded. AudioAnalyzer.pdb contains the debug information required to find the source for the module AudioAnalyzer-debug.dll

Any idea what this is? Sorry for the trouble i caused for you. #w#

d-uzlov commented 3 years ago

Rainmeter.7z

Thank you! Now that I understand what happened I feel very stupid. Though the global issue was that I didn't check for null pointer, in your case the issue was that you don't have a microphone or any other input device, which have to be a really common case so I certainly had to check it.

Any idea what this is?

Well, this is the expected behavior. Debuggable dll has the call stack info but it doesn't have meta-info about source code or something. And since you didn't build it and just used the .dll from me, you don't have it.

Sorry for the trouble i caused for you. #w#

Oh, regardless of what the issue could turn out to be, your help is priceless, because it could happen to anyone. Even if were a bug in windows, there could probably be some workaround. But now that I know that it's a mine fault alone I can't thank you enough for you help!

I will post here a new test build later, to check that I correctly identified the issue. I'll be waiting for your feedback, if you don't mind.

d-uzlov commented 3 years ago

Can you check if this build works? AudioAnalyzer-test.zip

LI7XI commented 3 years ago

But now that I know that it's a mine fault alone I can't thank you enough for you help!

Thanks for your kindness, i really appreciate it.

Can you check if this build works? AudioAnalyzer-test.zip

Great new!! it works perfectly. Even when i tried to reproduce the issue. I received an error log as expected.

But, umm.. it acts weird.😅 I mean it lags and some handlers work other doesn't. Is it because it's a debug build?

d-uzlov commented 3 years ago

But, umm.. it acts weird.😅 I mean it lags and some handlers work other doesn't. Is it because it's a debug build?

Yeah. Optimization kills debug features, so last 2 test buils are made with all possible performance optimizations turned off. Handlers that don't work are probably that way because of timeout feature I mentioned earlier.