DynamoRIO / drmemory

Memory Debugger for Windows, Linux, Mac, and Android
Other
2.42k stars 260 forks source link

Add VS2017 build support and update Appveyor to VS2017/Win10 #2250

Open derekbruening opened 4 years ago

derekbruening commented 4 years ago

DR is now using VS2017 and it is complicating making a combined package ( https://github.com/DynamoRIO/dynamorio/issues/2861).

Plus, Appveyor with VS2013 is basically Win8.1. Updating our Appveyor image to VS2017 will come with Win10 (1607) which will be a better test plaform.

derekbruening commented 3 years ago

Pasting in my notes showing why PR #2265 wasn't merged yet:

TODO list of test failures

Wow, a lot:

====> FAILURE in drmemory-dbg-32 <====
drmemory-dbg-32: 109 tests passed, **** 33 tests failed, but ignoring 5 for i1938: ****
    (ignore: i#1938)    procterm 
    operators 
    state 
    procterm.nativeparent 
    (ignore: i#1938)    winthreads 
    wrap_malloc 
    wrap_cs2bug 
    wrap_operators 
    (ignore: i#1938)    wrap_wincrt 
    wincrt 
    wrap_wincrtdbg 
    mallocMD 
    cs2bugMTd 
    cs2bugMTdZI 
    cs2bugMD 
    wrap_cs2bugMTd 
    cs2bugMDd 
    operatorsMDd 
    gdi 
    handle 
    wrap_operatorsMDd 
    handle_only 
    blacklist 
    nudge 
    leak_string 
    nosyms 
    (ignore: i#1938)    app_suite.pattern 
    syscall_file_all 
    (ignore: i#1938)    app_suite 
    syscall_file_gen 
    drsyscall_test => ASSERT FAILURE: ..\..\tests\framework\drsyscall_client.c:206: strcmp(name, "NtQueryValueKey") == 0 (syscalls in this app shouldn't fail)
        </Value>
                        %</Measurement>
    strace_test 
    drstrace_unit_tests 
WARNING: maximum warning/error limit hit for drmemory-dbg-64!
  Manually verify whether it succeeded.

====> FAILURE in drmemory-dbg-64 <====
drmemory-dbg-64: 29 tests passed, **** 86 tests failed, but ignoring 31 for i1938: ****
    hello 
    (ignore: i#1938)    procterm 
    malloc 
    leak_indirect 
    free 
    (ignore: i#1938)    badjmp 
    registers 
    asmtest 
    multierror 
    bitfield 
    bitfieldGL 
    (ignore: i#1938)    cs2bug 
    operators 
    float 
    selfmod 
    patterns 
    state 
    (ignore: i#1938)    winthreads 
    unloadtest 
    unloadMTd 
    unloadMD 
    unloadMDd 
    varstack 
    (ignore: i#1938)    slowesp 
    addronly-reg 
    (ignore: i#1938)    reachable 
    (ignore: i#1938)    procterm.nativeparent 
    (ignore: i#1938)    malloc_callstacks 
    strict_bitops 
    (ignore: i#1938)    noreplace_realloc 
    redzone16 
    redzone1024 
    free.exitcode 
    hello.exitcode 
    blacklist_uninit.op 
    blacklist_uninit.supp 
    (ignore: i#1938)    coverage 
    (ignore: i#1938)    suppress 
    (ignore: i#1938)    suppress-genoffs 
    (ignore: i#1938)    suppress-gensyms 
    (ignore: i#1938)    wincrt 
    wincrtdbg 
    mallocMTd 
    (ignore: i#1938)    mallocMD 
    (ignore: i#1938)    cs2bugMTd 
    (ignore: i#1938)    cs2bugMTdZI 
    (ignore: i#1938)    cs2bugMD 
    operatorsMDd 
    (ignore: i#1938)    cs2bugMDd 
    (ignore: i#1938)    gdi 
    (ignore: i#1938)    syscalls_win 
    (ignore: i#1938)    handle_only 
    (ignore: i#1938)    handle 
    (ignore: i#1938)    blacklist 
    realloc 
    pcache 
    leakcycle 
    nosyms 
    (ignore: i#1938)    whitelist_app 
    (ignore: i#1938)    whitelist_justlib 
    (ignore: i#1938)    whitelist_src 
    (ignore: i#1938)    whitelist_srclib 
    (ignore: i#1938)    nudge 
    (ignore: i#1938)    syscall_file_all 
    (ignore: i#1938)    syscall_file_gen 
    fuzz_corpus 
    fuzz_buffer 
    fuzz_buffer.replace_buffer 
    fuzz_buffer.mutator.o-b-s-3 
    fuzz_buffer.mutator.r-b-s-3 
    fuzz_buffer.mutator.o-b-3 
    fuzz_buffer.mutator.r-n 
    fuzz_buffer.mutator.random_seed 
    fuzz_buffer.one-input 
    fuzz_buffer.load_input 
    fuzz_buffer.skip_initial 
    fuzz_buffer.fixed_size 
    fuzz_buffer.offset 
    fuzz_buffer.module_name 
    fuzz_buffer.dictionary 
    fuzz_buffer.cpp 
    fuzz_buffer.cpp.demangled 
    fuzz_custom_mutator 
    drsyscall_test => ASSERT FAILURE: ..\..\tests\framework\drsyscall_client.c:169: false (no syscalls in this app should be unknown)
        </Value>
                        %</Measurement>
    strace_test 
    drstrace_unit_tests 

TODO unhandled application memory followed by exit -1

[00:07:58] ~~Dr.M~~ Running "C:/projects/drmemory/build/build_drmemory-dbg-64/tests/hello.exe"
[00:07:58] ~~Dr.M~~ WARNING: Failed to rename the symcache file.
[00:07:58] ~~Dr.M~~ unhandled application memory @0x00007ff69da307aa
[00:07:58] <Core dump file for application C:\projects\drmemory\build\build_drmemory-dbg-64\tests\hello.exe (4420) created at C:\projects\drmemory\build\build_drmemory-dbg-64\logs\dynamorio\hello.exe.4420.00000000.ldmp>
[00:07:58] ~~Dr.M~~ WARNING: application exited with abnormal code 0xffffffff

Addrs vary slightly but all end in 0x07aa.

It's a shadow memory issue.

new segment: app [0x0000000000000000, 0x0000030000000000), shadow [0x0000070000000000, 0x000007c000000000), reserve [0x000008c000000000, 0x000008f000000000)

get_shared_callstack: created pcs 0x00007ff5d7fbefc0
heap 0 0x000002e025f388c0-0x000002e025f388e0-0x000002e025f38980 0 0x0000002025f30000,0x000002e000000000 a0 0 0
heap 1 0x000002e025f38970-0x000002e025f3897a-0x000002e025f389c0 0 0x0000000a25f30000,0x000002e000000000 46 46 0
set range 0x000002e025f38970-0x000002e025f389b6 => 0x0
        set byte 0x000002e025f389b4
        set byte 0x000002e025f389b5
new pre-us alloc 0x000002e025f38970-0x000002e025f389b6-0x000002e025f389b6
get_shared_callstack: created pcs 0x00007ff5d7fbefc0
heap 1 0x000002e025f389c0-0x000002e025f389ca-0x000002e025f38aa0 0 0x0000000a25f30000,0x000002e000000000 d6 d6 0
set range 0x000002e025f389c0-0x000002e025f38a96 => 0x0
        set byte 0x000002e025f38a94
        set byte 0x000002e025f38a95
new pre-us alloc 0x000002e025f389c0-0x000002e025f38a96-0x000002e025f38a96
get_shared_callstack: created pcs 0x00007ff5d7fbefc0
heap 1 0x000002e025f38aa0-0x000002e025f38ab0-0x000002e025f38cc0 0 0x0000001025f30000,0x000002e000000000 210 210 0
set range 0x000002e025f38aa0-0x000002e025f38cb0 => 0x0
new pre-us alloc 0x000002e025f38aa0-0x000002e025f38cb0-0x000002e025f38cb0
get_shared_callstack: created pcs 0x00007ff5d7fbefc0
heap 0 0x000002e025f38cd0-0x000002e025f38cf0-0x000002e025f38fe0 0 0x0000002025f30000,0x000002e000000000 2f0 0 0
heap 1000 0x000002e025f39000-0x000002e025f39000-0x000002e02602f000 0 0x0000000025f30000,0x000002e000000000 f6000 0 0
walking heap 1 0x000002e025d70000
walking individual heap 0x000002e025d70000
adding heap region 0x000002e025d70000-0x000002e025d80000 arena
adding heap region 0x000002e025d70000-0x000002e025d80000
set heap region 0x000002e025d70000-0x000002e025d80000 Heap to 0x000002e025d70000
heap 2 0x000002e025d70000-0x000002e025d70000-0x000002e025d70720 0 0x000002e025d70740,0x000002e025d80000 720 0 0
heap 0 0x000002e025d70740-0x000002e025d70760-0x000002e025d70fe0 0 0x0000002025d70740,0x000002e000000000 880 0 0
heap 1000 0x000002e025d71000-0x000002e025d71000-0x000002e025d80000 0 0x0000000025d70000,0x000002e000000000 f000 0 0
walking heap 2 0x000002e025ed0000
skipping private heap 0x000002e025ed0000
app PEB is 0x000000fdf0ac9000-0x000000fdf0ac9388
set range 0x000000fdf0ac9000-0x000000fdf0ac9388 => 0x0
add new app segment for [0x000000fdf0ac0000, 0x000000fdf0b00000)
set range 0x000000fdf0ac9080-0x000000fdf0ac90c0 => 0x0
set range 0x000000fdf0ac9240-0x000000fdf0ac9640 => 0x0
set range 0x00007ff6578807aa-0x00007ff6578807ac => 0x0
unhandled application memory @0x00007ff6578807aa

Current shadow scheme:

 *   app1: [0x00000000'00000000, 0x00000300'00000000): exec, heap, data
 *   app2: [0x00007C00'00000000, 0x00008000'00000000): libs
 * 1B-to-1B mapping:
 *   SHDW(app) = (app & 0x00000FFF'FFFFFFFF) + 0x00000700'00000000)
 * and the result:
 *   shdw1 = SHDW(app1): [0x00000700'00000000, 0x00000a00'00000000)
 *   shdw2 = SHDW(app2): [0x00001300'00000000, 0x00001700'00000000)
 * and
 *   shdw1'= SHDW(shdw1): [0x00000e00'00000000, 0x00001100'00000000)
 *   shdw2'= SHDW(shdw2): [0x00000a00'00000000, 0x00000e00'00000000)

app PEB is 0x000000fd'f0ac9000-0x000000fd'f0ac9388 => in 1st region: not that.

It's the 0x00007ff6578807aa which is weird: seems like a normal lib. Need more info: need all segments.

derekbruening commented 3 years ago

Filed the shadow memory failure as #2328. We hit it on Server 2016 for Github Actions too.