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

ErrorFile option does not handle pre-existing error files of the same name

XMLWordPrintable

    • b21

      Specifying -XX:ErrorFile=<path> only succeeds if there is not already a file at <path>. When there is, it will silently revert to the default path/filename which is hs_err... in the current directory:

      java -XX:ErrorHandlerTest=13 -XX:ErrorFile=/tmp/hallo
      #
      # A fatal error has been detected by the Java Runtime Environment:
      ..
      #
      # An error report file with more information is saved as:
      # /tmp/hallo

      java -XX:ErrorHandlerTest=13 -XX:ErrorFile=/tmp/hallo
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      ...
      #
      # An error report file with more information is saved as:
      # /shared/projects/openjdk/test/hs_err_pid14685.log
      #

      That is not useful.

      More useful alternatives would be:
      - append or overwrite the existing file
      - create a new file with an appendix ("_<num>" or "_pid")

            stuefe Thomas Stuefe
            stuefe Thomas Stuefe
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: