Assert left >= right in pointer_delta() methods

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 17
    • Affects Version/s: 17
    • Component/s: hotspot
    • None
    • gc
    • b23

      During the investigation for JDK-8259271 we found that the compiler (rightfully) reordered some loads that were written concurrently that caused crashes.

      An assert in the pointer_delta() methods would have caught that unintentional reordering. pointer_delta() implicitly assumes left >= right, since the point of it is to use unsigned arithmetic to be able to deal with large memory ranges that exceed the range of ptrdiff_t.


      Investigate adding an assert in pointer_delta (and see what else crashes).

            Assignee:
            Albert Yang
            Reporter:
            Thomas Schatzl
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: