Skip to content

[BUG]: __sanitizer_annotate_contiguous_container definition in libcu++ conflicts with libc++ #2789

Closed

Description

@Artem-B

Is this a duplicate?

Type of Bug

Compile-time Error

Component

libcu++

Describe the bug

Attempting to compile host-side CUDA code with clang -fsanitize=address fails with conflicting function redeclaration:

In file included from /opt/compiler-explorer/cuda/12.6.1/include/cub/device/device_copy.cuh:42:
In file included from /opt/compiler-explorer/cuda/12.6.1/include/cub/detail/nvtx.cuh:49:
In file included from /opt/compiler-explorer/cuda/12.6.1/include/cub/detail/nvtx3.hpp:631:
In file included from /opt/compiler-explorer/clang-trunk-20241112/bin/../include/c++/v1/string:595:
/opt/compiler-explorer/clang-trunk-20241112/bin/../include/c++/v1/__debug_utils/sanitizers.h:24:1: error: __host__ function '__sanitizer_annotate_contiguous_container' cannot overload __host__ __device__ function '__sanitizer_annotate_contiguous_container'
   24 | __sanitizer_annotate_contiguous_container(const void*, const void*, const void*, const void*);
      | ^
/opt/compiler-explorer/cuda/12.6.1/include/cuda/std/detail/libcxx/include/__config:1434:1: note: previous declaration is here
 1434 | __sanitizer_annotate_contiguous_container(const void*, const void*, const void*, const void*);
      | ^
1 error generated when compiling for host.
Compiler returned: 1

How to Reproduce

https://godbolt.org/z/sMfxKP7hM

Expected behavior

Making __sanitizer_annotate_contiguous_container a __host__ function avoids the problem.

Reproduction link

https://godbolt.org/z/sMfxKP7hM

Operating System

No response

nvidia-smi output

No response

NVCC version

No response

Activity

  1. added a commit that references this issue on Nov 13, 2024
    f8e9ffa
  2. moved this from Todo to In Review in CCCLon Nov 13, 2024
  3. added a commit that references this issue on Nov 13, 2024
    b3859d8
  4. moved this from In Review to Done in CCCLon Nov 13, 2024
  5. added a commit that references this issue on Nov 23, 2024
    654a29c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions