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

Bugs I encountered when running IntAbs #1

Open
LuckyYZC opened this issue Dec 15, 2021 · 1 comment
Open

Bugs I encountered when running IntAbs #1

LuckyYZC opened this issue Dec 15, 2021 · 1 comment

Comments

@LuckyYZC
Copy link

LuckyYZC commented Dec 15, 2021

Dear Author,
I encountered some bugs when I running IntAbs. If you have some suggestions for fixing these errors, I would be very grateful.
When I run the instruction "make", it reports the following errors.

[ 16%] Building CXX object worklist-ai/CMakeFiles/worklistAI.dir/worklistai.cpp.o
/home/guisen/source/intAbs/src/worklist-ai/worklistai.cpp: In member function ‘void WorklistAI::addDomLoadStoreFacts(std::set<llvm::Function*>, z3::context&, _Z3_fixedpoint*&)’:
/home/guisen/source/intAbs/src/worklist-ai/worklistai.cpp:2038:45: error: no matching function for call to ‘llvm::DominatorTree::DominatorTree(llvm::Function&)’
         DominatorTree &dt = DominatorTree(*f);
                                             ^
/home/guisen/source/intAbs/src/worklist-ai/worklistai.cpp:2038:45: note: candidates are:
In file included from /usr/lib/llvm-3.6/include/llvm/Analysis/PostDominators.h:17:0,
                 from /home/guisen/source/intAbs/src/worklist-ai/worklistai.cpp:20:
/usr/lib/llvm-3.6/include/llvm/IR/Dominators.h:77:3: note: llvm::DominatorTree::DominatorTree(llvm::DominatorTree&&)
   DominatorTree(DominatorTree &&Arg)
   ^
/usr/lib/llvm-3.6/include/llvm/IR/Dominators.h:77:3: note:   no known conversion for argument 1 from ‘llvm::Function’ to ‘llvm::DominatorTree&&’
/usr/lib/llvm-3.6/include/llvm/IR/Dominators.h:75:3: note: llvm::DominatorTree::DominatorTree()
   DominatorTree() : DominatorTreeBase<BasicBlock>(false) {}
   ^
/usr/lib/llvm-3.6/include/llvm/IR/Dominators.h:75:3: note:   candidate expects 0 arguments, 1 provided
make[2]: *** [worklist-ai/CMakeFiles/worklistAI.dir/worklistai.cpp.o] Error 1
make[1]: *** [worklist-ai/CMakeFiles/worklistAI.dir/all] Error 2
make: *** [all] Error 2

It looks like the function DominatorTree is being used incorrectly. So I replace "DominatorTree &dt = DominatorTree(*f);" by
"DominatorTree &dt = getAnalysis(*f).getDomTree();" in the worklistai.cpp. Then it works, the command “make” can be run through. But when I use the libworklistAI.so built to run the cases in the directory test, it does not work, and reports the following errors.

guisen@ubuntu:~/source/intAbs/src/build$ make
Scanning dependencies of target worklistAI
[ 16%] Building CXX object worklist-ai/CMakeFiles/worklistAI.dir/worklistai.cpp.o
Linking CXX shared module libworklistAI.so
[100%] Built target worklistAI
guisen@ubuntu:~/source/intAbs/src/build$ cd ../test/
guisen@ubuntu:~/source/intAbs/src/test$ ./run.sh test1
Testing test1
/usr/lib/llvm-3.6/bin/clang -emit-llvm -S -c main.c
/usr/bin/time -f %e -o box_ncomb_nonpri.time /usr/lib/llvm-3.6/bin/opt -load /home/guisen/source/intAbs/src/build/worklist-ai/libworklistAI.so -worklist-ai  -nocombs -box main.ll >main_out.bc 2>box_ncomb_nonpri.out
Tue Dec 14 23:35:05 PST 2021
139
[ERROR]: opt (box ncomb)
ERROR: get_num_errs(): error string not found in output
TEST PASSED: box_ncomb_nonpri
/usr/bin/time -f %e -o box_ncomb_pri.time /usr/lib/llvm-3.6/bin/opt -load /home/guisen/source/intAbs/src/build/worklist-ai/libworklistAI.so -worklist-ai  -nocombs -priority -box main.ll >main_out.bc 2>box_ncomb_pri.out
Tue Dec 14 23:35:05 PST 2021
139
[ERROR]: opt (box ncomb)
ERROR: get_num_errs(): error string not found in output
TEST PASSED: box_ncomb_pri
@ChunghaSung
Copy link
Owner

Hello, I just found this post.

I think this is a version issue. APIs usages are different in different LLVM versions and I think I had similar problem when I worked on this (like several years ago)

Could you try to use LLVM 3.7 instead? Based on my commit history, I think I used 3.7, not 3.6.

Also, other way to create a domTree can be found here in LLVM 3.7: https://github.com/trailofbits/DomTreSat/blob/master/LLVMPassBuild/LLVMPassBuild/LLVMDomTreePass.cpp#L148

Please let me know if you still have this issue.

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

No branches or pull requests

2 participants