From thomas.stuefe at gmail.com Tue Mar 21 13:40:58 2017 From: thomas.stuefe at gmail.com (=?UTF-8?Q?Thomas_St=C3=BCfe?=) Date: Tue, 21 Mar 2017 14:40:58 +0100 Subject: (jdk10) RFR(xxs): 8176872: [s390] wrong pc shown in error logs Message-ID: 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. (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.) Kind Regards, Thomas From david.holmes at oracle.com Tue Mar 21 23:47:32 2017 From: david.holmes at oracle.com (David Holmes) Date: Wed, 22 Mar 2017 09:47:32 +1000 Subject: (jdk10) RFR(xxs): 8176872: [s390] wrong pc shown in error logs In-Reply-To: References: Message-ID: <1dec1551-aa58-568a-87af-fdc4aff0acf5@oracle.com> 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 > From thomas.stuefe at gmail.com Wed Mar 22 08:05:36 2017 From: thomas.stuefe at gmail.com (=?UTF-8?Q?Thomas_St=C3=BCfe?=) Date: Wed, 22 Mar 2017 09:05:36 +0100 Subject: (jdk10) RFR(xxs): 8176872: [s390] wrong pc shown in error logs In-Reply-To: <1dec1551-aa58-568a-87af-fdc4aff0acf5@oracle.com> References: <1dec1551-aa58-568a-87af-fdc4aff0acf5@oracle.com> Message-ID: Hi David, thanks for the review! Let's keep the s390-only solution for now. Cleanup can be done in a separate fix. Kind Regards, Thomas On Wed, Mar 22, 2017 at 12:47 AM, David Holmes wrote: > 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-wron >> g-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 >> >> From thomas.stuefe at gmail.com Thu Mar 23 12:49:52 2017 From: thomas.stuefe at gmail.com (=?UTF-8?Q?Thomas_St=C3=BCfe?=) Date: Thu, 23 Mar 2017 13:49:52 +0100 Subject: RFR(xxxs): 8177458: [s390] (jdk10) build broken after 8155672 Message-ID: Hi all, may I have a review for this very tiny fix. Just a typo, which breaks the s390 build. https://bugs.openjdk.java.net/browse/JDK-8177458 http://cr.openjdk.java.net/~stuefe/webrevs/8177458-s390-build-broken-after-8155672/jdk10-webrev.00/webrev/ Thank you, Thomas From thomas.stuefe at gmail.com Thu Mar 23 12:58:45 2017 From: thomas.stuefe at gmail.com (=?UTF-8?Q?Thomas_St=C3=BCfe?=) Date: Thu, 23 Mar 2017 13:58:45 +0100 Subject: (jdk10) RFR(xxs): 8176872: [s390] wrong pc shown in error logs In-Reply-To: References: <1dec1551-aa58-568a-87af-fdc4aff0acf5@oracle.com> Message-ID: Hi, a second webrev: http://cr.openjdk.java.net/~stuefe/webrevs/8176872-s390-wrong-pc-in-errorlogs/jdk10-webrev.01/webrev/ I forgot that the pc inside the secondary signal handler for crashes during error reporting needs to be adjusted too. Also, I need a second reviewer. Thanks, Thomas On Wed, Mar 22, 2017 at 9:05 AM, Thomas St?fe wrote: > Hi David, thanks for the review! Let's keep the s390-only solution for > now. Cleanup can be done in a separate fix. > > Kind Regards, Thomas > > On Wed, Mar 22, 2017 at 12:47 AM, David Holmes > wrote: > >> 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-wron >>> g-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 >>> >>> > From volker.simonis at gmail.com Thu Mar 23 14:38:47 2017 From: volker.simonis at gmail.com (Volker Simonis) Date: Thu, 23 Mar 2017 15:38:47 +0100 Subject: RFR(xxxs): 8177458: [s390] (jdk10) build broken after 8155672 In-Reply-To: References: Message-ID: Hi Thomas, looks good! Thanks for catching and fixing this, Volker On Thu, Mar 23, 2017 at 1:49 PM, Thomas St?fe wrote: > Hi all, > > may I have a review for this very tiny fix. Just a typo, which breaks the > s390 build. > > https://bugs.openjdk.java.net/browse/JDK-8177458 > http://cr.openjdk.java.net/~stuefe/webrevs/8177458-s390-build-broken-after-8155672/jdk10-webrev.00/webrev/ > > Thank you, > > Thomas From volker.simonis at gmail.com Thu Mar 23 14:40:28 2017 From: volker.simonis at gmail.com (Volker Simonis) Date: Thu, 23 Mar 2017 15:40:28 +0100 Subject: RFR(xxxs): 8177458: [s390] (jdk10) build broken after 8155672 In-Reply-To: References: Message-ID: ..and I forgot to say - this is trivial and s390 only. So you can push it right away. On Thu, Mar 23, 2017 at 3:38 PM, Volker Simonis wrote: > Hi Thomas, > > looks good! > > Thanks for catching and fixing this, > Volker > > > On Thu, Mar 23, 2017 at 1:49 PM, Thomas St?fe wrote: >> Hi all, >> >> may I have a review for this very tiny fix. Just a typo, which breaks the >> s390 build. >> >> https://bugs.openjdk.java.net/browse/JDK-8177458 >> http://cr.openjdk.java.net/~stuefe/webrevs/8177458-s390-build-broken-after-8155672/jdk10-webrev.00/webrev/ >> >> Thank you, >> >> Thomas From thomas.stuefe at gmail.com Thu Mar 23 16:48:04 2017 From: thomas.stuefe at gmail.com (=?UTF-8?Q?Thomas_St=C3=BCfe?=) Date: Thu, 23 Mar 2017 17:48:04 +0100 Subject: RFR(xxxs): 8177458: [s390] (jdk10) build broken after 8155672 In-Reply-To: References: Message-ID: ok thanks On Thu, Mar 23, 2017 at 3:40 PM, Volker Simonis wrote: > ..and I forgot to say - this is trivial and s390 only. So you can push > it right away. > > On Thu, Mar 23, 2017 at 3:38 PM, Volker Simonis > wrote: > > Hi Thomas, > > > > looks good! > > > > Thanks for catching and fixing this, > > Volker > > > > > > On Thu, Mar 23, 2017 at 1:49 PM, Thomas St?fe > wrote: > >> Hi all, > >> > >> may I have a review for this very tiny fix. Just a typo, which breaks > the > >> s390 build. > >> > >> https://bugs.openjdk.java.net/browse/JDK-8177458 > >> http://cr.openjdk.java.net/~stuefe/webrevs/8177458-s390- > build-broken-after-8155672/jdk10-webrev.00/webrev/ > >> > >> Thank you, > >> > >> Thomas > From thomas.stuefe at gmail.com Thu Mar 23 16:59:09 2017 From: thomas.stuefe at gmail.com (=?UTF-8?Q?Thomas_St=C3=BCfe?=) Date: Thu, 23 Mar 2017 17:59:09 +0100 Subject: RFR(xxxs): 8177458: [s390] (jdk10) build broken after 8155672 In-Reply-To: References: Message-ID: Thanks Volker, the change is pushed. Kind regards, Thomas On Thu, Mar 23, 2017 at 3:40 PM, Volker Simonis wrote: > ..and I forgot to say - this is trivial and s390 only. So you can push > it right away. > > On Thu, Mar 23, 2017 at 3:38 PM, Volker Simonis > wrote: > > Hi Thomas, > > > > looks good! > > > > Thanks for catching and fixing this, > > Volker > > > > > > On Thu, Mar 23, 2017 at 1:49 PM, Thomas St?fe > wrote: > >> Hi all, > >> > >> may I have a review for this very tiny fix. Just a typo, which breaks > the > >> s390 build. > >> > >> https://bugs.openjdk.java.net/browse/JDK-8177458 > >> http://cr.openjdk.java.net/~stuefe/webrevs/8177458-s390- > build-broken-after-8155672/jdk10-webrev.00/webrev/ > >> > >> Thank you, > >> > >> Thomas > From david.holmes at oracle.com Thu Mar 23 21:13:11 2017 From: david.holmes at oracle.com (David Holmes) Date: Fri, 24 Mar 2017 07:13:11 +1000 Subject: RFR(xxxs): 8177458: [s390] (jdk10) build broken after 8155672 In-Reply-To: References: Message-ID: Took me 5 readings of that line to spot the difference! :) Sorry for the inconvenience. David On 23/03/2017 10:49 PM, Thomas St?fe wrote: > Hi all, > > may I have a review for this very tiny fix. Just a typo, which breaks the > s390 build. > > https://bugs.openjdk.java.net/browse/JDK-8177458 > http://cr.openjdk.java.net/~stuefe/webrevs/8177458-s390-build-broken-after-8155672/jdk10-webrev.00/webrev/ > > Thank you, > > Thomas > From thomas.stuefe at gmail.com Thu Mar 23 21:27:00 2017 From: thomas.stuefe at gmail.com (=?UTF-8?Q?Thomas_St=C3=BCfe?=) Date: Thu, 23 Mar 2017 21:27:00 +0000 Subject: RFR(xxxs): 8177458: [s390] (jdk10) build broken after 8155672 In-Reply-To: References: Message-ID: Good one, wasn't it :-) but no worries, we are happy that you change our platform files too, even if you have to do it blindly. Typos are easy to fix. ..Thomas On Thu, 23 Mar 2017 at 22:13, David Holmes wrote: Took me 5 readings of that line to spot the difference! :) Sorry for the inconvenience. David On 23/03/2017 10:49 PM, Thomas St?fe wrote: > Hi all, > > may I have a review for this very tiny fix. Just a typo, which breaks the > s390 build. > > https://bugs.openjdk.java.net/browse/JDK-8177458 > http://cr.openjdk.java.net/~stuefe/webrevs/8177458-s390-build-broken-after-8155672/jdk10-webrev.00/webrev/ > > Thank you, > > Thomas > From david.holmes at oracle.com Sat Mar 25 01:19:34 2017 From: david.holmes at oracle.com (David Holmes) Date: Sat, 25 Mar 2017 11:19:34 +1000 Subject: (jdk10) RFR(xxs): 8176872: [s390] wrong pc shown in error logs In-Reply-To: References: <1dec1551-aa58-568a-87af-fdc4aff0acf5@oracle.com> Message-ID: Hi Thomas, On 23/03/2017 10:58 PM, Thomas St?fe wrote: > Hi, > > a second > webrev: http://cr.openjdk.java.net/~stuefe/webrevs/8176872-s390-wrong-pc-in-errorlogs/jdk10-webrev.01/webrev/ > > I forgot that the pc inside the secondary signal handler for crashes > during error reporting needs to be adjusted too. Ah - so no longer a s390-only fix. :( Will need to consider whether we should update to always access si_addr. David > Also, I need a second reviewer. > > Thanks, Thomas > > On Wed, Mar 22, 2017 at 9:05 AM, Thomas St?fe > wrote: > > Hi David, thanks for the review! Let's keep the s390-only solution > for now. Cleanup can be done in a separate fix. > > Kind Regards, Thomas > > On Wed, Mar 22, 2017 at 12:47 AM, David Holmes > > wrote: > > 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 > > > From thomas.stuefe at gmail.com Mon Mar 27 08:24:10 2017 From: thomas.stuefe at gmail.com (=?UTF-8?Q?Thomas_St=C3=BCfe?=) Date: Mon, 27 Mar 2017 10:24:10 +0200 Subject: (jdk10) RFR(xxs): 8176872: [s390] wrong pc shown in error logs In-Reply-To: <65206847-05fb-0d37-2594-a301320055b9@oracle.com> References: <65206847-05fb-0d37-2594-a301320055b9@oracle.com> Message-ID: Hi Dmitry, David, Alternative suggestion: We could fix it in vmError.cpp for all posix platforms. In our codebase we have done this, surrounded by "#ifndef _WIN32". That would fix the issue for error handling on all posix platforms. If a platform needs to handle this elsewhere (probably in signal handling), they can do it their own way in the platform-dependend signal handler - like s390 does today already. What do you think? I originally did not suggest this because I know you guys hate "#ifdefs" in shared coding. Kind Regards, Thomas On Sun, Mar 26, 2017 at 12:22 PM, Dmitry Samersoff < dmitry.samersoff at oracle.com> wrote: > Thomas, > > Looks good to me, > > We may consider to always use info->si_addr. > > Nits: > > vmError_posix.cpp > > 118: > Please change uc ? ... to (uc == NULL) ? ... > > 122: (and os_linux_s390.cpp:513) > > Space missed after (address) ... > > > -Dmitry > > > On 2017-03-21 16:40, 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. > > > > (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.) > > > > Kind Regards, Thomas > > > > > -- > Dmitry Samersoff > Oracle Java development team, Saint Petersburg, Russia > * I would love to change the world, but they won't give me the sources. > From dmitry.samersoff at oracle.com Sun Mar 26 10:22:18 2017 From: dmitry.samersoff at oracle.com (Dmitry Samersoff) Date: Sun, 26 Mar 2017 13:22:18 +0300 Subject: (jdk10) RFR(xxs): 8176872: [s390] wrong pc shown in error logs In-Reply-To: References: Message-ID: <65206847-05fb-0d37-2594-a301320055b9@oracle.com> Thomas, Looks good to me, We may consider to always use info->si_addr. Nits: vmError_posix.cpp 118: Please change uc ? ... to (uc == NULL) ? ... 122: (and os_linux_s390.cpp:513) Space missed after (address) ... -Dmitry On 2017-03-21 16:40, 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. > > (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.) > > Kind Regards, Thomas > -- Dmitry Samersoff Oracle Java development team, Saint Petersburg, Russia * I would love to change the world, but they won't give me the sources.