From: "Mike Rapoport (Microsoft)" Injection of a memory error with madvise() causes SIGBUS, which terminates the hugetlb-read-hwpoison test prematurely. Add a dummy SIGBUS handler to allow the test to continue regardless of SIGBUS. Tested-by: Sarthak Sharma Tested-by: Li Wang Reviewed-by: Li Wang Tested-by: Luiz Capitulino Signed-off-by: Mike Rapoport (Microsoft) --- tools/testing/selftests/mm/hugetlb-read-hwpoison.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/mm/hugetlb-read-hwpoison.c b/tools/testing/selftests/mm/hugetlb-read-hwpoison.c index 46230462ad48..ad3198b444ce 100644 --- a/tools/testing/selftests/mm/hugetlb-read-hwpoison.c +++ b/tools/testing/selftests/mm/hugetlb-read-hwpoison.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "kselftest.h" @@ -261,6 +262,10 @@ static int create_hugetlbfs_file(struct statfs *file_stat) return -1; } +static void sigbus_handler(int sig) +{ +} + int main(void) { int fd; @@ -273,6 +278,7 @@ int main(void) }; size_t i; + signal(SIGBUS, sigbus_handler); for (i = 0; i < ARRAY_SIZE(wr_chunk_sizes); ++i) { printf("Write/read chunk size=0x%lx\n", wr_chunk_sizes[i]); -- 2.53.0