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

_Copy_conjoint_{jshorts,jints,jlongs}_atomic on Linux/BSD AArch64 do not prevent tearing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • 26
    • None
    • hotspot
    • aarch64

      The current implementations of _Copy_conjoint_{jshorts,jints,jlongs}_atomic on Linux and BSD for AArch64 do not prevent the compiler from replacing the loops with memcpy which is free to copy byte by byte which can lead to tearing. Currently neither Clang nor GCC perform this optimization on AArch64 but there is nothing stopping them from doing it in the future. To fix this we either need to cast the pointer for each store to have volatile in it or use Atomic::store.

            jcking Justin King
            jcking Justin King
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: