Joe McDonnell created IMPALA-9533:
-------------------------------------

             Summary: Replace boost::atomic usages with std::atomic in LIRSCache
                 Key: IMPALA-9533
                 URL: https://issues.apache.org/jira/browse/IMPALA-9533
             Project: IMPALA
          Issue Type: Improvement
          Components: Backend
    Affects Versions: Impala 4.0
            Reporter: Joe McDonnell


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:
{noformat}
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'{noformat}
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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to