DynamoRIO / drmemory

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

drstrace fails to start with an internal error #2496

Open gisburn opened 7 months ago

gisburn commented 7 months ago

Describe the bug drstrace fails here with an internal error

To Reproduce

  1. Try to run application under drstrace control:
M:\builds\msnfs41clientbuild\ms-nfs41-client\build.vc19\nfs41_np>drstrace -- "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\link.exe"  /ERRORREPORT:QUEUE /OUT:"M:\builds\msnfs41clientbuild\ms-nfs41-client\build.vc19\nfs41_np\Debug\nfs41_np.dll" /ILK:"Debug\nfs41_np.ilk" /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /DEF:"..\..\dll\nfs41_np.def" /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"M:\builds\msnfs41clientbuild\ms-nfs41-client\build.vc19\nfs41_np\Debug\nfs41_np.pdb" /SUBSYSTEM:WINDOWS /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"M:\builds\msnfs41clientbuild\ms-nfs41-client\build.vc19\nfs41_np\Debug\nfs41_np.lib" /MACHINE:X86 /DLL Debug\dllmain.obj Debug\nfs41_np.obj Debug\options.obj
<Application C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\link.exe (8196).  Dr. STrace internal crash at PC 0x027afa72.  Please report this at http://drmemory.org/issues.  Program aborted.
0xc06d007f 0x00000000 0x027afa72 0x027afa72 0x0143f2f8 0x00000000
Base: 0x73240000
Registers: eax=0x0143f278 ebx=0x00000000 ecx=0x00000001 edx=0x00000000
        esi=0x02670000 edi=0x00000000 esp=0x0143f278 ebp=0x0143f2d4
        eflags=0x000
version 10.0.19619, custom build
-no_dynamic_options -logdir 'C:\Users\roland_mainz\AppData\Roaming\Dr. Memory' -client_lib 'C:\Program Files (x86)\Dr. Memory\bin\release\drstracelib.dll;0;-symcache_path `C:\Users\roland_mainz\AppData\Roaming\Dr. Memory\symbols\WinTypes.pdb\BB00EF
018D604443AE6FFFBC56CB76BD2\WinTypes.pdb` -sysnum_file `C:\Program Files (
0x0143f2d4 0x731023de
0x0143f32c 0x73103b4c
0x0143f388 0x7309c593
0x0143f3b4 0x730e4d37
0x0143f3e8 0x730bcf0f
0x0143f400 0x730be079
0x0143f67c 0x730be23e
0x0143f69c 0x7381b9b3
0x733755f8 0x73800000
0x73800000 0x00000003>

Versions

No

Windows 10.0-19045

gisburn commented 7 months ago

Same crash happens with a clean environment with just "calc" as application:


C:\Users\roland_mainz>drstrace -- calc
<Application C:\Windows\SysWOW64\calc.exe (7428).  Dr. STrace internal crash at PC 0x050cfa72.  Please report this at http://drmemory.org/issues.  Program aborted.
0xc06d007f 0x00000000 0x050cfa72 0x050cfa72 0x02f0f594 0x00000000
Base: 0x73410000
Registers: eax=0x02f0f518 ebx=0x00000000 ecx=0x00000001 edx=0x00000000
        esi=0x04f90000 edi=0x00000000 esp=0x02f0f518 ebp=0x02f0f570
        eflags=0x000
version 10.0.19619, custom build
-no_dynamic_options -logdir 'C:\Users\roland_mainz\AppData\Roaming\Dr. Memory' -client_lib 'C:\Program Files (x86)\Dr. Memory\bin\release\drstracelib.dll;0;-symcache_path `C:\Users\roland_mainz\AppData\Roaming\Dr. Memory\symbols\WinTypes.pdb\BB00EF018D604443AE6FFFBC56CB76BD2\WinTypes.pdb` -sysnum_file `C:\Program Files (
0x02f0f570 0x732d23de
0x02f0f5c8 0x732d3b4c
0x02f0f624 0x7326c593
0x02f0f650 0x732b4d37
0x02f0f684 0x7328cf0f
0x02f0f69c 0x7328e079
0x02f0f918 0x7328e23e
0x02f0f938 0x7381b9b3
0x735455f8 0x73800000
0x73800000 0x00000003>
SuibianP commented 1 day ago

Same issue trying with calc, but with another executable it works just fine.

<Application C:\Windows\SysWOW64\calc.exe (39604).  Dr. STrace internal crash at PC 0x0460a892.  Please report this at http://drmemory.org/issues.  Program aborted.
0xc06d007f 0x00000000 0x0460a892 0x0460a892 0x0035f37c 0x00000000
Base: 0x63d70000
Registers: eax=0x0035f300 ebx=0x00000000 ecx=0x00000001 edx=0x00000000
        esi=0x044c0000 edi=0x00000000 esp=0x0035f300 ebp=0x0035f358
        eflags=0x000
version 10.0.19619, custom build

Might be related to the executable build settings as per https://github.com/DynamoRIO/drmemory/issues/2405#issuecomment-895358567.

> .\bin\drstrace.exe -debug -dr_debug -- calc
<Application C:\Windows\SysWOW64\calc.exe (34808).  Internal Error: DynamoRIO debug check failure: D:\a\drmemory\drmemory\dynamorio\core\win32\loader.c:775 !is_dynamo_address(dcontext->app_fls_data)
(Error occurred @0 frags in tid 34752)
version 10.0.19619, custom build
-no_dynamic_options -logdir 'C:\Users\<username>\Downloads\DrMemory-Windows-2.6.0\DrMemory-Windows-2.6.0' -client_lib 'C:\Users\<username>\Downloads\DrMemory-Windows-2.6.0\DrMemory-Windows-2.6.0\bin\debug\drstracelib.dll;0;-symcache_path `C:\Users\<username>\Downloads\DrMemory-Windows-2.6.0\DrMemory-Window
0x186d0ed4 0x63b2df39
0x186d100c 0x63d7ab12
0x186d1078 0x63d74f43
0x186d108c 0x63d356df
0x186d161c 0x63d35a82
0x186d1678 0x63d37006
0x186d1d64 0x63ec8016
0x028beb04 0x639223de
0x028beb5c 0x63923b4c
0x028bebb8 0x638bc593
0x028bebe4 0x63904d37
0x028bec18 0x638dcf0f
0x028bec30 0x638de079
0x028beeac 0x638de23e
0x028beecc 0x738411c2

Using build cronbuild-2.6.19800 on Microsoft Windows 11 Enterprise 10.0.22631 N/A Build 22631.