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

hsperfdata file is created in wrong directory and not cleaned up if /tmp/hsperfdata_<username> has wrong permissions

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
      svc
    • Resolved In Build:
      b81

      Backports

        Description

        The JDK on Unix/Linux platforms will create a shared memory file for performance data, named like the process pid, in /tmp/hsperfdata_<username> directory. If that directory has wrong permissions, that is, no execute permissions (e.g. mod bits 644), the performance file will be created in the current working directory. Usually the file will be deleted when the VM ends. But in this case it will remain.

        One can easily reproduce it by either deleting /tmp/hsperfdata_<username> and running a Java program with umask 133 or by first doing a chmod 644 on /tmp/hsperfdata_<username> and then running a java program. After the program has finished, a new file, named like a number, will exist in the cwd.

        The problem can be easily fixed by checking the return value of the fchdir() call in open_directory_secure_cwd().

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  clanger Christoph Langer
                  Reporter:
                  simonis Volker Simonis
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: