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

Insufficient compiler barriers for GCC in OrderAccess functions

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 8u40, 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b42

      Backports

        Description

        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");
        }

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: