Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[tools] Unable to build llvm-mc-assemble-fuzzer #158333

@rbintel

Description

@rbintel

On the latest version (5d088ba), llvm-mc-assemble-fuzzer fails to build due to outdated API call to llvm::Target::createAsmStreamer, a raw pointer to MCInstPrinter is passed instead of a unique pointer. Wrapping into a unique ptr and building (from an empty corpus) results in an asan heap-buffer-overflow error.

Error:

lvm-project/llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp:203:66: error: no viable conversion from 'MCInstPrinter *' to 'std::unique_ptr<MCInstPrinter>'                                                                                                                                               
  203 |     Str.reset(TheTarget->createAsmStreamer(Ctx, std::move(FOut), IP,

Reproduction:

cd llvm-project

mkdir build

cmake -S ./llvm \
-B ./build \
-DLLVM_USE_SANITIZER=Address \
-DLLVM_USE_SANITIZE_COVERAGE=On \
-DCMAKE_C_COMPILER=clang-18 \
-DCMAKE_CXX_COMPILER=clang++-18 \
-DCMAKE_BUILD_TYPE=Debug

cmake --build ./build --target llvm-mc-assemble-fuzzer -j

Metadata

Metadata

Assignees

No one assigned

    Labels

    build-problemllvm-toolsAll llvm tools that do not have corresponding tag

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions