Skip to content

Basic LLVM module pass causes segfault #31067

Closed
@frewsxcv

Description

@frewsxcv

Started occurring after f9d4149 merged


Repo exemplifying segfault

Relevant file in repo

To exemplify:

  1. set LLVM_CONFIG environment variable to llvm-config path
  2. cargo build --verbose

Result of stepping through the code with LLDB


Another example of a module pass exemplifying a crash:

bool InstrumentationPass::runOnModule(Module &M) {
  LLVMContext &C = M.getContext();
  IntegerType *Int8Ty  = IntegerType::getInt8Ty(C);
  llvm::Type *i = PointerType::get(Int8Ty, 0);  // segfault happens here
  return true;
}

This is preventing afl.rs from upgrading compatibility with any Rust version >1.2:

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-pluginsArea: compiler plugins, doc.rust-lang.org/nightly/unstable-book/language-features/plugin.html

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions