aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>2013-02-06 00:33:04 -0500
committerChen Gong <gong.chen@linux.intel.com>2013-02-06 02:30:04 -0500
commit3d9e45e10a4a197e47d18bb691404295666bd115 (patch)
treed6d52e97444d56c7c9527f915ab9c55e043996f1
parent604eaac573ee5095080f62bf4a020c1dbd182577 (diff)
downloadmce-test-3d9e45e10a4a197e47d18bb691404295666bd115.tar.gz
hwpoison: check with CLD_KILLED|CLD_DUMPED instead of just CLD_KILLED
tinjpage and ttranshuge can get SIGCHLD(CLD_DUMPED) from their child processes, but now they only check CLD_KILLED, so tests fail. This behavior of the kernel might not be wrong, because the defalut action of the SIGBUS is 'coredump', not 'terminate' (see comments in include/linux/signal.h). With this patch, we accept SIGCHLD(CLD_DUMPED) as a correct behavior. Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
-rw-r--r--cases/function/hwpoison/tinjpage.c6
-rw-r--r--cases/function/hwpoison/ttranshuge.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/cases/function/hwpoison/tinjpage.c b/cases/function/hwpoison/tinjpage.c
index dcb973c..ec6dd66 100644
--- a/cases/function/hwpoison/tinjpage.c
+++ b/cases/function/hwpoison/tinjpage.c
@@ -54,6 +54,8 @@
#define cpu_relax() mb()
#endif
+#define CLD_KILLDUMP (CLD_KILLED|CLD_DUMPED)
+
typedef unsigned long long u64;
int PS;
@@ -723,7 +725,7 @@ static void do_shared(int shared_mode)
sigaction(SIGBUS, NULL, &sigact);
if (sigact.sa_handler == SIG_DFL) {/* suicide version */
- if (sig.si_code != CLD_KILLED)
+ if (!(sig.si_code & CLD_KILLDUMP))
goto child_error;
} else { /* late kill */
if (sig.si_code != CLD_EXITED)
@@ -941,7 +943,7 @@ int main(int ac, char **av)
failure++;
}
} else {
- if (sig.si_code != CLD_KILLED || sig.si_status != SIGBUS) {
+ if (!(sig.si_code & CLD_KILLDUMP) || sig.si_status != SIGBUS) {
printf("XXX: %s: child not killed by SIGBUS\n", t->name);
failure++;
}
diff --git a/cases/function/hwpoison/ttranshuge.c b/cases/function/hwpoison/ttranshuge.c
index 6313591..7d77b7c 100644
--- a/cases/function/hwpoison/ttranshuge.c
+++ b/cases/function/hwpoison/ttranshuge.c
@@ -420,7 +420,7 @@ free_mem:
} else
print_failure("Child process could not survive.\n");
} else {
- if (sig.si_code == CLD_KILLED && sig.si_status == SIGBUS) {
+ if ((sig.si_code & (CLD_KILLED|CLD_DUMPED)) && sig.si_status == SIGBUS) {
print_success("Child process was killed by SIGBUS.\n");
ret = THP_SUCCESS;
} else