Common reasons for bugs in release version not present in debug mode

后端 未结 18 1559
余生分开走
余生分开走 2020-11-28 04:11

What are the typical reasons for bugs and abnormal program behavior that manifest themselves only in release compilation mode but which do not occur when in debug mode?

18条回答
  •  忘掉有多难
    2020-11-28 04:55

    I just experienced that when I was calling an assembly function that didn't restored the registers' previous values.

    In the "Release" configuration, VS was compiling with /O2 which optimizes the code for speed. Thus some local variables where merely mapping to CPU registers (for optimization) which were shared with the aforementioned function leading to serious memory corruption.

    Anyhow see if you aren't indirectly messing with CPU registers anywhere in your code.

提交回复
热议问题