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

Insufficient compiler barriers for GCC in OrderAccess functions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 9
    • 8u40, 9
    • hotspot
    • b42

        In JDK-8058209 I discovered that two stores separated by a call to OrderAccess::storestore were in fact incorrectly reordered by GCC, exposing a race condition and causing crashes in the G1 collector.

        The suggested fix is to add a proper "compiler barrier" to the acquire() and release() functions in orderAccess_linux_x86.hpp to ensure that no compiler reordering occurs.

        Something along the lines of:
        static inline void compiler_barrier() {
        __asm__ volatile ("" : : : "memory");
        }

              mgerdin Mikael Gerdin (Inactive)
              mgerdin Mikael Gerdin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: