From c90a2e02b3c1b03362a549a05261a4d0513d6026 Mon Sep 17 00:00:00 2001 From: Simon Atanasyan Date: Tue, 21 Oct 2014 15:43:20 -0700 Subject: [PATCH] Mark run-ptrace-mapper and run-ptrace-misc as XFAIL on MIPS Though PTRACE_SINGLESTEP is defined on MIPS Linux, the kernel does not support that kind of request. The ptrace call failed and sets errno to EIO and paused process is not resumed. In case of run-ptrace-mapper and run-ptrace-misc this leads to hanged execution because next call to wait4 never returns. This change adds run-ptrace-mapper and run-ptrace-misc to the list of 'expected failed' tests on MIPS targets. Signed-off-by: Simon Atanasyan --- tests/Makefile.am | 9 ++++++++- tests/test-ptrace.c | 12 ++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 9c76628c..9c62f922 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -94,9 +94,16 @@ check_SCRIPTS = $(check_SCRIPTS_common) $(check_SCRIPTS_cdep) \ TESTS = $(check_PROGRAMS) $(check_SCRIPTS) +XFAIL_TESTS = if !ARCH_IA64 -XFAIL_TESTS = Gtest-dyn1 Ltest-dyn1 +XFAIL_TESTS += Gtest-dyn1 Ltest-dyn1 +endif + +if ARCH_MIPS +# MIPS kernel does not support PTRACE_SINGLESTEP +# ptrace request used in the tests. +XFAIL_TESTS += run-ptrace-mapper run-ptrace-misc endif noinst_PROGRAMS = $(noinst_PROGRAMS_common) $(noinst_PROGRAMS_cdep) \ diff --git a/tests/test-ptrace.c b/tests/test-ptrace.c index 942b0db4..a5b71ddb 100644 --- a/tests/test-ptrace.c +++ b/tests/test-ptrace.c @@ -303,9 +303,17 @@ main (int argc, char **argv) { do_backtrace (); #if HAVE_DECL_PTRACE_SINGLESTEP - ptrace (PTRACE_SINGLESTEP, target_pid, 0, pending_sig); + if (ptrace (PTRACE_SINGLESTEP, target_pid, 0, pending_sig) < 0) + { + panic ("ptrace(PTRACE_SINGLESTEP) failed (errno=%d)\n", errno); + killed = 1; + } #elif HAVE_DECL_PT_STEP - ptrace (PT_STEP, target_pid, (caddr_t)1, pending_sig); + if (ptrace (PT_STEP, target_pid, (caddr_t)1, pending_sig) < 0) + { + panic ("ptrace(PT_STEP) failed (errno=%d)\n", errno); + killed = 1; + } #else #error Singlestep me #endif