application crashes on attach on windows

58 views
Skip to first unread message

Prasun Ratn

unread,
Apr 30, 2022, 11:44:30 AM4/30/22
to DynamoRIO Users
Hi

I was trying to see how well DR attach to pid works on Windows. I downloaded the most recent release (DynamoRIO-Windows-9.0.19110) and tried attaching to a program.

I tried a couple of programs: 7zip's benchmark and a simple python program. I ran the 64-bit drrun.exe with the parameters '-attach <pid>'

In either case it crashed immediately with "Out of memory" error (see exact error below). I tried running drrun as administrator and also tried -takeover_sleep with a couple different values but saw the same error. I am running Win10 Enterprise 20H2.

The help message says the feature is still experimental but I was hoping it would work for some of these scenarios. Any thoughts on how well the attach feature is supposed to work on Win10?

Application C:\Program Files\7-Zip\7zG.exe (2928).  Out of memory.  Program aborted.  Source I, type 0x0000000000000001, code 0x00000000c000001c.

Application C:\Python37\python.exe (28572).  Out of memory.  Program aborted.  Source I, type 0x0000000000000001, code 0x00000000c000001c.
 
Thanks
Prasun

Derek Bruening

unread,
May 2, 2022, 11:42:17 PM5/2/22
to Prasun Ratn, DynamoRIO Users
A contributor added the feature but given that the regression test had some issues on the github test VM's it is not surprising that there might be issues on various platforms: https://github.com/DynamoRIO/dynamorio/pull/5075#issuecomment-926161472

That said, the OOM messages you've pasted look like https://github.com/DynamoRIO/drmemory/issues/2447 and may not be dependent on attach?  Those happen with drrun injection too?  I couldn't reproduce those in that issue; if you can reproduce perhaps you could debug.

--
You received this message because you are subscribed to the Google Groups "DynamoRIO Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dynamorio-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dynamorio-users/33616159-0d4f-42a0-a7e2-4e5387e8b2d3n%40googlegroups.com.

Prasun Ratn

unread,
May 3, 2022, 12:49:23 AM5/3/22
to Derek Bruening, DynamoRIO Users
I tried running drmemory but keep getting this error

C:\DynamoRIO-Windows-9.0.19110>drmemory\bin64\drmemory.exe -- C:\Windows\notepad.exe
ERROR: cannot find DynamoRIO library C:\DynamoRIO-Windows-9.0.19110\drmemory\dynamorio\lib64\debug\dynamorio.dll

<press enter to dismiss>

Prasun Ratn

unread,
May 3, 2022, 9:52:11 AM5/3/22
to Derek Bruening, DynamoRIO Users
It did seem to work fine on another machine so it is probably some security software or something blocking attach.

I ran the bbsize client and got similar results with running the test under drrun or while attaching. However when I tried collecting traces with drcachesim I did not see any traces being created. Is this flow expected to work?

# Runs fine
drrun.exe -t drcachesim -offline -- C:\Python37\python.exe test.py

# No traces
drrun.exe -attach 8600 -t drcachesim -offline

Derek Bruening

unread,
May 3, 2022, 12:05:54 PM5/3/22
to Prasun Ratn, DynamoRIO Users
On Tue, May 3, 2022 at 9:52 AM Prasun Ratn <prasu...@gmail.com> wrote:
It did seem to work fine on another machine so it is probably some security software or something blocking attach.

I ran the bbsize client and got similar results with running the test under drrun or while attaching. However when I tried collecting traces with drcachesim I did not see any traces being created. Is this flow expected to work?

# Runs fine
drrun.exe -t drcachesim -offline -- C:\Python37\python.exe test.py

# No traces
drrun.exe -attach 8600 -t drcachesim -offline

Huh, no I would not expect that to work, as the drcachesim config file has a replacement launcher.  I've attached the drcachesim drmemtrace tracer before by manually specifying libdrmemtrace.so as the client w/o really thinking about someone trying the -t option (which I do use when not attaching).  Interesting -- the replacement launcher is really needed just for online simulation, to launch the parallel simulator.  For offline it's not really needed. But there's no tool config mechanism to make that decision dynamic.  I filed https://github.com/DynamoRIO/dynamorio/issues/5480 on this.  For now for offline use " -c clients/lib64/release/libdrmemtrace.so -offline".
Reply all
Reply to author
Forward
0 new messages