SEGV from org.bouncycastle.math.ec.custom.sec.SecP384R1Field.reduce

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

SEGV from org.bouncycastle.math.ec.custom.sec.SecP384R1Field.reduce

Chris Toomey
Hi, we're using version 1.67 of bcprov-jdk15on and just got the following SEGV. We'd previously been on version 1.60 and experienced the same SEGV there.

I searched both the archives for this list and the issue tracker and didn't find mention of this. Should I open a ticket for it?

thanks,
Chris

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f6a44a9f1b5, pid=8408, tid=0x00007f699d43e700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_92-b14) (build 1.8.0_92-b14)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.92-b14 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# J 1146273 C2 org.bouncycastle.math.ec.custom.sec.SecP384R1Field.reduce([I[I)V (636 bytes) @ 0x00007f6a44a9f1b5 [0x00007f6a44a9ef40+0x275]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

---------------  T H R E A D  ---------------

Current thread (0x00007f6a1c031000):  JavaThread "application-akka.actor.default-dispatcher-28" [_thread_in_Java, id=8787, stack(0x00007f699d33e000,0x00007f699d43f000)]

siginfo: si_signo: 11 (SIGSEGV), si_code: 128 (SI_KERNEL), si_addr: 0x0000000000000000
Reply | Threaded
Open this post in threaded view
|

Re: SEGV from org.bouncycastle.math.ec.custom.sec.SecP384R1Field.reduce

Lothar Kimmeringer-4
Hi,

Am 27.01.2021 um 23:49 schrieb Chris Toomey:
> Hi, we're using version 1.67 of bcprov-jdk15on and just got the following SEGV.
> We'd previously been on version 1.60 and experienced the same SEGV there.

[...]

> # JRE version: Java(TM) SE Runtime Environment (8.0_92-b14) (build 1.8.0_92-b14)

Can you provide the source of the test that reproduces the SEGV and can you
try to use a JRE that hasn't expired in July 2016?

> # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.92-b14 mixed mode linux-amd64 compressed oops)
> # Problematic frame:
> # J 1146273 C2 org.bouncycastle.math.ec.custom.sec.SecP384R1Field.reduce([I[I)V (636 bytes) @ 0x00007f6a44a9f1b5 [0x00007f6a44a9ef40+0x275]

Can you provide the complete stacktrace of the segfaulting thread? Is it
by coincidence similar to
https://bugs.openjdk.java.net/browse/JDK-8160163

> Should I open a ticket for it?

You might do that but I'd put my money on a problem on your side.
BouncyCastle is a pure Java implementation so SEGVs are most
likely a problem with the JRE or the underlying operating system.
Given the age of the VM I'd suspect that the OS is of similar
age and might still have the FPU (XMM) corruption bug that is
mentioned in above bug report.


Cheers, Lothar

Reply | Threaded
Open this post in threaded view
|

Re: SEGV from org.bouncycastle.math.ec.custom.sec.SecP384R1Field.reduce

David Hook-3
In reply to this post by Chris Toomey

Unfortunately Lothar is largely correct, although a shorter answer is there's nowhere to open a ticket.

There's nothing wrong with the Java code, there probably is something wrong with the JIT. Assuming you're stuck on that version of Java for other reasons, the only thing you could try is to (carefully) rewrite the code that's failing in order to avoid the JIT issue. We have seen things like this before, but the only answer is to change the operators generated and avoid the JIT bug. You might want to check through the Java release notes to see if there are any reported bug fixes for the JIT which suggest what the root cause is.

Sorry to be delivering the news.

David

On 28/1/21 9:49 am, Chris Toomey wrote:
Hi, we're using version 1.67 of bcprov-jdk15on and just got the following SEGV. We'd previously been on version 1.60 and experienced the same SEGV there.

I searched both the archives for this list and the issue tracker and didn't find mention of this. Should I open a ticket for it?

thanks,
Chris

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f6a44a9f1b5, pid=8408, tid=0x00007f699d43e700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_92-b14) (build 1.8.0_92-b14)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.92-b14 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# J 1146273 C2 org.bouncycastle.math.ec.custom.sec.SecP384R1Field.reduce([I[I)V (636 bytes) @ 0x00007f6a44a9f1b5 [0x00007f6a44a9ef40+0x275]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

---------------  T H R E A D  ---------------

Current thread (0x00007f6a1c031000):  JavaThread "application-akka.actor.default-dispatcher-28" [_thread_in_Java, id=8787, stack(0x00007f699d33e000,0x00007f699d43f000)]

siginfo: si_signo: 11 (SIGSEGV), si_code: 128 (SI_KERNEL), si_addr: 0x0000000000000000


Reply | Threaded
Open this post in threaded view
|

Re: SEGV from org.bouncycastle.math.ec.custom.sec.SecP384R1Field.reduce

Chris Toomey
Thanks Lothar and David, jeez feel stupid for not realizing how old a JRE we've been using, will get that upgraded ASAP.

Thanks much for your help and quick response.

Chris


On Thu, Jan 28, 2021 at 4:13 AM David Hook <[hidden email]> wrote:

Unfortunately Lothar is largely correct, although a shorter answer is there's nowhere to open a ticket.

There's nothing wrong with the Java code, there probably is something wrong with the JIT. Assuming you're stuck on that version of Java for other reasons, the only thing you could try is to (carefully) rewrite the code that's failing in order to avoid the JIT issue. We have seen things like this before, but the only answer is to change the operators generated and avoid the JIT bug. You might want to check through the Java release notes to see if there are any reported bug fixes for the JIT which suggest what the root cause is.

Sorry to be delivering the news.

David

On 28/1/21 9:49 am, Chris Toomey wrote:
Hi, we're using version 1.67 of bcprov-jdk15on and just got the following SEGV. We'd previously been on version 1.60 and experienced the same SEGV there.

I searched both the archives for this list and the issue tracker and didn't find mention of this. Should I open a ticket for it?

thanks,
Chris

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f6a44a9f1b5, pid=8408, tid=0x00007f699d43e700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_92-b14) (build 1.8.0_92-b14)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.92-b14 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# J 1146273 C2 org.bouncycastle.math.ec.custom.sec.SecP384R1Field.reduce([I[I)V (636 bytes) @ 0x00007f6a44a9f1b5 [0x00007f6a44a9ef40+0x275]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

---------------  T H R E A D  ---------------

Current thread (0x00007f6a1c031000):  JavaThread "application-akka.actor.default-dispatcher-28" [_thread_in_Java, id=8787, stack(0x00007f699d33e000,0x00007f699d43f000)]

siginfo: si_signo: 11 (SIGSEGV), si_code: 128 (SI_KERNEL), si_addr: 0x0000000000000000