Commit Graph

5 Commits

Author SHA1 Message Date
Treehugger Robot
e07c0cffe2 Merge "LockAgent: Refactor transformation code" 2019-06-27 19:21:50 +00:00
Andreas Gampe
8695b40720 LockAgent: Add option to synthesize Java crash logging
Add the ability to dump a "crash" to logcat.

Test: m
Test: manual
Change-Id: I0692a91df995883e526a718fe95f0d3568ac9328
2019-06-20 16:31:58 -07:00
Andreas Gampe
5e2a8849c7 LockAgent: Add ability to generate a native crash
Use the crasher to create a tombstone with the violation as the abort
message.

Test: m
Test: manual
Change-Id: I8c5041a4fbffedb11b6b9c564ab1e214551896bf
2019-06-20 16:30:06 -07:00
Andreas Gampe
cbc93c76b0 LockAgent: Refactor transformation code
Extract a helper class.

Bug: 124744938
Test: m
Test: manual
Change-Id: I9fb6b4b5d7bc47f4233cacef8a192989563ce279
2019-04-19 13:38:34 -07:00
Andreas Gampe
72ede720e2 Framework: Lock inversion checker
Add an agent-based lock inversion checker. The agent will dynamically
rewrite bytecode to inject calls to LockHook, which runs a checker
on these.

Implement a simple on-thread checker that keeps a per-thread stack
of locks and a global map of lock ordering. As-is, transitivity of
checks is not guaranteed, but should be captured in most practical
cases.

To run a process with the lock checker, start the process with the
agent. The helper script start_with_lockagent.sh can be used for this:

  adb shell setprop wrap.pkg-name script start_with_lockagent

(cherry picked from commit aeb6fce5b3)

Bug: 124744938
Test: manual
Merged-In: Idd9a7066a5b8cb8c0de2e995f08759c98d9473e1
Change-Id: Idd9a7066a5b8cb8c0de2e995f08759c98d9473e1
2019-04-12 10:46:04 -07:00