Has anyone ever seen a StackOverflow error thrown by TAP? This happens when one particular step is included in the test plan run, and it only crashes upon completion (looks like around the time that PostPlanRun and Close methods would be performed). This step has worked before without issues, but on two new test stations we see this problem. When Visual Studio breaks, all we see is “StackOverflow exception occured in Unknown Module”. We’ve tried installing different versions of .NET Framework, but same result each time.
This is tentatively resolved - it was happening on a Close method of a DUT object, which is using a NI DIO card. I removed the reference to this object, so it wasn’t used in the TestPlan, so that Close method wasn’t being called. We also found that this station is using a different version from a different station where this was previously working, so turns out this was caused by NI stuff, either NI MAX or NIDaqMx
So, to fully resolve this, the actual problem was a recursive function call in the code (function 1 calling function 2, which calls function 1, etc. until the StackOverflow). In this case, the Close function was calling some function, which also called the Close function, and it was actually the DUT object, not the TestStep. As far as it working before, it must be an older version of the code that was working, and the new version had this infinite recursion bug.
StackOverflow (the website) indicated that usually this is the case with StackOverflow errors, that they’re caused by infinite recursions. So for anyone that encounters this… that’s probably the problem.
Sorry to NI for the blame.