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

Unsigned value implicitly cast to signed in log file rotation

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
      gc

      Description

      In src/share/vm/utilities/ostream.hpp there is a comparison that implicitly casts a size_t (GCLogFileSize) to a jlong (_bytes_written). On 32-bit platforms this will likely not work as expected if GCLogFileSize is set to a large (unsigned) number.

        bool should_rotate(bool force) {
          return force ||
                   ((GCLogFileSize != 0) && ((size_t)_bytes_written >= GCLogFileSize));
        }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jwilhelm Jesper Wilhelmsson
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: