01-07-2025 01:03 AM
Dear all,
first of all: Happy New Year!
We are currently seeing a issues when unloading code modules, which can be tracked down to a certain part within our framework.
The situation:
We can execute a the testsprogram, incl setup and cleanup of our instruments without problems. But as soon as we “Unload all Modules” or shutting down the engine (when running from the OI), a runtime error is thrown indicating an access violation.
We suspect that Teststand tries to unload a module which is no longer loaded.
In order to further debug this systematically: how can we find out, which CodeModules are registered within TestStand?
I’ve checked the API and Forums (https://forums.ni.com/t5/NI-TestStand/About-Module-Load-Unload/td-p/3158478
) without any success.
Seems all the issues described in the forum just have the opposite effect where CodeModules keep running / are not unloaded.
Thanks for any input!
Best Regards
Oli
01-07-2025 09:56 AM - edited 01-07-2025 09:58 AM
Use Process Explorer as your task manager. It will show all modules that are loaded by an application. Just setup to "View > Lower Pane" and "Lower Pane View > DLLs" . Select your OI and then observe the lower pane.
01-08-2025 11:58 AM
Hi,
When you call unloadAllModules, the TS engine releases its references to any module that was loaded by the engine. Technically any module that is still referenced by TS should not be unloaded. There are some cases in which that is possible to unload modules but that should not cause an access violation.
Most likely there is some other code is either executing during unload of a module or code that is expecting a module to exist but was unloaded.
Please attach a debugger like Windbg or Visual Studio to the TS process to get more information about the access violation. Start with getting the call stack for the access violation and proceed from there.
Regards,
Anand Jain
NI