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().

          Activity

          Hide
          dcubed Daniel Daugherty added a comment -
          The fchdir line was added by this changeset:

          http://hg.openjdk.java.net/jdk9/dev/hotspot/annotate/c656c7540cb1/src/os/linux/vm/perfMemory_linux.cpp#l378

          Changeset: c656c7540cb1
          Author: gthornbr
          Date: 2014-11-17 15:51 -0500
          URL: http://hg.openjdk.java.net/jdk9/dev/hotspot/rev/c656c7540cb1

          8050807: Better performing performance data handling
          Reviewed-by: dcubed, pnauman, ctornqvi, dholmes, mschoene
          Contributed-by: gerald.thornbrugh@oracle.com
          Show
          dcubed Daniel Daugherty added a comment - The fchdir line was added by this changeset: http://hg.openjdk.java.net/jdk9/dev/hotspot/annotate/c656c7540cb1/src/os/linux/vm/perfMemory_linux.cpp#l378 Changeset: c656c7540cb1 Author: gthornbr Date: 2014-11-17 15:51 -0500 URL: http://hg.openjdk.java.net/jdk9/dev/hotspot/rev/c656c7540cb1 8050807: Better performing performance data handling Reviewed-by: dcubed, pnauman, ctornqvi, dholmes, mschoene Contributed-by: gerald.thornbrugh@oracle.com
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/efc17f03e5d4
          User: dcubed
          Date: 2015-08-20 20:31:58 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/efc17f03e5d4 User: dcubed Date: 2015-08-20 20:31:58 +0000
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/efc17f03e5d4
          User: lana
          Date: 2015-09-09 21:33:20 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/efc17f03e5d4 User: lana Date: 2015-09-09 21:33:20 +0000

            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: