Date: | Wed, 17 Jul 2019 21:55:23 +0000 |
---|---|
From: | Benjamin Welton <welton@xxxxxxxxxxx> |
Subject: | Re: [DynInst_API:] BPatch_image->findFunction() behavior with weak symbols |
Hey German,
> Checking the API of BPatch_function I noticed the method getNames (in plural)
Yeah the dual interfaces for getting string names is a bit weird (and exists mainly for user application compatibility purposes). My understanding is that in most cases you should use the (std::vector<X> &) for any feature that has dual interfaces.
> But if I try to use the second one, I'm getting this linking error:
This is a strange and these functions *should* be available. What version of Dyninst are you using and are you linking your tool against the correct version of libDyninstAPI.so?
> For each symbol that I look for, there's only 1 BPatch_function match, and for each object, there's several names found, but the names look like that (`a).
Yeah this is problematic and Dyninst is doing something wrong here. Is the binary you are running your tool on (the application with these mpi_init functions) small enough to send over e-mail so that I can reproduce this locally?
> Is there any debug variable that I may turn on that would help to see what's going on, or anything else that I could try?
Right now I am thinking that this could be one of four potential issues:
1. Dyninst isn't aware of these functions at all and is missing them during parsing
2. Dyninst isn't applying the symbol name to the function correctly (using a generic targXXXX function name instead).
3. Dyninst regex searching is broken and only returning partial results.
4. All of the weak symbols not present in the output point to either no function or the same function (for which in the first case might result in no function being created and in the second case a single function would have X names).
Assuming we can get the "getNames" issue fixed, one of the ways this can be narrowed down is by performing a manual search of all the functions in the binary.
The dyninst function BPatch_image->getAllProcesdures(vector<BPatch_function> &ret) will return every function contained in the binary (or address space if used on a process).
What i suggest is using getAllProcesdures() and comparing the name of each function to the set of "mpi_init" names. If all the names are found, then this is very likely a dyninst regex bug that will have to be tracked down. If this does not find all of
the various mpi_init entries, then we would likely need to directly examine the binary to see what these weak symbols are pointing too.
Ben
On Wed, Jul 17, 2019 at 2:40 PM German Llort Sanchez <german.llort@xxxxxx> wrote:
Hi, |
Previous by Date: | Re: [DynInst_API:] BPatch_image->findFunction() behavior with weak symbols, German Llort Sanchez |
---|---|
Next by Date: | Re: [DynInst_API:] BPatch_image->findFunction() behavior with weak symbols, Tim Haines |
Previous by Thread: | Re: [DynInst_API:] BPatch_image->findFunction() behavior with weak symbols, German Llort Sanchez |
Next by Thread: | Re: [DynInst_API:] BPatch_image->findFunction() behavior with weak symbols, Tim Haines |
Indexes: | [Date] [Thread] |