I've been trying to use Dr Memory 2.1.0 to debug a large complex program I'm working on and it reported a lot of UNADDRESSABLE ACCESS beyond top of stack errors that I couldn't really work out what the problem was.
On a whim, I created a C++ program with the following code:
int main()
{
return 0;
}
No includes or anything. Built on Windows 10 with Mingw-Builds 8.1.0 with the following "-Wall -fexceptions -g".
Dr Memory reports:
Dr. Memory version 2.1.0 build 1 built on Mar 17 2019 23:59:56
Windows version: WinVer=105;Rel=1803;Build=17134;Edition=Professional
Dr. Memory results for pid 15464: "CPPTESTS.exe"
Application cmdline: "./bin/CPPTESTS.exe"
Recorded 117 suppression(s) from default C:\Program Files (x86)\Dr. Memory\bin64\suppress-default.txt
Error #1: UNADDRESSABLE ACCESS beyond top of stack: reading 0x000000000061fb70-0x000000000061fb78 8 byte(s)
# 0 .text [../../../../../src/gcc-8.1.0/libgcc/config/i386/cygwin.S:132]
# 1 _pei386_runtime_relocator [C:/Users/david/Documents/GameDev/Birunji/birunji/CPPTESTS/main.cpp:4]
# 2 __tmainCRTStartup
# 3 .l_start
# 4 KERNEL32.dll!BaseThreadInitThunk +0x13 (0x00007fffa73b4034 <KERNEL32.dll+0x14034>)
Note: @0:00:00.194 in thread 13496
Note: 0x000000000061fb70 refers to 600 byte(s) beyond the top of the stack 0x000000000061fdc8
Note: instruction: or $0x0000000000000000 (%rcx) -> (%rcx)
Error #2: POSSIBLE LEAK 36 direct bytes 0x00000000016401c0-0x00000000016401e4 + 0 indirect bytes
# 0 replace_malloc [d:\drmemory_package\common\alloc_replace.c:2577]
# 1 msvcrt.dll!malloc_crt
# 2 msvcrt.dll!_setargv
# 3 msvcrt.dll!_getmainargs
# 4 pre_cpp_init
# 5 msvcrt.dll!initterm
# 6 __tmainCRTStartup
# 7 .l_start
# 8 KERNEL32.dll!BaseThreadInitThunk +0x13 (0x00007fffa73b4034 <KERNEL32.dll+0x14034>)
===========================================================================
FINAL SUMMARY:
DUPLICATE ERROR COUNTS:
Error # 1: 2
SUPPRESSIONS USED:
ERRORS FOUND:
1 unique, 2 total unaddressable access(es)
0 unique, 0 total uninitialized access(es)
0 unique, 0 total invalid heap argument(s)
0 unique, 0 total GDI usage error(s)
0 unique, 0 total handle leak(s)
0 unique, 0 total warning(s)
0 unique, 0 total, 0 byte(s) of leak(s)
1 unique, 1 total, 36 byte(s) of possible leak(s)
ERRORS IGNORED:
3 unique, 3 total, 51 byte(s) of still-reachable allocation(s)
(re-run with "-show_reachable" for details)
Details: C:\Users\david\AppData\Roaming\Dr. Memory\DrMemory-CPPTESTS.exe.15464.000\results.txt
Any help understanding how to avoid Dr Memory reporting this would be great. It looks clear to me that it's reporting incorrectly, but I'm not sure why.