DebugBreak inside SDK code

Hi all,

I've been making a game entirely in C for a while now. Only recently I started getting my game halted on a __debugbreak()s somewhere inside ntdll.dll code, with a call stack coming from a simulator's C++ code, not my game code.

I have two different call stacks, one is from a break point triggered sometime during the boot up (after event handler received kEventInit, but before first update callback is invoked), the second one happens when I shutdown the simulator. Neither of them happens 100% of the time. Further more, when I build the game for a device and upload it, it never breaks on launch nor on a shut down (or at least I have not experienced it yet).

I am developing on Windows 10, using SDK version 2.6.2.

Now, my question is, does anyone have a hint how I can find the culprit of this issue? I do have call stacks, but they don't really say what caused the debug break or anything... I am almost certain that this is caused by my game code, because when I switch flag to launch a sandbox version of my game code (which I use to test isolated features), this debug break never happens, so I don't think this is an SDK bug or anything. But, this makes me stuck as I have no idea how to approach this and find the actual issue on my game code side. Would appreciate any help.

Cheers,
Robert