JDK-8222397 : x86_32 tests with UseSHA1Intrinsics SEGV due to garbled registers
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,12,13
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • CPU: x86
  • Submitted: 2019-04-12
  • Updated: 2022-04-25
  • Resolved: 2019-04-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 12 JDK 13
11.0.4Fixed 12.0.2Fixed 13 b17Fixed
Related Reports
Relates :  
Description
tier2 tests fail while running on TR 2950X and x86_32 builds:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0xee23c1a6, pid=100519, tid=100687
#
# JRE version: OpenJDK Runtime Environment (13.0) (fastdebug build 13-internal+0-adhoc.shade.jdk-jdk)
# Java VM: OpenJDK Server VM (fastdebug 13-internal+0-adhoc.shade.jdk-jdk, mixed mode, tiered, g1 gc, linux-x86)
# Problematic frame:
# J 1062 c2 sun.security.provider.DigestBase.engineUpdate([BII)V java.base@13-internal (189 bytes) @ 0xee23c1a6 [0xee23c060+0x00000146]
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/shade/jdk-jdk/build/linux-x86-server-fastdebug/test-support/jtreg_test_jdk_javax_net_ssl_TLSv1/scratch/7/hs_err_pid100519.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

This fails:
  CONF=linux-x86-server-fastdebug make run-test TEST=javax/net/ssl/TLSv1/

This passes:
  CONF=linux-x86-server-fastdebug make run-test TEST=javax/net/ssl/TLSv1/ TEST_VM_OPTS="-XX:-UseSHA1Intrinsics"

Must be yet another SHA intrinsics bug. This does not reproduce on my other host, i7-7820X, probably because it does not have SHA intrinsics enabled.
Comments
Fix Request This fixes x86_32 on SHA1-enabled hosts. Patch applies cleanly to 12u and 11u, passes tier1 x86_64, affected tests on x86_32. x86_32 tests fail without this patch. Risk is low.
18-04-2019

URL: http://hg.openjdk.java.net/jdk/jdk/rev/66f5241da404 User: shade Date: 2019-04-15 16:22:25 +0000
15-04-2019

RFR: https://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2019-April/033398.html
12-04-2019

Disassembly shows we garble %edi with NULL somehow, and it seems to happen after impl_compressMB call. I think handleSOERegisters is missing in generate_sha1_implCompress in stubGenerator_x86_32.cpp. Funnily enough, it is there in generate_*sha256*_implCompress. So, this patch unbreaks the tests: diff -r 8de62c4af8c7 src/hotspot/cpu/x86/stubGenerator_x86_32.cpp --- a/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp Fri Apr 12 13:35:23 2019 +0800 +++ b/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp Fri Apr 12 12:48:44 2019 +0200 @@ -2968,6 +2968,7 @@ __ enter(); __ subptr(rsp, 8 * wordSize); + handleSOERegisters(true /*saving*/); if (multi_block) { __ push(limit); } @@ -2984,6 +2985,7 @@ if (multi_block) { __ pop(limit); } + handleSOERegisters(false); __ addptr(rsp, 8 * wordSize); __ leave(); __ ret(0);
12-04-2019