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

后端 未结 18 1501
余生分开走
余生分开走 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:37

    Other differences might be:

    • In a garbage-collected language, the collector is usually more aggressive in release mode;
    • Layout of memory may often be different;
    • Memory may be initialized differently (eg could be zeroed in debug mode, or re-used more aggressively in release);
    • Locals may be promoted to register values in release, which can cause issues with floating point values.

提交回复
热议问题