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

Don't create invalid oop in method handle tracing

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 17
    • 17
    • 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.

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

              Created:
              Updated:
              Resolved: