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

[SR-12224] Assertion error in sanitizer: declared as an array with a negative size #54650

Closed
swift-ci opened this issue Feb 18, 2020 · 6 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. Linux Platform: Linux

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-12224
Radar rdar://problem/59655505
Original Reporter segabor (JIRA User)
Type Bug
Status Closed
Resolution Done

Attachment: Download

Environment

Linux csihuhu 5.5.4-arch1-1 #1 SMP PREEMPT Sat, 15 Feb 2020 00:36:29 +0000 x86_64 GNU/Linux

Additional Detail from JIRA
Votes 0
Component/s
Labels Bug, Linux
Assignee danliew (JIRA)
Priority Medium

md5: 279cd6497f3cf0471de86b57e6042844

Issue Description:

Latest 5.2-DEVELOPMENT snapshot (namely 5.2-DEVELOPMENT-SNAPSHOT-2020-02-16-a) cannot be built on Arch Linux due to assertion error raised in compiler-rt module.

 + /usr/bin/cmake --build /home/segabor/Workspace/swift-dev/build/buildbot_linux/llvm-linux-x86_64 – -j12 all
 [0/3][ 0%][0.000s] Performing build step for 'compiler-rt'
 [13/1150][ 1%][0.228s] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.i386.dir/sanitizer_platform_limits_posix.cc.o
 FAILED: lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.i386.dir/sanitizer_platform_limits_posix.cc.o 
 /home/segabor/Workspace/swift-dev/build/buildbot_linux/llvm-linux-x86_64/./bin/clang++ -DHAVE_RPC_XDR_H=0 -I/home/segabor/Workspace/swift-dev/llvm-project/compiler-rt/lib/sanitizer_common/.. -Wall -std=c++11 -Wno-unused-parameter -O3 -DNDEBUG -m32 -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -Wno-non-virtual-dtor -fno-rtti -Wframe-larger-than=570 -Wglobal-constructors -MD -MT lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.i386.dir/sanitizer_platform_limits_posix.cc.o -MF lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.i386.dir/sanitizer_platform_limits_posix.cc.o.d -o lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.i386.dir/sanitizer_platform_limits_posix.cc.o -c /home/segabor/Workspace/swift-dev/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
 /home/segabor/Workspace/swift-dev/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:1131:1: error: 'assertion_failed__1131' declared as an array with a negative size
 CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 /home/segabor/Workspace/swift-dev/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/segabor/Workspace/swift-dev/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/segabor/Workspace/swift-dev/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.
 [26/1150][ 2%][0.425s] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_linux.cc.o
 ninja: build stopped: subcommand failed.
 FAILED: tools/clang/runtime/compiler-rt-stamps/compiler-rt-build 
 cd /home/segabor/Workspace/swift-dev/build/buildbot_linux/llvm-linux-x86_64/tools/clang/runtime/compiler-rt-bins && /usr/bin/cmake --build . && /usr/bin/cmake -E touch /home/segabor/Workspace/swift-dev/build/buildbot_linux/llvm-linux-x86_64/tools/clang/runtime/compiler-rt-stamps//compiler-rt-build
 ninja: build stopped: subcommand failed.
 ./swift/utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting
 ./swift/utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting
@swift-ci
Copy link
Collaborator Author

Comment by Gábor Sebestyén (JIRA)

Attempted with 5.2-DEVELOPMENT-SNAPSHOT-2020-02-18-a, got the same error. Full build log will be attached.

@swift-ci
Copy link
Collaborator Author

Comment by Gábor Sebestyén (JIRA)

Applying an LLVM patch manually fixed the build llvm/llvm-project@947f969

@hborla
Copy link
Member

hborla commented Feb 21, 2020

@swift-ci create

@swift-ci
Copy link
Collaborator Author

Comment by Dan Liew (JIRA)

A fix for this has been landed to the apple/stable/20190619 branch in the llvm-project repo (apple/llvm-project#822) ).

This should automatically propagate to the `swift/swift-5.2-branch` of the llvm-project in the next few hours.

Please verify the fix.

@swift-ci
Copy link
Collaborator Author

Comment by Dan Liew (JIRA)

Please verify the fix.

@swift-ci
Copy link
Collaborator Author

Comment by Gábor Sebestyén (JIRA)

As of 5.2-DEVELOPMENT-SNAPSHOT-2020-02-23-a build went fine. Ticket can be closed.

Thanks,

Gábor

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. Linux Platform: Linux
Projects
None yet
Development

No branches or pull requests

2 participants