How to Escape and Ignore __debugbreak

Viewed 1233

I'm using DLLImport to import a library provided by a hardware company and I'm writing my code in .NET Framework to consume the API provided by the DLL.

In one of the methods, when triggered, Visual Studio returns "A breakpoint instruction (__debugbreak() statement or a similar call) was executed in XXX.exe." while I'm in Debug mode. When switching to Release mode, the application crash and Visual Studio just stop the execution.

How do I escape the error/debugbreak so the application won't be triggering this error or I can bypass it?

1 Answers

After a few days of research, it turns out that the error was caused by a memory leakage "0xC0000374: A heap has been corrupted".

It was because of the memory leakage, it triggers the __debugbreak. The DLL library owner confirms that there's none __debugbreak in their code.

More information of how to solve the memory leaks is covered in this StackOverflow thread.

Related