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

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

    I remember while ago when we were building dll and pdb in c/c++.

    I remember this:

    • Adding log data would sometime make the bug move or disappear or make a totally other error appears (so it was not really an option).
    • Many of these errors where related to char allocation in strcpy and strcat and arrays of char[] etc...
    • We weeded some out by running bounds checker and simply fixing the memory alloc/dealloc issues.
    • Many times, we systematically went through the code and fixed a char allocation.
    • My two cents is that it is related to memory allocation and management and constraints and differences between Debug mode and release mode.

    And then kept at going through that cycle.

    We sometimes, temporarily swapped release for debug versions of dlls, in order not to hold off production, while working on these bugs.

提交回复
热议问题