APAR status
Closed as program error.
Error description
Error Message: SIGSEGV is received when JIT compiling a method which makes use of a java switch statement where subtracting case<OSB>i<CSB> and case<OSB>i-1<CSB> would cause a 32bit integer overflow. . Stack Trace: TR_PPCMachine::freeBestRegister(TR_Instruction*,TR_Register*,TR_ PPCRealRegister*,bool) TR_PPCMachine::assignOneRegister(TR_Instruction*,TR_Register*,bo ol) TR_PPCRegisterDependencyGroup::assignRegisters(TR_Instruction*,T R_RegisterKinds,unsigned int,TR_CodeGenerator*) TR_PPCDepLabelInstruction::assignRegisters(TR_RegisterKinds) TR_PPCCodeGenerator::doRegisterAssignment(TR_RegisterKinds) TR_CodeGenerator::generateCode() TR_Compilation::generateCode() TR_Compilation::compile() . The problem can only occur when JIT compiling Java code that contains a switch statement that would cause a 32bit integer overflow like the following example: switch( type ){ case -2112854795: // code break; case 523817410: // code break; } The overflow occurs when the JIT compiler attempts to calculate the stride between two cases: stride = 523817410 - (-2112854795) The result overflows a 32bit integer resulting in an unexpected negative value which eventually results in a crash later in the compilation. The problem can only occur on POWER JVMs (AIX, LinuxPPC, LinuxPCCle) and can not occur on other platforms like x86 or zSeries.
Local fix
The problem can be avoided by disabling the JIT optimization called GRA. This might have a moderate effect on performance by causing the JIT to generate less optimal code, but when applied only to one method (as seen below) the effect should be unnoticeable. Use the following java command line option: -Xjit:{package/class.method*}(disableGRA) Where <package/class.method> is taken from the javacore file generated when the problem occurred.
Problem summary
The JIT failed to check for a possible overflow condition which would result in a miscalculation of the number of registers that are required to generate code for handling a switch state.
Problem conclusion
The JIT was modified so that it would detect a overflow condition and properly calculate the number of registers required to handle the switch statement. . This APAR will be fixed in the following Java Releases: 8 SR5 FP40 (8.0.5.40) 7 SR10 FP50 (7.0.10.50) 7 R1 SR4 FP50 (7.1.4.50) . Contact your IBM Product's Service Team for these Service Refreshes and Fix Packs. For those running stand-alone, information about the available Service Refreshes and Fix Packs can be found at: https://www.ibm.com/developerworks/java/jdk/
Temporary fix
Comments
APAR Information
APAR number
IJ17054
Reported component name
JIT
Reported component ID
620700124
Reported release
130
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2019-06-19
Closed date
2019-06-20
Last modified date
2019-06-20
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
JIT
Fixed component ID
620700124
Applicable component levels
[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSC9HBA","label":"Just In Time (JIT) Compiler"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"130","Edition":"","Line of Business":{"code":"","label":""}}]
Document Information
Modified date:
20 June 2019