Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Unified Diff: src/trusted/nonnacl_util/posix/sel_ldr_launcher_posix.cc

Issue 7942008: NaCl repo side changes to make crash reporting more reliable. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/trusted/nonnacl_util/win/sel_ldr_launcher_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/nonnacl_util/posix/sel_ldr_launcher_posix.cc
===================================================================
--- src/trusted/nonnacl_util/posix/sel_ldr_launcher_posix.cc (revision 6725)
+++ src/trusted/nonnacl_util/posix/sel_ldr_launcher_posix.cc (working copy)
@@ -33,6 +33,15 @@
CloseHandlesAfterLaunch();
if (kInvalidHandle != child_process_) {
int status;
+ // Ensure child process (service runtime) is kaput. NB: we might
+ // close the command channel (or use the hard_shutdown RPC) rather
+ // than killing the process to allow the service runtime to do
+ // clean up, but the plugin should be responsible for that and we
+ // shouldn't introduce any timeout wait in a dtor. Currently,
+ // ServiceRuntime::Shutdown kills the subprocess before closing
+ // the command channel, so we aren't providing the opportunity for
+ // a more graceful shutdown.
+ KillChildProcess();
waitpid(child_process_, &status, 0);
}
if (kInvalidHandle != channel_) {
@@ -112,6 +121,14 @@
}
bool SelLdrLauncher::KillChildProcess() {
+ if (kInvalidHandle == child_process_) {
+ // It is incorrect to use the kill syscall on kInvalidHandle as
+ // the pid, since using -1 as pid is defined by POSIX.1-2001 to
+ // send the signal (SIGKILL) to every process that the calling
+ // process may send signals to (except for init), which is
+ // Definitely Not What Was Intended for this.
+ return true;
+ }
return 0 == kill(child_process_, SIGKILL);
// We cannot set child_process_ to kInvalidHandle since we will want to wait
// on its exit status.
« no previous file with comments | « no previous file | src/trusted/nonnacl_util/win/sel_ldr_launcher_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698