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

Bogus warning "Re-registering of platform native method" for a JVMTI agent

    XMLWordPrintable

    Details

    • Subcomponent:
    • Introduced In Build:
      b10
    • Introduced In Version:
      15
    • Resolved In Build:
      b15

      Description

      ADDITIONAL SYSTEM INFORMATION :
      openjdk version "15-ea" 2020-09-15
      OpenJDK Runtime Environment (build 15-ea+10-316) OpenJDK 64-Bit Server VM (build 15-ea+10-316, mixed mode, sharing)

      A DESCRIPTION OF THE PROBLEM :
      In a JVMTI profiler agent we use a class Callback with several native methods. Calls to Callback methods are injected via bytecode instrumentation to the profiled application code. Callback is loaded via bootstrap loader, its JAR path is added via JVMTI call AddToBootstrapClassLoaderSearch.

      We register natives for Callback in VMStart.

      As the result of JDK-8238460 (change https://hg.openjdk.java.net/jdk/jdk/rev/5e402c63694f?revcount=1000 ) we now get multiple warnings "Re-registering of platform native method: <...> from code in a different classloader".

      I believe this warning is incorrect. We are not re-registering anything in the platform but register the agent's natives once.

      Please find a solution or suggest a workaround to avoid the warnings. I make think of the following possibilities:
      - let RegisterNatives actually check it's a re-registering, i.e. the natives have not been bound to the class yet;
      - provide a way to white-list the agent classes to not treat them part of "platform", e.g. via a property;
      - don't issue the warning for classes from AddToBootstrapClassLoaderSearch.



      REGRESSION : Last worked in version 15


      FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dholmes David Holmes
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: