You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lately I'm working on adopting DR as a component in software testing tool(on x64 linux). Unfortunately, when using DR to attach to a running process, the following error occured: ERROR : attaching to running processes is not yet implemented.
Moreover, instrument a process from the beginning with options "-use_ptrace" also failed, and the error reads: <Application (8095). Unable to place the heap in a manner that satisfies all 32bit displacement requirements. Check -vm_base, -vm_offset, -heap_in_lower_4GB, and dll preferred base addresses for issues.>
(The second problem can be mitigated by setting "heap_in_lower_4GB" value to true. But only mitigated, still unsuccessful instrumentation. )
But fortunately, after reviewing the source code of DR, I found that in fact almost all the codes attaching-to-running-process needs are already there. And then I modified and added several lines of code and realize this function, at least on my computer.
There are only three aspects that I modified:
A stable control of a running process. That is, the mechanism of pausing a running process and running shellcode.
Some environment variables must be commonly known(I don't use "shared" here because they are two distinct processes) between the instrumented process and drrun. In the current version, most of the environment vars are shared via execv, where child process can inherit from the parent(drrun). This is not suitable for attaching to a running process and leads to malfunctions.
In the init func of libdrpreload.so, just return 0.
So I am interested in what problems are the authors encoutering when realizing the attaching mechanism. Maybe there are some deeper problems I don't know, because I only reviewed the code for around three days. If you are interested in my naive implementation of attaching to a running process, I can commit that.
The text was updated successfully, but these errors were encountered:
There are no deep problems on UNIX: the main pieces are pretty much there as parts of other features, but nobody ever put them together as a first-class supported feature, just because nobody ever needed it with high enough priority. We would be happy to accept contributions that finish it off. Issue #38 covers the feature. (This issue seems more like an email to dynamorio-devs -- closing as a dup. Please submit patches with #38 as the issue.)
Lately I'm working on adopting DR as a component in software testing tool(on x64 linux). Unfortunately, when using DR to attach to a running process, the following error occured:
ERROR : attaching to running processes is not yet implemented.
Moreover, instrument a process from the beginning with options "-use_ptrace" also failed, and the error reads:
<Application (8095). Unable to place the heap in a manner that satisfies all 32bit displacement requirements. Check -vm_base, -vm_offset, -heap_in_lower_4GB, and dll preferred base addresses for issues.>
(The second problem can be mitigated by setting "heap_in_lower_4GB" value to true. But only mitigated, still unsuccessful instrumentation. )
But fortunately, after reviewing the source code of DR, I found that in fact almost all the codes attaching-to-running-process needs are already there. And then I modified and added several lines of code and realize this function, at least on my computer.
There are only three aspects that I modified:
So I am interested in what problems are the authors encoutering when realizing the attaching mechanism. Maybe there are some deeper problems I don't know, because I only reviewed the code for around three days. If you are interested in my naive implementation of attaching to a running process, I can commit that.
The text was updated successfully, but these errors were encountered: