Add way to ensure we are at the front of the sigaction chain
Calling this after jni_on_load fixes the unity apps. This is
not exactly correct since we may already have the following chain.
Start up:
Us -> debuggerd
After app goes in front:
App -> us -> debuggerd
After we put ourself back at the front:
Us -> app -> us -> app -> .... stack overflow.
Bug: 17620677
Change-Id: I9183997e3d5ebd51c320b5d51425be5142e938f3
(cherry picked from commit 1f24296c7c8a6501ee2388c0d20b48f471b48660)
diff --git a/sigchainlib/sigchain_dummy.cc b/sigchainlib/sigchain_dummy.cc
index 7176f05..fbc8c3f 100644
--- a/sigchainlib/sigchain_dummy.cc
+++ b/sigchainlib/sigchain_dummy.cc
@@ -57,3 +57,8 @@
log("InitializeSignalChain is not exported by the main executable.");
abort();
}
+
+extern "C" void EnsureFrontOfChain(int signal, struct sigaction* expected_action) {
+ log("EnsureFrontOfChain is not exported by the main executable.");
+ abort();
+}