Project, there was an inexplicable crash with the error:
XXXX modified at Xxxafter it is freed
The breakpoint position is in a destructor, and after checking, this class is not a problem, it is not a class that the destructor has been refactored.
Pain, searching for a tool: Gfrag.exe
Call:./gflags.exe-p/enable Program name. Exe/full you do not need to specify a specific path here.
This tool is actually just setting up the registry that will:
Computer \hkey_local_machine\software\microsoft\windows nt\currentversion\image File execution options\ program name. EXE to set a
GlobalFlag REG_SZ 0x02000000
PageHeapFlags REG_SZ 0x3
So you can also set your own hand. When the shell runs the program, it uses the full page heap for program memory allocation, which causes an exception when wild pointer access or cross-border access occurs.
If you do not set this, wild pointer access and out-of-bounds access does not cause an exception, so it does not crash on the spot, but crashes in the next free or malloc call, making it impossible to find out.
The following is a very successful discovery: A variable type has changed, but the pointer declared in the code is still old, calling the functions of different classes, and then looking for out-of-scope memory.
Debug method for Windows wild pointers