Created attachment 52212 [details]
patch that changes two things in faultstatus
Version: 3.6 SVN
The faultstatus testcase fails on s390, even without valgrind.
Two things I would like to change in the testcase:
1. The testcase opens the file without O_RDWR, resulting in the truncate below to (unnoticeably) fail:
open("faultstatus.tmp", O_RDONLY|O_CREAT|O_EXCL|O_TRUNC, 0600) = 3
unlink("faultstatus.tmp") = 0
ftruncate(3, 16384) = -1 EINVAL (Invalid argument)
The access now triggers two faults: 1. beyond defined memory (SIGBUS), write on read-only-mapping (SIGSEGV), whatever comes first. On x86 this causes SIGBUS, but on s390 this causes SIGSEGV.
This patch uses O_RDWR to make the truncate succeed.
2. On s390 a page fault only gives us the page address, but not the address within a page. 0x1234 becomes 0x1000. There might be other architectures with the same problem.
Question: Should that patch go in via the s390x patch or shall we add this fix directly (at least the failing trucate should be fixed)
Created attachment 52650 [details]
The problem fault address vs. reported fault address also happens for test3.
Due to a kernel bug on s390 (si_code=128 instead of 2) this was not visible.
The kernel bug will be fixed in the next merge window
but we need the generalise the modifications of the fault address. Here is an improved patch.