Q: s390/s390x SIGSEGV SEGV_MAPERR reporting

Dmitry V. Levin ldv at altlinux.org
Sat Feb 28 20:09:58 UTC 2015


On Sat, Feb 28, 2015 at 02:38:45PM -0500, Mike Frysinger wrote:
> On 28 Feb 2015 18:40, Dmitry V. Levin wrote:
> > On Fri, Feb 27, 2015 at 01:06:22AM -0500, Mike Frysinger wrote:
> > > vFAIL: test; s390/32-bit/MSB linux-3.18.1 kernel-headers-3.16.0 glibc-2.19 gcc-4.8.3
> > > FAIL: pc.test
> > > 00400000-00401000 r-xp 00000000 5e:05 17513 /home/vapier/strace/tests/pc
> > > 00401000-00402000 r--p 00000000 5e:05 17513 /home/vapier/strace/tests/pc
> > > [pid 24037] [fd4eaa6e] munmap(0x400000, 8192) = 0
> > > [pid 24037] [80400702] --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x400000} ---
> > 
> > > vFAIL: test; s390x/64-bit/MSB linux-3.18.1 kernel-headers-3.16.0 glibc-2.19 gcc-4.8.3
> > > 80000000-80001000 r-xp 00000000 5e:05 28901 /home/vapier/strace/tests/pc
> > > 80001000-80002000 r--p 00000000 5e:05 28901 /home/vapier/strace/tests/pc
> > > [pid 17223] [000003fffd1cf31a] munmap(0x80000000, 8192) = 0
> > > [pid 17223] [00000000800008f4] --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x80000000} ---
> > 
> > On all other architectures we tested si_addr matches instruction pointer.
> > Could it be an s390/s390x kernel bug in SIGSEGV SEGV_MAPERR reporting?
> 
> that does look like the case.  this change to the kernel lets the test pass:
> 
> --- a/arch/s390/mm/fault.c
> +++ b/arch/s390/mm/fault.c
> @@ -282,7 +282,7 @@
>  	report_user_fault(regs, SIGSEGV);
>  	si.si_signo = SIGSEGV;
>  	si.si_code = si_code;
> -	si.si_addr = (void __user *)(regs->int_parm_long & __FAIL_ADDR_MASK);
> +	si.si_addr = (void __user *)regs->psw.addr;
>  	force_sig_info(SIGSEGV, &si, current);
>  }

Thanks.  __FAIL_ADDR_MASK certainly shouldn't be applied in this case,
passing unmodified regs->int_parm_long will fix s390x.  Not sure about
replacing int_parm_long with psw.addr -- it would surely make the test
pass, but whether strace is correct in printing unmodified psw.addr as
instruction pointer on s390?


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20150228/8fd409eb/attachment.bin>


More information about the Strace-devel mailing list