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

missing null checks in IfNode::has_only_uncommon_traps

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • hotspot
    • b96

      While testing Graal with JDK9 we hit a SEGV with latest C2.

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # SIGSEGV (0xb) at pc=0x00007f5708e8e89e, pid=13481, tid=13508
      #
      # JRE version: OpenJDK Runtime Environment (9.0) (build 1.9.0-internal-_2015_11_10_13_33-b00)
      # Java VM: OpenJDK 64-Bit Server VM (1.9.0-internal-_2015_11_10_13_33-b00, mixed mode, tiered, jvmci, compressed oops, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0x49189e] JVMState::same_calls_as(JVMState const*) const+0xe
      #
      # Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %P" (or dumping to /slave/buildlog/CI-graal-compiler_gate_amd64_linux_postgate_jdk9-SNAPSHOT_jdk8_jdk7/build/graal-compiler/core.13481)
      #
      # If you would like to submit a bug report, please visit:
      # http://bugreport.java.com/bugreport/crash.jsp
      #

      V [libjvm.so+0x49189e] JVMState::same_calls_as(JVMState const*) const+0xe
      V [libjvm.so+0x6ffe0b] IfNode::has_only_uncommon_traps(ProjNode*, ProjNode*&, ProjNode*&, PhaseIterGVN*)+0x1ab
      V [libjvm.so+0x702726] IfNode::fold_compares(PhaseIterGVN*)+0x236
      V [libjvm.so+0x703a1b] IfNode::Ideal(PhaseGVN*, bool)+0xc9b

      Inspection of the code showed it was possible for both dom_caller and caller to be null here:

            JVMState* dom_caller = dom_unc->jvms()->caller();
            JVMState* caller = unc->jvms()->caller();
            if (!dom_caller->same_calls_as(caller)) {
              return false;
            }

      It should at least be checking that both are non-NULL though I think that both of them being NULL would actually be ok. I pushed the following to our local repo http://hg.openjdk.java.net/graal/graal-jvmci-9/hotspot/rev/e9d1036f48c1

            thartmann Tobias Hartmann
            never Tom Rodriguez
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: