NVIDIA / libcudacxx

[ARCHIVED] The C++ Standard Library for your entire system. See https://github.com/NVIDIA/cccl
https://nvidia.github.io/libcudacxx
Other
2.29k stars 186 forks source link

libcu++ atomic fails to compile with address sanitizer (ASAN) enabled #142

Closed maddyscientist closed 1 year ago

maddyscientist commented 3 years ago

In testing libcu++ for deployment in QUDA, I found that libcu++ atomic fails to compile if address sanitizer is enabled.

$ nvcc bug.cu -o bug -arch=sm_70 -Xcompiler -fsanitize=address -Ilibcudacxx/include
libcudacxx/include/cuda/std/detail/libcxx/include/__config(1466): error: attributes are not allowed here

1 error detected in the compilation of "bug.cu".

Where bug.cu is simply the following

#include <cuda/atomic>
int main() { }

I note that this is blocking us from deploying libcu++ for production in QUDA, and forcing us to keep around legacy our legacy atomicAdd-based and cudaStream approach to reductions.

Tested on the latest release 1.4.1.

brycelelbach commented 3 years ago

@griwes thoughts

ogiroux commented 3 years ago

I took a quick look. There's a very special function at this line of code, some kind of compact between libcxx and ASAN, and it has one of the macros we modified applied to it. I bet that if we just unapplied our modified macro from it (after all, it's not a GPU function) then it would either pass or find the next error.

miscco commented 1 year ago

This has been fixed by https://github.com/NVIDIA/libcudacxx/pull/206 AFAIK so closing