Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-46485

clang-18 crashes internally on kernel RPM in BPF code

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Undefined Undefined
    • None
    • CentOS Stream 9
    • clang
    • None
    • None
    • Important
    • rhel-sst-pt-llvm-rust-go
    • ssg_platform_tools
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • CentOS Stream
    • None
    • None
    • None
    • All
    • None

      What were you trying to do that didn't work?

      Engineers at Qualcomm found that kernel rebuilds using CentOS Stream 9 started failing yes

      terday. Problem was in upgraded clang-18 package which replaced working clang-17 from previous working builds.

      Please provide the package NVR for which bug is seen:

      $ rpm -q clang
      clang-18.1.6-3.el9.aarch64

      How reproducible:

      100% reproducible on x86_64 and aarch64 architectures

      Steps to reproduce

      On an CentOS Stream 9

      • rpmbuild -ba kernel.spec
      • mock -r centos-stream-9-aarch64.cfg kernel-5.14.0-472.el9.src.rpm

      Expected results

      kernel will complete and rpms are built.

      Actual results

      clang crashes internally when trying to work on BPF parts with a stack trace.

      fatal error: error in backend: Branch target out of insn range
      PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and
       associated run script.
      Stack dump:
      0.      Program arguments: clang -g -Wall -Werror -D__TARGET_ARCH_x86 -mlittle-endian -I/home/ssmoogen/rpmbuild/BUILD/kernel-5.14.0-472.el9/linux-5.14.0-472.el9.x86_64/tools/testing/selftests/bpf/tools/include -I/home/ssmoogen/rpmbuild/BUILD/kernel-5.14.0-472.el9/linux-5.14.0-472.el9.x86_64/tools/testing/selftests/bpf -I/home/ssmoogen/rpmbuild/BUILD/kernel-5.14.0-472.el9/linux-5.14.0-472.el9.x86_64/tools/include/uapi -I/home/ssmoogen/rpmbuild/BUILD/kernel-5.14.0-472.el9/linux-5.14.0-472.el9.x86_64/tools/testing/selftests/usr/include -idirafter /usr/bin/../lib/clang/18/include -idirafter /usr/local/include -idirafter /usr/include -Wno-compare-distinct-pointer-types -DENABLE_ATOMICS_TESTS -O2 --target=bpf -c progs/pyperf180.c -mcpu=v3 -o /home/ssmoogen/rpmbuild/BUILD/kernel-5.14.0-472.el9/linux-5.14.0-472.el9.x86_64/tools/testing/selftests/bpf/pyperf180.bpf.o
      1.      <eof> parser at end of file
      2.      Code generation
       #0 0x00007f0ecada0cda llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/lib64/libLLVM.so.18.1+0x8fdcda)
       #1 0x00007f0ecad9e484 llvm::sys::RunSignalHandlers() (/lib64/libLLVM.so.18.1+0x8fb484)
       #2 0x00007f0ecacd02a2 (/lib64/libLLVM.so.18.1+0x82d2a2)
       #3 0x00007f0ecacd025f (/lib64/libLLVM.so.18.1+0x82d25f)
       #4 0x00007f0ecad9a94d (/lib64/libLLVM.so.18.1+0x8f794d)
       #5 0x0000000000213957 (/usr/bin/clang-18+0x213957)
       #6 0x00007f0ecace1bd7 llvm::report_fatal_error(llvm::Twine const&, bool) (/lib64/libLLVM.so.18.1+0x83ebd7)
       #7 0x00007f0ecace1a9a (/lib64/libLLVM.so.18.1+0x83ea9a)
       #8 0x00007f0ecdf38a31 (/lib64/libLLVM.so.18.1+0x3a95a31)
       #9 0x00007f0ecc764cc1 llvm::MCAssembler::layout(llvm::MCAsmLayout&) (/lib64/libLLVM.so.18.1+0x22c1cc1)
      #10 0x00007f0ecc764f5b llvm::MCAssembler::Finish() (/lib64/libLLVM.so.18.1+0x22c1f5b)
      #11 0x00007f0ecc787dea llvm::MCELFStreamer::finishImpl() (/lib64/libLLVM.so.18.1+0x22e4dea)
      #12 0x00007f0ecb7caeab llvm::AsmPrinter::doFinalization(llvm::Module&) (/lib64/libLLVM.so.18.1+0x1327eab)
      #13 0x00007f0ecaf2d501 llvm::FPPassManager::doFinalization(llvm::Module&) (/lib64/libLLVM.so.18.1+0xa8a501)
      #14 0x00007f0ecaf26e51 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/lib64/libLLVM.so.18.1+0xa83e51)
      #15 0x00007f0ed31dcce5 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) (/lib64/libclang-cpp.so.18.1+0x27d1ce5)
      #16 0x00007f0ed35d4d07 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/lib64/libclang-cpp.so.18.1+0x2bc9d07)
      #17 0x00007f0ed1ec8d16 clang::ParseAST(clang::Sema&, bool, bool) (/lib64/libclang-cpp.so.18.1+0x14bdd16)
      #18 0x00007f0ed42041b6 clang::FrontendAction::Execute() (/lib64/libclang-cpp.so.18.1+0x37f91b6)
      #19 0x00007f0ed416b840 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/lib64/libclang-cpp.so.18.1+0x3760840)
      #20 0x00007f0ed4286fb0 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/lib64/libclang-cpp.so.18.1+0x387bfb0)
      #21 0x0000000000213496 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang-18+0x213496)
      #22 0x0000000000210095 (/usr/bin/clang-18+0x210095)
      #23 0x00007f0ed3d9b20d (/lib64/libclang-cpp.so.18.1+0x339020d)
      #24 0x00007f0ecacd0234 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/lib64/libLLVM.so.18.1+0x82d234)
      #25 0x00007f0ed3d9adb7 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/lib64/libclang-cpp.so.18.1+0x338fdb7)
      #26 0x00007f0ed3d60aae clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/lib64/libclang-cpp.so.18.1+0x3355aae)
      #27 0x00007f0ed3d60d17 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/lib64/libclang-cpp.so.18.1+0x3355d17)
      #28 0x00007f0ed3d7e67e clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/lib64/libclang-cpp.so.18.1+0x337367e)
      #29 0x000000000020f8e8 clang_main(int, char**, llvm::ToolContext const&) (/usr/bin/clang-18+0x20f8e8)
      #30 0x000000000021d86a main (/usr/bin/clang-18+0x21d86a)
      #31 0x00007f0eca09a590 __libc_start_call_main (/lib64/libc.so.6+0x29590)
      #32 0x00007f0eca09a640 __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x29640)
      #33 0x000000000020c7d5 _start (/usr/bin/clang-18+0x20c7d5)
      clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
      clang version 18.1.6 (CentOS 18.1.6-3.el9)
      Target: bpf
      Thread model: posix
      InstalledDir: /usr/bin
      clang: note: diagnostic msg: 
      ********************
      
      PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
      Preprocessed source(s) and associated run script(s) are located at:
      clang: note: diagnostic msg: /tmp/pyperf180-46f94c.c
      clang: note: diagnostic msg: /tmp/pyperf180-46f94c.sh
      clang: note: diagnostic msg: 
      
      ********************
      
      

        1. pyperf180-46f94c.c
          702 kB
        2. pyperf180-46f94c.sh
          4 kB
        3. RPM-OUT2
          2.39 MB

              tstellar@redhat.com Thomas Stellard
              smooge.fedora Stephen Smoogen
              Thomas Stellard Thomas Stellard
              qe-baseos-tools-bugs@redhat.com qe-baseos-tools-bugs@redhat.com qe-baseos-tools-bugs@redhat.com qe-baseos-tools-bugs@redhat.com
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: