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

Unsigned value implicitly cast to signed in log file rotation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • 9
    • 9
    • hotspot
    • None
    • gc

      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));
        }

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

              Created:
              Updated:
              Resolved: