Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8366138

Parse::jump_switch_ranges() could cause stack overflow when compiling huge switch statement

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 17
    • hotspot

      This is another problem exposed by JDK-8366118. When C2 tries to compile a huge switch statement, `Parse::jump_switch_ranges()` could recursively call itself for >1000 times, causing stack overflow and crash the JVM. These crashes are extremely hard to debug without a feature like JDK-8364654, because such stack overflow crashes do not have stack trace, hs-err log or core dump.

      After JDK-8366118 is fixed, this type of crash should not normally occur since `-XX:+DontCompileHugeMethods` is the default. But adventurously users could set `-XX:-DontCompileHugeMethods` and run into such crashes.

      (Currently we have not found a local repro, but we will keep experimenting and try providing a repro soon.)

            Unassigned Unassigned
            manc Man Cao
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: