History log of /frameworks/native/cmds/lshal/Timeout.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a57dffb151145529e71b22a8d7f985bc1de105f4 21-Feb-2017 Yifan Hong <elsk@google.com> lshal: Fix timeout causes unexpected exits.

with thread::detach the background thread keeps running even after
the thread object is destroyed; the background thread will access
caller's stack memory, causing segfault. Change it to a thread join
to avoid the issue. To avoid waiting too long on the child thread,
send a SIGINT if timeout (child thread's signal handler will then
call pthread_exit() to terminate the thread).

Since we are using pthread_* functions, change usage of std::thread
to pthread_t for consistency.

Test: lshal
Test: run lshal with IPC_CALL_TIMEOUT set to zero will no longer
cause SIGSEGV and SIGABRT (test 10 times)

Bug: 35623669
Change-Id: I4eef8ffd8ff399793648e861ca4c1a2bdcc7ec50
/frameworks/native/cmds/lshal/Timeout.h
38903c0f88efefec3573d9ff3a8e28131da2f3b5 17-Feb-2017 Yifan Hong <elsk@google.com> Fix lshal cannot be run without root

Root cause is invoking copy constructor on a Return<T> object
implicitly, while the old object contains a failed status and
gets destroyed. Use the move constructor instead to fix this.

Test: adb unroot && adb shell lshal
Change-Id: I44710166cc5d7da30bf54b10d1860be1b91dc98a
/frameworks/native/cmds/lshal/Timeout.h
e2dadf0c4f132d3a39309f4e274f1a35f7caaaed 15-Feb-2017 Yifan Hong <elsk@google.com> lshal: Add timeout for IPC calls.

IPC calls into interfaces should be done fault-torelently.
Add a timeout for each IPC call made so that lshal won't be
indefinitely blocked even if the interface don't reply
promptly.

Bug: 35317039

Test: lshal

Change-Id: Icb8157716ad68bddb5b33304b9063aa6f233985d
/frameworks/native/cmds/lshal/Timeout.h