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

OopHandle replacement methods should not be called on empty handles

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 21, 25
    • hotspot

      I noticed that in OopHandle/WeakHandle we have {replace,xchg,cmpxchg} methods that overwrite the handle. This is only safe to do when the handle is not empty -- i.e. when there is a storage allocated for it in relevant OopStorage. Otherwise we attempt the store to nullptr, and get a SEGV.

      Only OopHandle::replace does the assertion for this. We need to add these asserts everywhere else.

            shade Aleksey Shipilev
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: