Debugging Pluginval exception on Windows

I’m trying to debug an exception triggered by Pluginval on Windows.

It brings up a “Debug Error” dialog with the option “Retry” which allows you to step into the debugger, but there’s no sign of my plugin in the call stack. I’ve verified that Pluginval will break on assertions in the loaded plugin, so I assume it’s set up correctly.

Any tips for debugging such exceptions?

Running the plugin built in Release mode (or RelWithDebInfo) does not show the dialog and crashes in Pluginval. Still no sign of my plugin in the stack trace…

Perhaps you could try attaching an external debugger like WinDbg?

I managed to find the source of the problem after a painstaking process of elimination!

I found putting jassertfalse statements in potential problem areas allowed me to then step through via Pluginval with the debugger in CLion, where I could then add breakpoints as well. I’m curious to know if there’s a way to get the full stack trace in this situation?

What was the source of the problem?

It was due to a callback (in the form of a std::function) being made from a class owned by the Processor, where the callback function was owned by a class within the Editor. In one of the tests, the callback was called while the editor was being destroyed. This only happened on Windows.

Solved by using async messages instead!

Did you try using Asan? Sounds like this might have caught it?

I did after your suggestion. This bit of advice was key to fixing a couple of other issues.

I think this should be written in bold in the pluginval readme!

Did Asan catch it?
I kind of want to know if there’s anything we could add to pluginval to catch this kind of thing.

I might add that comment to the readme.

The initial issue I did not catch with asan - I suspect it would have caught it much quicker than my process of elimination. I didn’t go back to see if it would.