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

llvm::BTFDebug crashes on some data types #37

Closed
riptl opened this issue Apr 28, 2022 · 0 comments · Fixed by #38
Closed

llvm::BTFDebug crashes on some data types #37

riptl opened this issue Apr 28, 2022 · 0 comments · Fixed by #38

Comments

@riptl
Copy link

riptl commented Apr 28, 2022

Reported by @alessandrod
Caused by #32

Problem

The BTF (BPF Type Format) debug info format does not support non-kernel data types like complex numbers.
This breaks compilation of some Rust and C programs.

Suggested Fix

Remove BTF debug info for arch sbf and sbfv2.
There is currently no need for BTF debug syms because we have DWARF support.


LLVM stack dump
  cargo:warning=Assertion failed: (DIToIdMap.find(Ty) != DIToIdMap.end() && "DIType not added in the BDIToIdMap"), function getTypeId, file BTFDebug.h, line 362.
  cargo:warning=PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
  cargo:warning=Stack dump:
  cargo:warning=0.      Program arguments: /Users/alessandro/src/solana/rust/build/aarch64-apple-darwin/llvm/bin/clang -O3 -ffunction-sections -fdata-sections -fPIC -g -fno-omit-frame-pointer --target=sbf-solana-solana -ffunction-sections -fdata-sections -fPIC --target=sbf-solana-solana -fno-builtin -fvisibility=hidden -ffreestanding -DVISIBILITY_HIDDEN -D__ELF__ -c -fcolor-diagnostics -o /Users/alessandro/src/solana/rust/build/aarch64-apple-darwin/stage1-std/sbf-solana-solana/release/build/compiler_builtins-dd14662a20df4461/out/divdc3.o /Users/alessandro/src/solana/rust/src/llvm-project/compiler-rt/lib/builtins/divdc3.c
  cargo:warning=1.       parser at end of file
  cargo:warning=2.      Code generation
  cargo:warning=3.      Running pass 'Function Pass Manager' on module '/Users/alessandro/src/solana/rust/src/llvm-project/compiler-rt/lib/builtins/divdc3.c'.
  cargo:warning=4.      Running pass 'BPF Assembly Printer' on function '@__divdc3'
  cargo:warning=Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
  cargo:warning=0  clang-13                 0x0000000103f95b1c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
  cargo:warning=1  clang-13                 0x0000000103f94c20 llvm::sys::RunSignalHandlers() + 128
  cargo:warning=2  clang-13                 0x0000000103f95298 llvm::sys::CleanupOnSignal(unsigned long) + 236
  cargo:warning=3  clang-13                 0x0000000103ee9b9c (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) + 128
  cargo:warning=4  clang-13                 0x0000000103ee9db4 CrashRecoverySignalHandler(int) + 152
  cargo:warning=5  libsystem_platform.dylib 0x00000001b24a84e4 _sigtramp + 56
  cargo:warning=6  libsystem_pthread.dylib  0x00000001b2490eb0 pthread_kill + 288
  cargo:warning=7  libsystem_c.dylib        0x00000001b23ce314 abort + 164
  cargo:warning=8  libsystem_c.dylib        0x00000001b23cd72c err + 0
  cargo:warning=9  clang-13                 0x000000010638c9f8 llvm::BTFTypeEnum::completeType(llvm::BTFDebug&) (.cold.1) + 0
  cargo:warning=10 clang-13                 0x0000000103131110 llvm::BTFDebug::getTypeId(llvm::DIType const*) + 248
  cargo:warning=11 clang-13                 0x0000000103130fcc llvm::BTFTypeDerived::completeType(llvm::BTFDebug&) + 172
  cargo:warning=12 clang-13                 0x0000000103136508 llvm::BTFDebug::beginFunctionImpl(llvm::MachineFunction const*) + 776
  cargo:warning=13 clang-13                 0x00000001049d4564 llvm::DebugHandlerBase::beginFunction(llvm::MachineFunction const*) + 1292
  cargo:warning=14 clang-13                 0x00000001049b8d04 llvm::AsmPrinter::emitFunctionHeader() + 1764
  cargo:warning=15 clang-13                 0x00000001049b9dbc llvm::AsmPrinter::emitFunctionBody() + 92
  cargo:warning=16 clang-13                 0x00000001031144d4 llvm::AsmPrinter::runOnMachineFunction(llvm::MachineFunction&) + 36
  cargo:warning=17 clang-13                 0x000000010350e6ac llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 372
  cargo:warning=18 clang-13                 0x0000000103871bb8 llvm::FPPassManager::runOnFunction(llvm::Function&) + 760
  cargo:warning=19 clang-13                 0x00000001038774b4 llvm::FPPassManager::runOnModule(llvm::Module&) + 60
  cargo:warning=20 clang-13                 0x00000001038721a0 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 972
  cargo:warning=21 clang-13                 0x00000001042266c4 (anonymous namespace)::EmitAssemblyHelper::EmitAssemblyWithNewPassManager(clang::BackendAction, std::__1::unique_ptr >) + 8344
  cargo:warning=22 clang-13                 0x0000000104222958 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::__1::unique_ptr >) + 3884
