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

serviceability/sa/ClhsdbDumpclass.java could leave files owned by root on macOS

XMLWordPrintable

    • b22
    • os_x

        When running the hotspot jtreg test serviceability/sa/ClhsdbDumpclass.java on a macOS that allows for passwordless sudo, the test will leave a file in the scratch directories that is owned by root and cannot be deleted by normal users.

        On macOS the test start the class dump with sudo if possible. The dumped class file is owned by root and will be dumped to $JTwork/scratch/jdk/test/lib/apps/LingeredApp.class

        The test will write a warning in the jtr file:
        ...
        #section:script_messages
        ----------messages:(11/980)----------
        JDK under test: xxx
        openjdk version "21-internal" 2023-05-02
        ....
        Library /test/lib; kind: packages
           source directory: xxx/sources/test/lib
           class directory: xxx/JTwork/classes/test/lib
        Can't delete xxx/JTwork/scratch/jdk/test/lib/apps/LingeredApp.class
        Can't clean xxx/JTwork/scratch
        WARNING: failed to clean up files after test
        WARNING: closing agent(s)
        ....

        I suggest to skip the test in case that sudo rights are available. That was already done for a similar test in JDK-8290687.

              azeller Arno Zeller
              azeller Arno Zeller
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: