Java crash in java.util.GregorianCalendar.computeTime
Environment
- OpenJDK
- 8u372
- 11.0.19
- 17.0.7
Issue
- After recently upgrading to OpenJDK 11.0.19, we started seeing crashes in java.util.GregorianCalendar.computeTime:
Stack: [0x00007f3d8974c000,0x00007f3d8984d000], sp=0x00007f3d8984af90, free space=1019k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
J 35755 c2 java.util.GregorianCalendar.computeTime()V java.base@11.0.19 (970 bytes) @ 0x00007f3dcdbc0433 [0x00007f3dcdbbf440+0x0000000000000ff3]
J 35704 c1 java.text.SimpleDateFormat.parse(Ljava/lang/String;Ljava/text/ParsePosition;)Ljava/util/Date; java.base@11.0.19 (446 bytes) @ 0x00007f3dc7cc3c5c [0x00007f3dc7cc27a0+0x00000000000014bc]
j org.apache.commons.lang.time.DateUtils.parseDateWithLeniency(Ljava/lang/String;[Ljava/lang/String;Z)Ljava/util/Date;+153
j org.apache.commons.lang.time.DateUtils.parseDateStrictly(Ljava/lang/String;[Ljava/lang/String;)Ljava/util/Date;+3
Resolution
- This will be fixed in the July 2023 quarterly releases (JDK8u382/JDK11.0.20/JDK17.0.8).
- Workarounds:
- Downgrade to OpenJDK 8u362/11.0.18/17.0.6 or earlier.
- -XX:CompileCommand=exclude,java.util.GregorianCalendar::computeTime
- -XX:-UseLoopPredicate
- Change application code to call java.util.GregorianCalendar.computeTime with lenient="true".
Root Cause
Product(s)
Components
Category
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.