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

ciMethodData contains mismatched oops in a replay file

XMLWordPrintable

    • generic
    • generic

      I found some records of ciMethodData may contain mismatched oops. eg. in the attachment line 14130, it declares that there will be 2 non-null oops followed(see '2' after tag 'oops'). however, one only is recorded.

      ciMethodData kotlin/coroutines/jvm/internal/ContinuationImpl <init>
      (Lkotlin/coroutines/Continuation;)V 2 21538 orig 80 0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 data
      26 0x40007 0x402 0x70 0x4e9c 0x70005 0x4d55 0x0 0x7f6a5841c3c0 0xa3
      0x7f6a5841c470 0xa4 0xc0003 0x4e9c 0x18 0x110002 0x529e 0x0 0x0 0x0 0x0
      0x0 0x0 0x9 0x2 0x6 0x0 oops 2 7
      com/example/ProductAttRouter$withRequestLoggingContext$1 methods 0

      I don't understand how this happens. ciReplay can't load this record correctly.

      One workaround is to truncate oops if ReplayIgnoreInitErrors is true. This allows ciReplay to proceed.

      diff --git a/src/hotspot/share/ci/ciReplay.cpp b/src/hotspot/share/ci/ciReplay.cpp
      index a9731d4bfb7..9744bbab290 100644
      --- a/src/hotspot/share/ci/ciReplay.cpp
      +++ b/src/hotspot/share/ci/ciReplay.cpp
      @@ -870,7 +870,13 @@ class CompileReplay : public StackObj {
           for (int i = 0; i < rec->_classes_length; i++) {
             int offset = parse_int("offset");
             if (had_error()) {
      - return;
      + if (ReplayIgnoreInitErrors) {
      + _error_message = NULL;
      + rec->_classes_length = i;
      + break;
      + } else {
      + return;
      + }
             }
             Klass* k = parse_klass(CHECK);
             rec->_classes_offsets[i] = offset;


      I wrote an email to ask why this happens in the first place.
      https://mail.openjdk.java.net/pipermail/hotspot-dev/2022-May/060459.html

            dlong Dean Long
            xliu Xin Liu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: