Re: [DynInst_API:] Dyninst limitations for memory trace


Date: Sun, 21 Oct 2012 19:32:16 -0500
From: Andrew Bernat <bernat@xxxxxxxxxxx>
Subject: Re: [DynInst_API:] Dyninst limitations for memory trace

On Oct 21, 2012, at 6:16 PM, Pooya Salehi <pxsalehi@xxxxxxxxx> wrote:

As part of a student job in the University of Munich, I am trying to write a memory trace program using Dyninst that will record every memory reference of a program. Currently we are trying to investigate which frameworks/APIs is more suitable for this task, the three candidates being Dyninst, Pin and DynamoRIO.

I would expect each to work for your task, with there being some pros and cons of the patch-based approach (Dyninst) vs. trace based (Pin/DynamoRIO). I'm surprised at the errors you list below; they show that there is something pervasively wrong about your installation of Dyninst. 

We're actively working on the release candidate of version 8.0, so if you don't mind I would like you to try that instead of debugging your installation of 7.0.1. We've made a number of improvements to lower overhead in any case that you will want to use. 

Please down the source available here: snapshot and build from source. There is a configure script in the top level directory that you should run, then make install. 

Let me know if you have any questions and I'd be glad to help!

Drew


I have encountered some problems while using Dyninst for this purpose, I hope someone can help me.

The first problem is, when trying to get the thread id using the BPatch_tidExpr, I get the following error at runtime:

--SERIOUS-- #100: Image: Unable to find function: dyn_pthread_self
[../../dyninstAPI/src/BPatch_snippet.C:1530] - Internal Dyninst error. Found 0 copies of DYNINSTthreadIndex. Expected 1

The other issue is while the examples in the programmer's guide instrument memory access of a single function, I need to recored memory reference of the whole program including external libraries. Currently what I do is first get the list of all the functions and then for each function insert snippets to recored memory references like the examples. The problem is since even for a very small program the number of functions is large, if I use process creation I get the following error:

process.C[1232]: BAD NEWS, process has exited
process.C[1184]: recursion guard
ast.C(1351): writing string value: Success
ast.C(1351): writing string value: Success
.
.
.
ast.C(1351): writing string value: Success
ast.C(1351): writing string value: Success
dyn_memtrace_proc: ../../dyninstAPI/src/addressSpace.C:1307: void trampTrapMappings::writeTrampVariable(const int_variable*, long unsigned int): Assertion `result' failed.
Aborted (core dumped)

so the probe insertion doesn't finish and the instrumentation doesn't begin!!

And if I try to rewrite the program binary on disk, I get the following error:

WARNING: overflow of codeGen structure, trying to enlarge

but this enlargement doesn't happen and and nothing moves forward anymore!!

So my question is, is there a way to instrument memory accesses of a whole (potentially) large program using Dyninst? It seems like since Dyninst doesn't have any JIT-mode and only works in Probe-mode, it cannot manage a large number of probes. But large number of probes in case of memory tracing is inevitable!!

Thanks in advance,
Pooya Salehi
_______________________________________________
Dyninst-api mailing list
Dyninst-api@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/dyninst-api




[← Prev in Thread] Current Thread [Next in Thread→]