DynamoRIO / DynamoRIO/drmemory
Unaddressable access error found upon startup in Visual Studio 2017
- Dominant language
- C
- Stars
- 2.7k
- Forks
- 290
- PR merge metrics
- No merged PRs in 30d
Description
I'm running Dr. Memory 32-bit version 1.11.0, and I experienced this error in the VS Output window, even when I do not add additional command line arguments (beyond -visual_studio -- $(TargetPath)). It appears to be an issue with the Windows Kernel DLL. The program under test did not start up.
```
Dr. Memory version 1.11.0
Running "C:\sand\trunk\software\Program\build\intermediate\Debug\Desktop\Program.exe"
Error #1: UNADDRESSABLE ACCESS: reading 4 byte(s)
COM+_Entry_Point
??:0
KERNEL32.dll!BaseThreadInitThunk
??:0
ERRORS FOUND:
1 unique, 1 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)
0 unique, 0 total, 0 byte(s) of possible leak(s)
Details: C:\sand\vendor\DrMemory\drmemory\logs\DrMemory-Program.exe.32692.000\results.txt
WARNING: application exited with abnormal code 0xc0000005
```
I'm running Windows 10 Pro OS Build 17134.112 and using Dr. Memory as an external tool in Visual Studio 2017. I appear to have all the settings in VS listed on the setup page.
I attempted to run the program using the debugging command line options (-leaks_only -no_count_leaks -no_track_allocs, etc.) as suggested, but I received the same error in each instance. I also ran it under plain DynamoRIO, and the program ran without any output (no crash) and did not produce a log file.
Running the program directly on the command line results in the following output:
```
Dr. Memory version 1.11.0 build 2 built on Aug 29 2016 02:42:07
Dr. Memory results for pid 31252: "Program.exe"
Application cmdline: "C:\sand\trunk\software\Program\build\bin\Debug\Program.exe"
Recorded 115 suppression(s) from default C:\sand\vendor\DrMemory\bin\suppress-default.txt
Error #1: UNADDRESSABLE ACCESS: reading 0x00402000-0x00402004 4 byte(s)
# 0 COM+_Entry_Point
# 1 KERNEL32.dll!BaseThreadInitThunk +0x23 (0x74968484 )
Note: @0:00:00.116 in thread 1440
Note: instruction: jmp 0x00402000
===========================================================================
FINAL SUMMARY:
DUPLICATE ERROR COUNTS:
SUPPRESSIONS USED:
ERRORS FOUND:
1 unique, 1 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)
0 unique, 0 total, 0 byte(s) of possible leak(s)
ERRORS IGNORED:
0 unique, 0 total, 0 byte(s) of still-reachable allocation(s)
(re-run with "-show_reachable" for details)
Details: C:\sand\vendor\DrMemory\drmemory\logs\DrMemory-Program.exe.31252.000\results.txt
```
The output of the global.pid.log file is below, produced with -debug -dr_debug -verbose:
```
Dr. Memory version 1.11.0 build 2 built on Aug 29 2016 02:42:07
start time: 3659971:07:52.010 == 19:07:52.010 07/12/2018
Recorded 115 suppression(s) from default C:\sand\vendor\DrMemory\bin\suppress-default.txt
Syscall mismatch detected. Running on unknown kernel version!
new thread #0 id=56692
module load event: "Program.exe" 0x005a0000-0x012d8000 modid: 1 C:\sand\trunk\software\Program\build\intermediate\Debug\Desktop\Program.exe
module load event: "dynamorio.dll" 0x70ed0000-0x7102d000 modid: 2 C:\sand\vendor\DrMemory\dynamorio\lib32\release\dynamorio.dll
module load event: "drmemorylib.dll" 0x73800000-0x73a26000 modid: 3 C:\sand\vendor\DrMemory\bin\release\drmemorylib.dll
module load event: "mscoree.dll" 0x74230000-0x74285000 modid: 4 C:\WINDOWS\SYSTEM32\MSCOREE.DLL
module load event: "KERNEL32.dll" 0x74950000-0x74a30000 modid: 5 C:\WINDOWS\System32\KERNEL32.dll
module load event: "KERNELBASE.dll" 0x74eb0000-0x75094000 modid: 6 C:\WINDOWS\System32\KERNELBASE.dll
module load event: "ntdll.dll" 0x779e0000-0x77b70000 modid: 7 C:\WINDOWS\SYSTEM32\ntdll.dll
WARNING: unable to load symbols for C:\WINDOWS\System32\KERNEL32.dll
Error #1: UNADDRESSABLE ACCESS: reading 4 byte(s)
# 0 COM+_Entry_Point (0x012ccade ) modid:1
# 1 KERNEL32.dll!BaseThreadInitThunk (0x74968484 ) modid:5
error end
WARNING: unhandled system calls found
DUPLICATE ERROR COUNTS:
SUPPRESSIONS USED:
ERRORS FOUND:
1 unique, 1 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)
0 unique, 0 total, 0 byte(s) of possible leak(s)
Details: C:\sand\vendor\DrMemory\drmemory\logs\DrMemory-Program.exe.53736.000\results.txt
DUPLICATE POTENTIAL ERROR COUNTS:
POTENTIAL ERRORS FOUND:
0 unique, 0 total potential unaddressable access(es)
0 unique, 0 total potential uninitialized access(es)
0 unique, 0 total potential invalid heap argument(s)
0 unique, 0 total potential GDI usage error(s)
0 unique, 0 total potential handle leak(s)
0 unique, 0 total potential warning(s)
0 unique, 0 total, 0 byte(s) of potential leak(s)
0 unique, 0 total, 0 byte(s) of potential possible leak(s)
Details: C:\sand\vendor\DrMemory\drmemory\logs\DrMemory-Program.exe.53736.000\potential_errors.txt
Exiting @0:00:02.072 in thread 56692
LOG END
```
Dr. Memory works when running with Notepad++.
Any advice for resolving the issue? Thank you.
Contributor guide
Assessment
This issue has not been assessed yet.