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

Error when trying to test html5ever #38

Closed
schumannd opened this issue Jan 31, 2016 · 1 comment · Fixed by #40
Closed

Error when trying to test html5ever #38

schumannd opened this issue Jan 31, 2016 · 1 comment · Fixed by #40

Comments

@schumannd
Copy link

Hi,
I wanted to do some fuzzy testing on the Servo project, starting with html5ever.
So I tried setting afl.rs up according to the readme. But even if I just add the two dependencies, I get the following errors from cargo build:

failed to run custom build command for `afl-plugin v0.1.0`
Process didn't exit successfully: `/home/vagrant/html5ever/target/debug/build/afl-plugin-584d29624accb60e/build-script-build` (exit code: 101)
--- stdout
[*] $LLVM_CONFIG not set. Will assume you built rustc from source.

--- stderr
++ /opt/rust/x86_64-unknown-linux-gnu/stage2/bin/../../llvm/Release/bin/llvm-config --cxxflags
+ CXXFLAGS='-I/opt/rust/src/llvm/include -I/opt/rust/x86_64-unknown-linux-gnu/llvm/include  -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -fomit-frame-pointer -std=c++11 -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -fPIC -ffunction-sections -fdata-sections -Wcast-qual -O2 -fPIC -Wall -Werror -fno-rtti'
+ g++ -I/opt/rust/src/llvm/include -I/opt/rust/x86_64-unknown-linux-gnu/llvm/include -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -fomit-frame-pointer -std=c++11 -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -fPIC -ffunction-sections -fdata-sections -Wcast-qual -O2 -fPIC -Wall -Werror -fno-rtti -c src/afl-llvm-pass.so.cc -o /home/vagrant/html5ever/target/debug/build/afl-plugin-584d29624accb60e/out/afl-llvm-pass.o
src/afl-llvm-pass.so.cc: In member function ‘virtual bool {anonymous}::AFLCoverage::runOnModule(llvm::Module&)’:
src/afl-llvm-pass.so.cc:106:25: error: no matching function for call to ‘llvm::IRBuilder<>::IRBuilder(llvm::BasicBlock::iterator&)’
       IRBuilder<> IRB(IP);
                         ^
In file included from src/afl-llvm-pass.so.cc:30:0:
/opt/rust/src/llvm/include/llvm/IR/IRBuilder.h:579:3: note: candidate: llvm::IRBuilder<preserveNames, T, Inserter>::IRBuilder(llvm::BasicBlock*, llvm::BasicBlock::iterator, llvm::MDNode*, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >) [with bool preserveNames = true; T = llvm::ConstantFolder; Inserter = llvm::IRBuilderDefaultInserter<true>; llvm::BasicBlock::iterator = llvm::ilist_iterator<llvm::Instruction>]
   IRBuilder(BasicBlock *TheBB, BasicBlock::iterator IP,
   ^
/opt/rust/src/llvm/include/llvm/IR/IRBuilder.h:579:3: note:   candidate expects 4 arguments, 1 provided


[package]
/opt/rust/src/llvm/include/llvm/IR/IRBuilder.h:572:3: note: candidate: llvm::IRBuilder<preserveNames, T, Inserter>::IRBuilder(llvm::BasicBlock*, llvm::BasicBlock::iterator, const T&, llvm::MDNode*, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >) [with bool preserveNames = true; T = llvm::ConstantFolder; Inserter = llvm::IRBuilderDefaultInserter<true>; llvm::BasicBlock::iterator = llvm::ilist_iterator<llvm::Instruction>]
   IRBuilder(BasicBlock *TheBB, BasicBlock::iterator IP, const T &F,
   ^
/opt/rust/src/llvm/include/llvm/IR/IRBuilder.h:572:3: note:   candidate expects 5 arguments, 1 provided
/opt/rust/src/llvm/include/llvm/IR/IRBuilder.h:566:12: note: candidate: llvm::IRBuilder<preserveNames, T, Inserter>::IRBuilder(llvm::Instruction*, llvm::MDNode*, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >) [with bool preserveNames = true; T = llvm::ConstantFolder; Inserter = llvm::IRBuilderDefaultInserter<true>]
   explicit IRBuilder(Instruction *IP, MDNode *FPMathTag = nullptr,
            ^
/opt/rust/src/llvm/include/llvm/IR/IRBuilder.h:566:12: note:   no known conversion for argument 1 from ‘llvm::BasicBlock::iterator {aka llvm::ilist_iterator<llvm::Instruction>}’ to ‘llvm::Instruction*’
/opt/rust/src/llvm/include/llvm/IR/IRBuilder.h:560:12: note: candidate: llvm::IRBuilder<preserveNames, T, Inserter>::IRBuilder(llvm::BasicBlock*, llvm::MDNode*, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >) [with bool preserveNames = true; T = llvm::ConstantFolder; Inserter = llvm::IRBuilderDefaultInserter<true>]
   explicit IRBuilder(BasicBlock *TheBB, MDNode *FPMathTag = nullptr,
            ^
/opt/rust/src/llvm/include/llvm/IR/IRBuilder.h:560:12: note:   no known conversion for argument 1 from ‘llvm::BasicBlock::iterator {aka llvm::ilist_iterator<llvm::Instruction>}’ to ‘llvm::BasicBlock*’
/opt/rust/src/llvm/include/llvm/IR/IRBuilder.h:554:12: note: candidate: llvm::IRBuilder<preserveNames, T, Inserter>::IRBuilder(llvm::BasicBlock*, const T&, llvm::MDNode*, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >) [with bool preserveNames = true; T = llvm::ConstantFolder; Inserter = llvm::IRBuilderDefaultInserter<true>]
   explicit IRBuilder(BasicBlock *TheBB, const T &F, MDNode *FPMathTag = nullptr,
            ^
/opt/rust/src/llvm/include/llvm/IR/IRBuilder.h:554:12: note:   candidate expects 4 arguments, 1 provided
/opt/rust/src/llvm/include/llvm/IR/IRBuilder.h:550:12: note: candidate: llvm::IRBuilder<preserveNames, T, Inserter>::IRBuilder(llvm::LLVMContext&, llvm::MDNode*, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >) [with bool preserveNames = true; T = llvm::ConstantFolder; Inserter = llvm::IRBuilderDefaultInserter<true>]
   explicit IRBuilder(LLVMContext &C, MDNode *FPMathTag = nullptr,
            ^
/opt/rust/src/llvm/include/llvm/IR/IRBuilder.h:550:12: note:   no known conversion for argument 1 from ‘llvm::BasicBlock::iterator {aka llvm::ilist_iterator<llvm::Instruction>}’ to ‘llvm::LLVMContext&’
/opt/rust/src/llvm/include/llvm/IR/IRBuilder.h:544:3: note: candidate: llvm::IRBuilder<preserveNames, T, Inserter>::IRBuilder(llvm::LLVMContext&, const T&, Inserter, llvm::MDNode*, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >) [with bool preserveNames = true; T = llvm::ConstantFolder; Inserter = llvm::IRBuilderDefaultInserter<true>]
   IRBuilder(LLVMContext &C, const T &F, Inserter I = Inserter(),
   ^
/opt/rust/src/llvm/include/llvm/IR/IRBuilder.h:544:3: note:   candidate expects 5 arguments, 1 provided
/opt/rust/src/llvm/include/llvm/IR/IRBuilder.h:540:7: note: candidate: llvm::IRBuilder<>::IRBuilder(const llvm::IRBuilder<>&)
 class IRBuilder : public IRBuilderBase, public Inserter {
       ^
/opt/rust/src/llvm/include/llvm/IR/IRBuilder.h:540:7: note:   no known conversion for argument 1 from ‘llvm::BasicBlock::iterator {aka llvm::ilist_iterator<llvm::Instruction>}’ to ‘const llvm::IRBuilder<>&’
/opt/rust/src/llvm/include/llvm/IR/IRBuilder.h:540:7: note: candidate: llvm::IRBuilder<>::IRBuilder(llvm::IRBuilder<>&&)
/opt/rust/src/llvm/include/llvm/IR/IRBuilder.h:540:7: note:   no known conversion for argument 1 from ‘llvm::BasicBlock::iterator {aka llvm::ilist_iterator<llvm::Instruction>}’ to ‘llvm::IRBuilder<>&&’
thread '<main>' panicked at 'assertion failed: Command::new("bash").arg("build.bash").status().unwrap().success()', /home/vagrant/.cargo/registry/src/6github.com-88ac128001ac3a9a/afl-plugin-0.1.0/build.rs:13
note: Run with `RUST_BACKTRACE=1` for a backtrace.

This was done in the vagrant VM provided by html5ever. So to reproduce:

  • clone html5ever
  • vagrant up (takes 1-2 hours)
  • vagrant ssh
  • add afl.rs as dependency
  • build breaks with the above errors
@frewsxcv
Copy link
Member

Yes, thanks for pointing this out. LLVM was just upgraded in rustc a few days ago, and my code doesn't account for that upgrade. Will fix this shortly, thanks for the report!

frewsxcv added a commit that referenced this issue Jan 31, 2016
rustc LLVM was upgraded in:

rust-lang/rust#30448

This fixes compatibility with API changes

Fixes #38
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.

2 participants