(jdk10) RFR(xxs): 8176872: [s390] wrong pc shown in error logs
David Holmes
david.holmes at oracle.com
Tue Mar 21 23:47:32 UTC 2017
Hi Thomas,
On 21/03/2017 11:40 PM, Thomas Stüfe wrote:
> Hi all,
>
> please take a look at this tiny fix. It fixes the pc shown as faulting
> address for SIGILL and SIGFPE in hs_err files.
>
> https://bugs.openjdk.java.net/browse/JDK-8176872
> http://cr.openjdk.java.net/~stuefe/webrevs/8176872-s390-wrong-pc-in-errorlogs/jdk10-webrev.00/webrev/
>
> When determining the crash pc, in all posix platform signal handlers pc is
> taken from the context. However, context.pc on zlinux points to the
> instruction *after* the faulting op. The correct way, according to POSIX,
> would be to take the address from siginfo_t->si_addr for signals SIGILL,
> SIGFPE.
Well si_addr is the platform independent POSIX way of getting the
address. Getting it from the uc_mcontext is architecture specific and
seemingly not specified as to what the "pc" actually contains - the
faulting instruction or the next instruction. If it were specified then
the bug might be in zlinux :)
> (actually, this patch would make sense for all POSIX platforms, but only
> s390 seems to show this error, so I leave the patch local to s390.)
I think it is historical that we get the PC from the uc_mcontext because
originally we did not have SA_SIGINFO available. So a broader cleanup of
this code is certainly possible. But for now this S390 fix seems fine.
Thanks,
David
-----
> Kind Regards, Thomas
>
More information about the hotspot-runtime-dev
mailing list