DependableSystemsLab / LLFI

LLFI is an LLVM based fault injection tool, that injects faults into the LLVM IR of the application source code. The faults can be injected into specific program points, and the effect can be easily tracked back to the source code. Please refer to the paper below. NOTE: If you publish a paper using LLFI, please add it to PaperLLFI.bib
http://blogs.ubc.ca/karthik/2014/02/23/quantifying-the-accuracy-of-high-level-fault-injection-techniques/
Other
66 stars 36 forks source link

Build a single IR file with the LLFI tool `compiletoIR` #120

Closed zuiaiziai closed 5 years ago

zuiaiziai commented 5 years ago

Hello, I followed the README file to test LLFI. It worked well to use factorial.c file to test LLFI. And then, I want to use LLFI to build spec2000 benchmarks into IR file. But it didn't work well. The tested file I used is 164.gzip in spec2000. I used command "../../../LLFI-build/tools/compiletoIR --readable -o gzip.ll gzip.c". It can produced gzip.ll file but the gzip.ll file didn't have main function. So when I used command "../../../LLFI-build/bin/instrument --readable gzip.ll" to produce gzip-llfi_index.ll, some errors were produced.As follow: ERROR: Function main does not exist, which is required by LLFI

ERROR: there was an error during running the instrumentation pass, please follow the provided instructions for instrument.

The 164.gzip has more than one c file and gzip.c is the main file. I don't know how to build into IR file in this situation.Could you help me to solve this problem?Please e-mail me at 1090366769@qq.com. Thank you very much!

lpalazzi commented 5 years ago

Issue resolved over e-mail.

In the case of multiple source .c files you must link the IR files after compiling each individual source file to IR (can use LLVM/Clang's "llvm-link" to accomplish this).