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

CompilerThread releasing code buffer in destructor is unsafe

XMLWordPrintable

    • 11
    • b28

        I believe it is unsafe for CompilerThread to release code buffer in its destructor.

        Before CompilerThread reaches its destructor, it has to be removed from Threads list, which made it no longer participates safepoints. It opens up a race window that can result safepoint scanning to stumble over the code buffer just deleted by CompilerThread's destructor.

        Although, the destructor takes CodeCache_lock, but safepoint walk does not take this lock, so it is a race.

        I have seen this problem during Shenandoah tests on a big machine with many cores.



              thartmann Tobias Hartmann
              zgu Zhengyu Gu
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: