summaryrefslogtreecommitdiff
path: root/debuggerd/libdebuggerd/utility.cpp
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2017-08-25 15:10:48 -0700
committerTom Cherry <tomcherry@google.com>2017-08-25 15:10:48 -0700
commit1ca83249a1748c2458664afa76962e2bb9cdb553 (patch)
tree1d2c4ba2a20ae722b75a775e84a9cc63035c29e8 /debuggerd/libdebuggerd/utility.cpp
parent2732a7e0232d77efbf19d7053f5e5d5d39719910 (diff)
init: fix signal handling and LOG(FATAL) in child processes
Child processes inherit the signal handlers and the 'Aborter' for logging from their parent process. In the case of init, fork()'ed processes, will attempt to reboot the system if they receive a fatal signal or if they call LOG(FATAL). This is not the correct behavior; these processes should terminate due to the provided signal like other processes on the system. This is particularly important as there are multiple LOG(FATAL) calls in service.cpp for failures after fork() but before execv() when a service is started. Note, that pthread_atfork() is not a viable solution since clone() is used in some cases instead of fork() and atfork handlers are not called with clone(). Test: LOG(FATAL) from a child process of init and see that it terminates due to a signal correctly Test: LOG(FATAL) from init proper and see that it reboots to the bootloader Change-Id: I875ebd7a5f6b3f5e3e2c028af3306917c4409db3
Diffstat (limited to 'debuggerd/libdebuggerd/utility.cpp')
0 files changed, 0 insertions, 0 deletions