Closed hellogirl007 closed 11 months ago
What is the full command you are trying to run? I suggest also looking at the demo scripts as a reference.
hector lint --llap-lib-dir ~/llvm-project/llvm-build/lib --output test.csv --device cpu ./bdwgc-gc7_6_0/ ./bdwgc-gc7_6_0/tests/gctest ../models/model/
ninja: no work to do.
ninja: no work to do.
ninja: fatal: unknown tool 'rules', did you mean 'urtle'?
Traceback (most recent call last):
File "/home/ubuntu/anaconda3/bin/hector", line 8, in
here are the whole command and error message
The target is the path to the main source file which you are compiling. If you run hector configure
with target ""
then it should list for you the avalaible targets in the current directory. You can choose one of those and use it for your target argument in lint.
Thanks for your reply. The error message I'm encountering now is “Command '['ninja', '-t', 'rules']' returned non-zero exit status 1.”
the "rules" is not in the ninja -t list ninja subtools: browse browse dependency graph in a web browser clean clean built files commands list all commands required to rebuild given targets deps show dependencies stored in the deps log graph output graphviz dot file for targets query show inputs/outputs for a path targets list targets by their rule or depth in the DAG compdb dump JSON compilation database to stdout recompact recompacts ninja-internal data structures
in the ninja.py line 109 rules = ninja("-t", "rules", build_dir=build_dir).splitlines()
line 29. subprocess.run ["ninja", args], the args are "-t", "rules" which lead to the error.
how can I solve this error, looking forward for your reply, many thanks
Did you find your target using configure
?
Are you able to run the demo script?
Did you find your target using
configure
? Are you able to run the demo script?
the target is found by hector configure. When I test the project "bdwgc-gc7_6_0" provided in the dataset, the target is "./tests/gctest", then I run the full command "hector lint --llap-lib-dir ~/llvm-project/llvm-build/lib --output test.csv --device cpu ./bdwgc-gc7_6_0/ ./bdwgc-gc7_6_0/tests/gctest ../models/model/", an error reports like above
I also test the command in "demos/preprocess_demo.sh", the same error occurs the command is "hector configure --llap-lib-dir ~/llvm-project/llvm-build/lib --labels labels.json cmake src/tools/type-generator/type_generator 121 190 415 416"
error: Linking globals named '__cxa_pure_virtual': symbol multiply defined!
This issue with the multiply defined symbols is a compiler issue that arises sometimes when trying to combine complex C++ codebases into a single LLVM IR file. Symbols (variables, function names etc.) are used in multiple places throughout the codebase, which is fine for normal builds. However, the process VulChecker uses to create a monolithic LLVM file for analysis may see symbols collide because each source file can't be sure which is responsible for defining a symbol, so they all do. This problem has affects other projects I've worked on doing analysis in LLVM.
Unfortunately, there is no easy fix - it requires manual code editing of LLVM IR to resolve the symbols. In this case the function is placed by the compiler to handle indirection in C++, so it may not be possible to fix this manually in the code. You may have to build the project first using wllvm
or gllvm
, recover a single LLVM bitcode file, and manually feed this bitcode file through llap
and hector. It is possible this will fail too.
Ultimately, Vulchecker uses LLVM and has some of the same limitations that LLVM has when handling C++ codebases.
I also recall during our research that when we encountered this we only scanned one LLVM IR file at a time. You could try that as well.
I also recall during our research that when we encountered this we only scanned one LLVM IR file at a time. You could try that as well.
Thanks for your reply. The error "error: Linking globals named '__cxa_pure_virtual': symbol multiply defined!" does not occur when I used one target other than "all". But a new error occurs "CalledProcessError: Command '['ninja', '-t', 'rules']' returned non-zero exit status 1."
I review the parameters in ninja and "rules" is not a one. This error also occurs when running demo script.
Hi, ymirsky. When I try to run this great work on a new project, I'm confused about the argument "TARGET". I have tried the following
what should I do when running a new project by hector?