JDK-8349873 : StackOverflowError after JDK-8342550 if -Duser.timezone= is set to a deprecated zone id
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 24
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-02-12
  • Updated: 2025-05-08
  • Resolved: 2025-02-13
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 25
25 b11Fixed
Related Reports
Causes :  
Description
After JDK-8342550, setting -Duser.timezone= to a deprecated zone id causes a StackOverflowError if the new warning is logged.

```
import java.util.TimeZone;

public class ThreeLetterZoneID {
  public static void main(String... args) throws Exception {
    TimeZone.getTimeZone("PST");
  }
}
```

$ java -fullversion
openjdk full version "25-ea+9-963"

$ java -Duser.timezone=PST ThreeLetterZoneID
Exception in thread "main" java.lang.StackOverflowError
        at java.base/java.lang.ClassFrameInfo.getDeclaringClass(ClassFrameInfo.java:81)
        at java.base/jdk.internal.logger.SimpleConsoleLogger$Formatting.isFilteredFrame(SimpleConsoleLogger.java:435)
        at java.base/jdk.internal.logger.SimpleConsoleLogger$CallerFinder.test(SimpleConsoleLogger.java:235)
        at java.base/jdk.internal.logger.SimpleConsoleLogger$CallerFinder.test(SimpleConsoleLogger.java:201)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:196)
        at java.base/java.lang.StackStreamFactory$StackFrameTraverser.tryAdvance(StackStreamFactory.java:594)
        at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:147)
        at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:588)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:574)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
        at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
        at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:687)
        at java.base/jdk.internal.logger.SimpleConsoleLogger$CallerFinder.lambda$get$0(SimpleConsoleLogger.java:210)
        at java.base/java.lang.StackStreamFactory$StackFrameTraverser.consumeFrames(StackStreamFactory.java:531)
        at java.base/java.lang.StackStreamFactory$AbstractStackWalker.doStackWalk(StackStreamFactory.java:324)
        at java.base/java.lang.StackStreamFactory$AbstractStackWalker.callStackWalk(Native Method)
        at java.base/java.lang.StackStreamFactory$AbstractStackWalker.beginStackWalk(StackStreamFactory.java:418)
        at java.base/java.lang.StackStreamFactory$AbstractStackWalker.walkHelper(StackStreamFactory.java:261)
        at java.base/java.lang.StackStreamFactory$AbstractStackWalker.walk(StackStreamFactory.java:253)
        at java.base/java.lang.StackWalker.walk(StackWalker.java:502)
        at java.base/jdk.internal.logger.SimpleConsoleLogger$CallerFinder.get(SimpleConsoleLogger.java:210)
        at java.base/jdk.internal.logger.SimpleConsoleLogger.getCallerInfo(SimpleConsoleLogger.java:190)
        at java.base/jdk.internal.logger.SimpleConsoleLogger.log(SimpleConsoleLogger.java:155)
        at java.base/jdk.internal.logger.AbstractLoggerWrapper.log(AbstractLoggerWrapper.java:159)
        at java.base/sun.util.logging.PlatformLogger.warning(PlatformLogger.java:401)
        at java.base/java.util.TimeZone.getTimeZone(TimeZone.java:603)
        at java.base/java.util.TimeZone.setDefaultZone(TimeZone.java:745)
        at java.base/java.util.TimeZone.getDefaultRef(TimeZone.java:721)
Comments
Changeset: 3e7acfac Branch: master Author: Naoto Sato <naoto@openjdk.org> Date: 2025-02-13 20:57:48 +0000 URL: https://git.openjdk.org/jdk/commit/3e7acfac48229441b243a6ac564e719963e4f43d
13-02-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/23597 Date: 2025-02-12 19:35:18 +0000
12-02-2025

Since logging facility depends on TimeZone, it should not use the logging facility. Simple print through System.err should be fine
12-02-2025