@riptl riptl changed the title llvm:: BTFDebug crashes on some data types llvm::BTFDebug crashes on some data types Apr 28, 2022
nvjle added a commit that referenced this issue Feb 15, 2023
BTF/CO-RE has been disabled for Solana since:
#37

This patch updates related code (and all applicable unit tests) from roughly
a year of bitrot. This is in preparation for its possible use in the Move
project.

Additionally, a few other 14.0.2022-03-02 -> 15.0-2022-08-09 BPF patches
were reflected in the SBF back-end (e.g., bugfixes).
dmakarov pushed a commit that referenced this issue Feb 16, 2023
BTF/CO-RE has been disabled for Solana since:
#37

This patch updates related code (and all applicable unit tests) from roughly
a year of bitrot. This is in preparation for its possible use in the Move
project.

Additionally, a few other 14.0.2022-03-02 -> 15.0-2022-08-09 BPF patches
were reflected in the SBF back-end (e.g., bugfixes).
LucasSte pushed a commit to LucasSte/llvm-project that referenced this issue Jan 31, 2024
BTF/CO-RE has been disabled for Solana since:
anza-xyz#37

This patch updates related code (and all applicable unit tests) from roughly
a year of bitrot. This is in preparation for its possible use in the Move
project.

Additionally, a few other 14.0.2022-03-02 -> 15.0-2022-08-09 BPF patches
were reflected in the SBF back-end (e.g., bugfixes).
LucasSte pushed a commit that referenced this issue Feb 16, 2024
BTF/CO-RE has been disabled for Solana since:
#37

This patch updates related code (and all applicable unit tests) from roughly
a year of bitrot. This is in preparation for its possible use in the Move
project.

Additionally, a few other 14.0.2022-03-02 -> 15.0-2022-08-09 BPF patches
were reflected in the SBF back-end (e.g., bugfixes).
LucasSte pushed a commit to LucasSte/llvm-project that referenced this issue Jun 28, 2024
BTF/CO-RE has been disabled for Solana since:
anza-xyz#37

This patch updates related code (and all applicable unit tests) from roughly
a year of bitrot. This is in preparation for its possible use in the Move
project.

Additionally, a few other 14.0.2022-03-02 -> 15.0-2022-08-09 BPF patches
were reflected in the SBF back-end (e.g., bugfixes).
LucasSte pushed a commit that referenced this issue Aug 19, 2024
BTF/CO-RE has been disabled for Solana since:
#37

This patch updates related code (and all applicable unit tests) from roughly
a year of bitrot. This is in preparation for its possible use in the Move
project.

Additionally, a few other 14.0.2022-03-02 -> 15.0-2022-08-09 BPF patches
were reflected in the SBF back-end (e.g., bugfixes).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant