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

metaspace uses global operator new/delete for gtest testing

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 11
    • Fix Version/s: 11
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b03
    • CPU:
      generic
    • OS:
      generic

      Description

      metaspace.cpp contains the functions setup_chunkmanager_returntests() and teardown_chunkmanager_returntests(), which call global operator new and delete, respectively, to manage a test data structure used for gtest-based testing.

      This works because a build for gtest excludes operator_new.o, which in non-product build provides replacements for global operator new &etc that error, in order to catch uses of those functions by HotSpot code.

      However, this means there are references to global operator new/delete in libjvm.so, which interferes with fixing JDK-8173070.

      One way to fix this might be to change metaspace to also provide a function for getting the size of the test data structure, have the gtest-based test code perform the memory allocation, and have the memory passed to the setup function for placement-new construction.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                coleenp Coleen Phillimore
                Reporter:
                kbarrett Kim Barrett
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: