- /*
- * DrMemory test x1.c
- *
- * Compile with:
- * $ x86_64-w64-mingw32-gcc -g -gdwarf-2 x1.c
- *
- * Test with:
- * $ drmemory -batch -check_uninitialized -gen_suppress_syms -preload_symbols -- ./a
- */
- #include <stdlib.h>
- #include <string.h>
- #include <stdio.h>
- const int ar[] = { 5, 4, 3, 2, 1, 0 };
- int main(int ac, char *av[])
- {
- int i;
- int j;
- for (i=0 ; i < 16 ; i++) {
- j = ar2[i];
- }
- return 0;
- }
- /*
- output:
- $ drmemory -batch -check_uninitialized -gen_suppress_syms -preload_symbols -- ./a
- ~~Dr.M~~ Dr. Memory version 2.6.0
- ~~Dr.M~~ Running "./a"
- ~~Dr.M~~ Using system call file C:\Users\roland.mainz\AppData\Roaming\Dr. Memory\symcache\syscalls_x64.txt
- ~~Dr.M~~
- ~~Dr.M~~ Error #1: UNADDRESSABLE ACCESS beyond top of stack: reading 0x000000a0191ff7e0-0x000000a0191ff7e8 8 byte(s)
- ~~Dr.M~~ # 0 .text [/home/roland.mainz/work/drmemory_test1/x1.c:25]
- ~~Dr.M~~ # 1 _pei386_runtime_relocator [/home/roland.mainz/work/drmemory_test1/x1.c:25]
- ~~Dr.M~~ # 2 __tmainCRTStartup
- ~~Dr.M~~ # 3 .l_start
- ~~Dr.M~~ # 4 KERNEL32.dll!BaseThreadInitThunk
- ~~Dr.M~~ Note: @0:00:00.222 in thread 16552
- ~~Dr.M~~ Note: 0x000000a0191ff7e0 refers to 824 byte(s) beyond the top of the stack 0x000000a0191ffb18
- ~~Dr.M~~ Note: instruction: or $0x0000000000000000 (%rcx) -> (%rcx)
- #start
- i=~~Dr.M~~
- ~~Dr.M~~ Error #2: UNADDRESSABLE ACCESS beyond top of stack: reading 0x000000a0191ff950-0x000000a0191ff958 8 byte(s)
- ~~Dr.M~~ # 0 .text [/home/roland.mainz/work/drmemory_test1/x1.c:25]
- ~~Dr.M~~ # 1 __pformat_int.isra.0 [/home/roland.mainz/work/drmemory_test1/x1.c:25]
- ~~Dr.M~~ # 2 __mingw_pformat [/home/roland.mainz/work/drmemory_test1/x1.c:25]
- ~~Dr.M~~ # 3 __mingw_vfprintf [/home/roland.mainz/work/drmemory_test1/x1.c:25]
- ~~Dr.M~~ # 4 printf [/usr/x86_64-w64-mingw32/sys-root/mingw/include/stdio.h:375]
- ~~Dr.M~~ # 5 main [/home/roland.mainz/work/drmemory_test1/x1.c:20]
- ~~Dr.M~~ Note: @0:00:00.263 in thread 16552
- ~~Dr.M~~ Note: 0x000000a0191ff950 refers to 8 byte(s) beyond the top of the stack 0x000000a0191ff958
- ~~Dr.M~~ Note: instruction: or $0x0000000000000000 (%rcx) -> (%rcx)
- 5
- i=4
- i=3
- i=2
- i=1
- i=0
- ~~Dr.M~~
- ~~Dr.M~~ Error #3: UNADDRESSABLE ACCESS beyond heap bounds: reading 0x00000294074b1298-0x00000294074b129c 4 byte(s)
- ~~Dr.M~~ # 0 main [/home/roland.mainz/work/drmemory_test1/x1.c:17]
- ~~Dr.M~~ Note: @0:00:00.284 in thread 16552
- ~~Dr.M~~ Note: refers to 0 byte(s) beyond last valid byte in prior malloc
- ~~Dr.M~~ Note: prev lower malloc: 0x00000294074b1280-0x00000294074b1298
- ~~Dr.M~~ Note: instruction: mov (%rax) -> %eax
- i=0
- i=0
- i=0
- i=0
- i=0
- i=0
- i=0
- i=0
- i=0
- i=0
- #end
- ~~Dr.M~~
- ~~Dr.M~~ Error #4: LEAK 24 direct bytes 0x00000294074b1280-0x00000294074b1298 + 0 indirect bytes
- ~~Dr.M~~ # 0 replace_malloc [D:\a\drmemory\drmemory\common\alloc_replace.c:2580]
- ~~Dr.M~~ # 1 main [/home/roland.mainz/work/drmemory_test1/x1.c:11]
- ~~Dr.M~~
- ~~Dr.M~~ ERRORS FOUND:
- ~~Dr.M~~ 3 unique, 44 total unaddressable access(es)
- ~~Dr.M~~ 0 unique, 0 total uninitialized access(es)
- ~~Dr.M~~ 0 unique, 0 total invalid heap argument(s)
- ~~Dr.M~~ 0 unique, 0 total GDI usage error(s)
- ~~Dr.M~~ 0 unique, 0 total handle leak(s)
- ~~Dr.M~~ 0 unique, 0 total warning(s)
- ~~Dr.M~~ 1 unique, 1 total, 24 byte(s) of leak(s)
- ~~Dr.M~~ 0 unique, 0 total, 0 byte(s) of possible leak(s)
- ~~Dr.M~~ ERRORS IGNORED:
- ~~Dr.M~~ 4 unique, 4 total, 4136 byte(s) of still-reachable allocation(s)
- ~~Dr.M~~ (re-run with "-show_reachable" for details)
- ~~Dr.M~~ Details: C:\Users\roland.mainz\AppData\Roaming\Dr. Memory\DrMemory-a.exe.15568.000\results.txt
- */
drmemory mingw test1
Posted by Anonymous on Sat 28th Oct 2023 06:05
raw | new post
modification of post by Anonymous (view diff)
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.