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

Usage of DirectBuffer::address should be guarded

    XMLWordPrintable

Details

    • b27
    • Verified

    Description

      There are around 34 usages of DirectBuffer::address in the JDK code. While some of these usages have been vetted to take into account the possibility of buffers backed by shared memory segments (which can be closed asynchronously) - most are not.

      Currently the code is defensive, and throws whenever a buffer backed by a shared segment is found.

      Eyeballing all the use sites, it seems the vast majority is doing a trivial synchronous operation, inside a try/finally (with a reachability fence). We should replace these so that, if there's a segment, we keep its session alive using MemorySession::whileAlive.

      Attachments

        Issue Links

          Activity

            People

              pminborg Per-Ake Minborg
              mcimadamore Maurizio Cimadamore
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: