Insufficient compiler barriers for GCC in OrderAccess functions

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • 9
    • Affects Version/s: 8u40, 9
    • Component/s: 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");
        }

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

                Created:
                Updated:
                Resolved: