Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-9533

Replace boost::atomic usages with std::atomic in LIRSCache

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: Impala 4.0
    • Fix Version/s: None
    • Component/s: Backend
    • Labels:
      None
    • Epic Color:
      ghx-label-6

      Description

      The fix adding LIRSCache for IMPALA-8690 does compare and swap atomic operations with a 32-bit struct as the datatype. When using std::atomic, this fails to build with "buildall.sh -ubsan -so -skiptests". It fails when trying to link:

      make[1]: *** [be/src/benchmarks/CMakeFiles/date-benchmark.dir/all] Error 2
      ../../build/debug/util/cache/libUtilCache.so: error: undefined reference to '__c11_atomic_compare_exchange_weak'
      ../../build/debug/util/cache/libUtilCache.so: error: undefined reference to '__c11_atomic_store'
      ../../build/debug/util/cache/libUtilCache.so: error: undefined reference to '__c11_atomic_is_lock_free'
      ../../build/debug/util/cache/libUtilCache.so: error: undefined reference to '__c11_atomic_load'
      ../../build/debug/util/cache/libUtilCache.so: error: undefined reference to '__c11_atomic_compare_exchange_strong'
      ../../build/debug/util/cache/libUtilCache.so: error: undefined reference to '__c11_atomic_exchange'
      ../../build/debug/util/cache/libUtilCache.so: error: undefined reference to '__c11_atomic_fetch_add'
      ../../build/debug/util/cache/libUtilCache.so: error: undefined reference to '__c11_atomic_fetch_sub'
      ../../build/debug/util/cache/libUtilCache.so: error: undefined reference to '__c11_atomic_fetch_and'
      ../../build/debug/util/cache/libUtilCache.so: error: undefined reference to '__c11_atomic_fetch_or'
      ../../build/debug/util/cache/libUtilCache.so: error: undefined reference to '__c11_atomic_fetch_xor'

      This only fails with that specific build configuration. UBSAN with static linking works. The thing that is unique about UBSAN is that it uses LLVM's compiler-rt:

      https://github.com/apache/impala/blob/ded55d696acaaf2b87227f7f23b7fb799a80e872/be/CMakeLists.txt#L124

      Since boost atomic is header-only, it works fine in this case and provides the same functionality, but it would be nice to avoid it if possible.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              joemcdonnell Joe McDonnell
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: