[llvm-bugs] [Bug 47837] New: Clang rGc78da037783b segfaults when building an arm64 Linux kernel

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 13 16:42:00 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47837

            Bug ID: 47837
           Summary: Clang rGc78da037783b segfaults when building an arm64
                    Linux kernel
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: paulsson at linux.vnet.ibm.com
          Reporter: samitolvanen at google.com
                CC: aaron at aaronballman.com, craig.topper at gmail.com,
                    htmldeveloper at gmail.com, jennifer.yu at intel.com,
                    llvm-bugs at lists.llvm.org, ndesaulniers at google.com,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Starting with commit c78da037783bda0f27f4d82060149166e6f0c796 ("[clang] Improve
handling of physical registers in inline assembly operands."), Clang crashes
when I build the ToT arm64 Linux kernel:

Stack dump:
0.      Program arguments: [...]/unified-llvm/testbuild-release/bin/clang-12
-cc1 -triple aarch64-unknown-linux-gnu -S -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name slub.c -mrelocation-model static
-fno-delete-null-pointer-checks -mllvm -warn-stack-size=2048
-mframe-pointer=non-leaf -relaxed-aliasing -mdisable-tail-calls -fmath-errno
-fno-rounding-math -no-integrated-as -mconstructor-aliases -target-cpu generic
-target-feature -fp-armv8 -target-feature -crypto -target-feature -neon
-target-feature -sha2 -target-feature -aes -target-feature +reserve-x18
-target-abi aapcs -mllvm -aarch64-enable-global-merge=false   CC [M] 
fs/btrfs/compression.o
-msign-return-address=all -msign-return-address-key=a_key
-mbranch-target-enforce -fallow-half-arguments-and-returns
-fno-split-dwarf-inlining -debug-info-kind=limited -dwarf-version=4
-debugger-tuning=gdb -nostdsysteminc -nobuiltininc -resource-dir
[...]/unified-llvm/testbuild-release/lib/clang/12.0.0 -dependency-file
mm/.slub.o.d -MT mm/slub.o -isystem
[...]/unified-llvm/testbuild-release/lib/clang/12.0.0/include -include
../include/linux/kconfig.h -include ../include/linux/compiler_types.h -I
../arch/arm64/include -I ./arch/arm64/include/generated -I ../include -I
./include -I ../arch/arm64/include/uapi -I ./arch/arm64/include/generated/uapi
-I ../include/uapi -I ./include/generated/uapi -D __KERNEL__ -D
KASAN_SHADOW_SCALE_SHIFT=3 -D CONFIG_CC_HAS_K_CONSTRAINT=1 -D
ARM64_ASM_ARCH="armv8.4-a" -D KASAN_SHADOW_SCALE_SHIFT=3 -I ../mm -I ./mm -D
KBUILD_MODFILE="mm/slub" -D KBUILD_BASENAME="slub" -D KBUILD_MODNAME="slub"
-fmacro-prefix-map=../= -O2 -Wall -Wundef -Werror=strict-prototypes
-Wno-trigraphs -Werror=implicit-function-declaration -Werror=implicit-int
-Wno-format-security -Werror=unknown-warning-option -Wno-psabi
-Wno-frame-address -Wno-address-of-packed-member -Wno-format-invalid-specifier
-Wno-gnu -Wno-unused-const-variable -Wdeclaration-after-statement -Wvla
-Wno-pointer-sign -Wno-array-bounds -Werror=date-time
-Werror=incompatible-pointer-types -Wno-initializer-overrides -Wno-format
-Wno-sign-compare -Wno-format-zero-length -Wno-pointer-to-enum-cast
-Wno-tautological-constant-out-of-range-compare -std=gnu89
-fno-dwarf-directory-asm -fdebug-compilation-dir
/mnt/ssd2/android/kernel/linux/kernel-build -ferror-limit 19
-fsanitize=shadow-call-stack -fwrapv -stack-protector 2 -fno-signed-char
-fwchar-type=short -fno-signed-wchar -fgnuc-version=4.2.1 -vectorize-loops
-vectorize-slp -o /tmp/slub-b9ad40.s -x c ../mm/slub.c 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module '../mm/slub.c'.
4.      Running pass 'Early Machine Loop Invariant Code Motion' on function
'@kmem_cache_alloc'

#0 0x0000000002a49893 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
([...]/unified-llvm/testbuild-release/bin/clang-12+0x2a49893)
 #1 0x0000000002a476ce llvm::sys::RunSignalHandlers()
([...]/unified-llvm/testbuild-release/bin/clang-12+0x2a476ce)
 #2 0x0000000002a49d3c SignalHandler(int)
([...]/unified-llvm/testbuild-release/bin/clang-12+0x2a49d3c)
 #3 0x00007faec85ed140 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x14140)
 #4 0x0000000002225ef1 (anonymous
namespace)::MachineLICMBase::IsLoopInvariantInst(llvm::MachineInstr&)
([...]/unified-llvm/testbuild-release/bin/clang-12+0x2225ef1)
 #5 0x0000000002221b15 (anonymous
namespace)::MachineLICMBase::runOnMachineFunction(llvm::MachineFunction&)
([...]/unified-llvm/testbuild-release/bin/clang-12+0x2221b15)
 #6 0x00000000020b1f28
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
([...]/unified-llvm/testbuild-release/bin/clang-12+0x20b1f28)
 #7 0x0000000002470316 llvm::FPPassManager::runOnFunction(llvm::Function&)
([...]/unified-llvm/testbuild-release/bin/clang-12+0x2470316)
 #8 0x0000000002475de3 llvm::FPPassManager::runOnModule(llvm::Module&)
([...]/unified-llvm/testbuild-release/bin/clang-12+0x2475de3)
 #9 0x000000000247094f llvm::legacy::PassManagerImpl::run(llvm::Module&)
([...]/unified-llvm/testbuild-release/bin/clang-12+0x247094f)
#10 0x0000000002c1f1ce clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
([...]/unified-llvm/testbuild-release/bin/clang-12+0x2c1f1ce)
#11 0x00000000033be8a7
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
([...]/unified-llvm/testbuild-release/bin/clang-12+0x33be8a7)
#12 0x00000000041e8453 clang::ParseAST(clang::Sema&, bool, bool)
([...]/unified-llvm/testbuild-release/bin/clang-12+0x41e8453)
#13 0x00000000033189b5 clang::FrontendAction::Execute()
([...]/unified-llvm/testbuild-release/bin/clang-12+0x33189b5)
#14 0x0000000003276d51
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
([...]/unified-llvm/testbuild-release/bin/clang-12+0x3276d51)
#15 0x00000000033b9baa
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
([...]/unified-llvm/testbuild-release/bin/clang-12+0x33b9baa)
#16 0x00000000017d6e33 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) ([...]/unified-llvm/testbuild-release/bin/clang-12+0x17d6e33)
#17 0x00000000017d51d1 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
([...]/unified-llvm/testbuild-release/bin/clang-12+0x17d51d1)
#18 0x00000000017d4f97 main
([...]/unified-llvm/testbuild-release/bin/clang-12+0x17d4f97)
#19 0x00007faec80b0cca __libc_start_main ./csu/../csu/libc-start.c:308:16
#20 0x00000000017d202a _start
([...]/unified-llvm/testbuild-release/bin/clang-12+0x17d202a)
clang-12: error: unable to execute command: Segmentation fault
clang-12: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 12.0.0 ([...]/unified-llvm/llvm-project/.git
c78da037783bda0f27f4d82060149166e6f0c796)
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: [...]/unified-llvm/testbuild-release/bin
clang-12: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-12: note: diagnostic msg: /tmp/slub-ad4157.c
clang-12: note: diagnostic msg: /tmp/slub-ad4157.sh
clang-12: note: diagnostic msg: 

********************

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201013/ccb4cf81/attachment-0001.html>


More information about the llvm-bugs mailing list