We know that strange problems may occur when our program corrupts memory in some way. Late side effects, hard-to-track crashes, problems with the debugger etc.
However I don't think there is a clear common understanding of how memory corruption may occur. That's still actually understood just by some people. I hope some of them can help to build some shallow but clear understanding of this matter.
For example, corrupting memory by referencing an array out of its bounds, ok, but would this always set ERR to 9 if we have #DEBUG ERROR ON ? Same concept for bad pointers. That'd tell us that checking ERR properly would help a lot to avoid corrupting memory.
So a general question might be (ASM aside): is it possible that memory gets corrupted even though ERR always stayed = 0 ? If yes, what's an example of how this can be done ? (to avoid doing it of course
).
Another example of questions useful to get a better understanding: is it possible that another running program comes to corrupt the memory of our program ? Wouldn't this cause an immediate GPF by the OS ?
Another possible point: is there some way of "checking whether the memory is currently corrupted" ? That'd be useful code to throw in to debug these problems.
However I don't think there is a clear common understanding of how memory corruption may occur. That's still actually understood just by some people. I hope some of them can help to build some shallow but clear understanding of this matter.
For example, corrupting memory by referencing an array out of its bounds, ok, but would this always set ERR to 9 if we have #DEBUG ERROR ON ? Same concept for bad pointers. That'd tell us that checking ERR properly would help a lot to avoid corrupting memory.
So a general question might be (ASM aside): is it possible that memory gets corrupted even though ERR always stayed = 0 ? If yes, what's an example of how this can be done ? (to avoid doing it of course

Another example of questions useful to get a better understanding: is it possible that another running program comes to corrupt the memory of our program ? Wouldn't this cause an immediate GPF by the OS ?
Another possible point: is there some way of "checking whether the memory is currently corrupted" ? That'd be useful code to throw in to debug these problems.
Comment