3 ms·
One of my favorite types of bugs in C is what my professor called 'unlucky bugs' A bug the code where changing the arrangement of your code can with fix or cre
by yadaeno 7y ago
One of my favorite types of bugs in C is what my professor called 'unlucky bugs'
A bug the code where changing the arrangement of your code can with fix or create. Its possible if you have a static array initialized to the wrong length.
Changing the arrangement offsets the initalization segment of memory which is why this is possible.
- greenyoda 7y agoThe other side of this is having code that only works correctly because you've gotten lucky. For example, the variables on the stack that you're overwriting due to a buffer overflow are no longer being used at that point in the function.
- 2rsf 7y agoand a third variation are 2 or bugs that cancel themselves, for example you overwrite a variable but never use it (where you should have)
- jpitz 7y agoI often hear these called Heisenbugs.