In my experience there are usually two causes of this phenomenon:

a) Performing logic inside of asserts.
b) Having different linker settings on Debug and Release mode.

Hope it helps!
-Thinias