Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sanitizers=true fails to build #69556

Closed
matthiaskrgr opened this issue Feb 28, 2020 · 5 comments · Fixed by #70893
Closed

sanitizers=true fails to build #69556

matthiaskrgr opened this issue Feb 28, 2020 · 5 comments · Fixed by #70893
Labels
A-sanitizers Area: Sanitizers for correctness and code quality C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

I'm using clang/llvm to build (instead of gcc).

git clone https://github.com/rust-lang/rust/ --depth=1
cd rust
cp config.toml.example > config.toml

make sure sanitizers are built:
config.toml:

# Build the sanitizer runtimes
sanitizers = true

use llvm ar and ranlib

ar = "llvm-ar"
ranlib = "llvm-ranlib"

./x.py build

fails to build:

make[3]: Leaving directory '/home/matthias/vcs/github/rust__asan_test/build/x86_64-unknown-linux-gnu/native/sanitizers/build'
make[3]: Entering directory '/home/matthias/vcs/github/rust__asan_test/build/x86_64-unknown-linux-gnu/native/sanitizers/build'
[ 54%] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_openbsd.cc.o
[ 54%] Building CXX object lib/asan/CMakeFiles/RTAsan.x86_64.dir/asan_allocator.cc.o
[ 54%] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_posix.cc.o
/home/matthias/vcs/github/rust__asan_test/src/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:1132:1: error: 'assertion_failed__1132' declared as an array with a negative size
CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/matthias/vcs/github/rust__asan_test/src/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1437:3: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
  COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *) NULL)->MEMBER) == \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/matthias/vcs/github/rust__asan_test/src/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:336:30: note: expanded from macro 'COMPILER_CHECK'
#define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/matthias/vcs/github/rust__asan_test/src/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:342:57: note: expanded from macro 'IMPL_COMPILER_ASSERT'
    typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
                                                        ^~~~~~~~~~~~~~~
1 error generated.
make[3]: *** [lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/build.make:336: lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_posix.cc.o] Error 1
make[3]: Leaving directory '/home/matthias/vcs/github/rust__asan_test/build/x86_64-unknown-linux-gnu/native/sanitizers/build'
make[2]: *** [CMakeFiles/Makefile2:1028: lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
@matthiaskrgr matthiaskrgr added the C-bug Category: This is a bug. label Feb 28, 2020
@matthiaskrgr
Copy link
Member Author

For the record, I am at e2223c9
I believe this is a recent regression, probably introduced in the last 1-2 days.

@matthiaskrgr
Copy link
Member Author

matthiaskrgr commented Feb 28, 2020

I'm wondering if this was caused by rust-lang/llvm-project@9f65ad0 / #69473

@jonas-schievink jonas-schievink added A-sanitizers Area: Sanitizers for correctness and code quality T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 28, 2020
@matthiaskrgr
Copy link
Member Author

Nope, reverting that did not fix the build failure..

@nikomatsakis
Copy link
Contributor

cc @tmiasko

@tmiasko
Copy link
Contributor

tmiasko commented Mar 2, 2020

AFAICS #67759 includes a fix (glibc 2.31 changed ABI: https://reviews.llvm.org/D70662).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sanitizers Area: Sanitizers for correctness and code quality C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants