summaryrefslogtreecommitdiffstats
path: root/llkd
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2018-11-19 15:24:03 -0800
committerMark Salyzyn <salyzyn@google.com>2018-11-19 15:26:20 -0800
commitb3418a22555c53c47d2366bab91f6af579504269 (patch)
tree03319e6056c258e29ede64f66014d5be33f4d0bc /llkd
parenteb1213f1707bb6911fd4116d51e17f331abfaa90 (diff)
downloadsystem_core-b3418a22555c53c47d2366bab91f6af579504269.tar.gz
system_core-b3418a22555c53c47d2366bab91f6af579504269.tar.bz2
system_core-b3418a22555c53c47d2366bab91f6af579504269.zip
llkd: do not crash kernel if llkd stops running
Today, assume llkd is not hardened enough to 100% guarantee that lack of progress in inspection loops is a direct result of a livelock condition affecting llkd itself. Log a fatal alarm to make init restart llkd instead for the time being. ToDo: develop trust in llkd regarding sigalarm causes. Test: compile Bug: 119781757 Change-Id: I668dc1773898da6c95aad7221724b16f1684b067
Diffstat (limited to 'llkd')
-rw-r--r--llkd/libllkd.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llkd/libllkd.cpp b/llkd/libllkd.cpp
index 0827470af..427dacef1 100644
--- a/llkd/libllkd.cpp
+++ b/llkd/libllkd.cpp
@@ -555,7 +555,9 @@ void llkPanicKernel(bool dump, pid_t tid, const char* state, const std::string&
}
void llkAlarmHandler(int) {
- llkPanicKernel(false, ::getpid(), "alarm");
+ LOG(FATAL) << "alarm";
+ // NOTREACHED
+ llkPanicKernel(true, ::getpid(), "alarm");
}
milliseconds GetUintProperty(const std::string& key, milliseconds def) {