Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More fixes for parallel parsing, spring boards, and ARM #592

Merged
merged 17 commits into from May 12, 2019
Merged

Conversation

mxz297
Copy link
Member

@mxz297 mxz297 commented Apr 29, 2019

No description provided.

mxz297 and others added 14 commits April 12, 2019 15:05
…this jump is the only incoming edge of the targXXX function, we should not treat this jump as a tail call.

In theory, it is reasonable either way. However, treating such jump
as a tail call can cause troubles for function entry instrumentation.
If the targXXX function may jump back to the original function, and
thus reach the tail jump. This becomes a recursive tail call.

However, Dyninst relocation seems to have problem adjusting the tail jump
to include entry instrumentation.

2. If the determination of a tail call is changed, we should re-compute
function boundaries, including ret blocks, exit blocks, call edges
DT_DYNINST entry of the .dynamic section points the memory offset of
the trap mapping header. Should use this information to locate
trap mapping table when adjusting trap mapping entries for PIC code
This patch deals with issues where incorrect springboards could be generated.
Specifically addresses three issues:

1. Springboards trampling function data (addresses github issue #551)

2. Required springboards being spilling over block bounds onto
   other required springboards. Prior a if two required springboards were
   located near each other, there was a chance that one of the springboards
   could be partially overwritten resulting in broken behavior.

3. Unsafe reusage of a codegen object where if a trap was needed,
   both a branch and a trap would be written causing bad behavior.
…ic<int>,

rather than just int. A block can be shared by multiple functions. So, when
multiple functions add/remove blocks at the same time, there will be race conditions.
users insert a snippet. The user can continue to insert more snippets to
the same function, which will trigger Dyninst to perform the additional
relocation. So, we need to overwrite existing springboard for newly added
instrumentations.

In other words, we need to overwrite existing springboards if the existing
ones were installed in previous relocations.
…Entry" and "IndirBlockEntry".

Only "FuncEntry" springboards are required because control flow enter instrumentation
through function calls (we relocate the whole function even if only a part of the
function is instrumented).

"IndirBlockEntry" springboards are important for re-directing control flow from
jump tables back to instrumentation. But, it is not as important as "FuncEntry".

2. Jumps to code in another secion should be treated as tail calls.
…nt orders,

which lead to non-deterministic slicing and non-determinisitc jump table analysis.

Therefore, we need to sort source edges in slicing based on the edge's source block
address and edge type to ensure deterministic slicing.
mxz297 added 2 commits May 7, 2019 11:43
…cfs.

We fall back to use ptrace if procfs read & write fail.

This change is for fixing icache coherence issue for ARM dynamic instrumentaiton.
ARM architecture does not guarantee icache-dcache coherence. And writes through
ptrace does not seem to invalidate icache contents and caused SIGILLs
@mxz297
Copy link
Member Author

mxz297 commented May 7, 2019

Fixes #577

@mxz297
Copy link
Member Author

mxz297 commented May 7, 2019

Fixes #551

@hainest
Copy link
Contributor

hainest commented May 10, 2019

Regressions on x86 for test5 series with static linking in rewriter mode (PIC and nonPIC).

@mxz297
Copy link
Member Author

mxz297 commented May 12, 2019

Re-test the PR with the latest master on all three platforms and no regressions.

@mxz297 mxz297 merged commit 9486c91 into master May 12, 2019
@mxz297 mxz297 deleted the pp_springboard branch May 12, 2019 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants