The "Access Violation", that you are referring to, cannot happen in well-formed code. It is always the result of undefined behavior.
When that happens the state of your program is unknown, and is corrupted in some unspecified and unknown way. You cannot expect to accomplish any meaningful task in the program, any more, because the state of the program is no longer known. I suppose that if the operating system protects the program's code segment read-only you could rely on the fact that the actual code is intact, but the stack is in unknown state, and you can forget all about the heap, its state is completely unknown.
The only meaningful means to extract any useful diagnostics from the flawed program is by using an external debugger to analyze and inspect the frozen snapshot of the program's state at that point, from an external view.