summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author David Srbecky <dsrbecky@google.com> 2015-06-17 03:52:54 +0100
committer Nicolas Geoffray <ngeoffray@google.com> 2015-06-17 08:08:13 +0000
commita70e5b92a629ca4028d10c9320f9d25f2832a1ab (patch)
tree7dc384b52eb819d877e069722281cb3860c70b2b
parentb3e3000a59a3b0d765840bd1a939213a2b400763 (diff)
CFI test: kill the other process in native code.
Killing it from Java does not seem reliable and the CFI test tends to leave alive processes on the system. This might be particularly troubling on the build bot. Change-Id: I888b61037ab77fb4ff929762ea40af53f7a6ed6e
-rw-r--r--test/137-cfi/cfi.cc6
-rw-r--r--test/137-cfi/src/Main.java2
2 files changed, 4 insertions, 4 deletions
diff --git a/test/137-cfi/cfi.cc b/test/137-cfi/cfi.cc
index 601fbaaea8..59722ad00d 100644
--- a/test/137-cfi/cfi.cc
+++ b/test/137-cfi/cfi.cc
@@ -188,7 +188,7 @@ extern "C" JNIEXPORT jboolean JNICALL Java_Main_unwindOtherProcess(JNIEnv*, jobj
// Were not able to attach, bad.
printf("Failed to attach to other process.\n");
PLOG(ERROR) << "Failed to attach.";
- kill(pid, SIGCONT);
+ kill(pid, SIGKILL);
return JNI_FALSE;
}
@@ -230,8 +230,8 @@ extern "C" JNIEXPORT jboolean JNICALL Java_Main_unwindOtherProcess(JNIEnv*, jobj
PLOG(ERROR) << "Detach failed";
}
- // Continue the process so we can kill it on the Java side.
- kill(pid, SIGCONT);
+ // Kill the other process once we are done with it.
+ kill(pid, SIGKILL);
return result ? JNI_TRUE : JNI_FALSE;
#else
diff --git a/test/137-cfi/src/Main.java b/test/137-cfi/src/Main.java
index a88adc1bcf..6cd187a033 100644
--- a/test/137-cfi/src/Main.java
+++ b/test/137-cfi/src/Main.java
@@ -103,7 +103,7 @@ public class Main implements Comparator<Main> {
System.out.println("Unwinding other process failed.");
}
} finally {
- // Kill the forked process.
+ // Kill the forked process if it is not already dead.
p.destroy();
}
}