Don't create invalid oop in method handle tracing

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 17
    • Affects Version/s: 17
    • Component/s: hotspot
    • None
    • b18

      The mh field in:

      struct MethodHandleStubArguments {
        const char* adaptername;
        oopDesc* mh;
        intptr_t* saved_regs;
        intptr_t* entry_sp;
      };

      doesn't always point to a valid object. The oopDesc* is then implicitly converted to an oop here:

      void trace_method_handle_stub_wrapper(MethodHandleStubArguments* args) {
        trace_method_handle_stub(args->adaptername,
                                 args->mh,
                                 args->saved_regs,
                                 args->entry_sp);
      }

      This gets caught by my adhoc verification code that verifies oops when they are created/used.

      I propose that we don't create an oop until it mh is actually used, and it has been checked that the argument should contain a valid oop.

            Assignee:
            Stefan Karlsson
            Reporter:
            Stefan Karlsson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: