Unsigned value implicitly cast to signed in log file rotation

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • 9
    • Affects Version/s: 9
    • Component/s: 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));
        }

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

              Created:
              Updated:
              Resolved: