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
68 stars 35 forks source link

Error in loading llfi-passes.so #121

Closed kakulo closed 5 years ago

kakulo commented 5 years ago

Hi there,

I get an error when loading llfi-passes.so, the error message is as follows.

az@n02:/opt/pasa_lib/llfi/test_suite/PROGRAMS/factorial$ ../../../bin/instrument --readable factorial.ll

WARNING: You enabled 'tracingPropagation' option in input.yaml. The generate executables will be able to output dynamic values for instructions. However, the executables take longer time to execute. If you don't want the trace, please disable the option and re-run instrument. Error opening '/opt/pasa_lib/llfi/bin/../llvm_passes/llfi-passes.so': /opt/pasa_lib/llfi/bin/../llvm_passes/llfi-passes.so: undefined symbol: _ZTIN4llvm10ModulePassE -load request ignored. opt: Unknown command line argument '-genllfiindexpass'. Try: '/opt/pasa_lib/llvm-3.4/bin/opt -help' opt: Did you mean '-inline-cost'? opt: Unknown command line argument '-dotgraphpass'. Try: '/opt/pasa_lib/llvm-3.4/bin/opt -help' opt: Did you mean '-dot-regions'?

Any ideas?

Thanks

karthikp-ubc commented 5 years ago

Are you able to run the regression tests that come with LLFI ? If not, it may be an issue in your LD_LIBRARY_PASS ?

kakulo commented 5 years ago

Hi Karthik,

I am not able to run the regression test correctly. The following is what I get by running the regression test in setup.

az@n02:~/download/LLFI$ ./setup -LLFI_BUILD_ROOT /opt/pasa_lib/llfi -LLVM_SRC_ROOT /home/azguolu/download/llvm-3.4 -LLVM_DST_ROOT /opt/pasa_lib/llvm-3.4/ --no_gui --runTests -- Generating default software failures with /home/azguolu/download/LLFI/tools/FIDL/FIDL-Algorithm.py... -- Success! -- The C compiler identification is GNU 4.8.4 -- The CXX compiler identification is GNU 5.5.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /opt/pasa_lib/llfi Scanning dependencies of target llfi-passes [ 0%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/SampleFIInstSelector.cpp.o [ 1%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/SampleFIRegSelector.cpp.o [ 2%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/SoftwareFailureAutoScanPass.cpp.o [ 3%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/HardwareFailureAutoScanPass.cpp.o [ 4%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/core/FaultInjectionPass.cpp.o [ 5%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/core/InstTracePass.cpp.o [ 6%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/core/LLFIDotGraphPass.cpp.o [ 7%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/core/Utils.cpp.o [ 8%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/core/Controller.cpp.o [ 9%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/core/FICustomSelectorManager.cpp.o [ 10%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/core/FIInstSelector.cpp.o [ 11%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/core/FIInstSelectorManager.cpp.o [ 12%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/core/FIRegSelector.cpp.o [ 13%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/core/GenLLFIIndexPass.cpp.o [ 14%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/core/ProfilingPass.cpp.o [ 14%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/core/RegLocBasedFIRegSelector.cpp.o [ 15%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/hardware_failures/FuncNameFIInstSelector.cpp.o [ 16%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/hardware_failures/LLFIIndexFIInstSelector.cpp.o [ 17%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/hardware_failures/InstTypeFIInstSelector.cpp.o [ 18%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_Timing_HighFrequentEventSelector.cpp.o [ 19%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_SoftwareFaultRegSelectors.cpp.o [ 20%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_Timing_RaceConditionSelector.cpp.o [ 21%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_Res_UnderAccumulatorSelector.cpp.o [ 22%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_Res_ThreadKillerSelector.cpp.o [ 23%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_Res_StalePointerSelector.cpp.o [ 24%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_Res_MemoryLeakSelector.cpp.o [ 25%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_Res_MemoryExhaustionSelector.cpp.o [ 26%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_Res_LowMemorySelector.cpp.o [ 27%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_Res_InvalidPointerSelector.cpp.o [ 28%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_Res_DeadLockSelector.cpp.o [ 28%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_Res_CPUHogSelector.cpp.o [ 29%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_MPI_PacketStormSelector.cpp.o [ 30%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_MPI_NoMessageSelector.cpp.o [ 31%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_MPI_NoDrainSelector.cpp.o [ 32%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_MPI_NoAckSelector.cpp.o [ 33%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_MPI_InvalidSenderSelector.cpp.o [ 34%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_MPI_InvalidMessageSelector.cpp.o [ 35%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_MPI_DeadLockSelector.cpp.o [ 36%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_IO_WrongSavedFormatSelector.cpp.o [ 37%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_IO_WrongSavedAddressSelector.cpp.o [ 38%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_IO_WrongRetrievedFormatSelector.cpp.o [ 39%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_IO_WrongRetrievedAddressSelector.cpp.o [ 40%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_Data_WrongSourceSelector.cpp.o [ 41%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_Data_WrongPointerSelector.cpp.o [ 42%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_Data_WrongDestinationSelector.cpp.o [ 43%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_Data_DataCorruptionSelector.cpp.o [ 43%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_Data_BufferOverflowMemmoveSelector.cpp.o [ 44%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_Data_BufferOverflowMallocSelector.cpp.o [ 45%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_API_WrongModeSelector.cpp.o [ 46%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_API_WrongAPISelector.cpp.o [ 47%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_API_NoOutputSelector.cpp.o [ 48%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_API_NoOpenSelector.cpp.o [ 49%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_API_NoCloseSelector.cpp.o [ 50%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_API_IncorrectOutputSelector.cpp.o [ 51%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_API_InappropriateCloseSelector.cpp.o [ 52%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_API_BufferUnderflowSelector.cpp.o [ 53%] Building CXX object llvm_passes/CMakeFiles/llfi-passes.dir/software_failures/_API_BufferOverflowSelector.cpp.o [ 54%] Linking CXX shared library llfi-passes.so [ 54%] Built target llfi-passes Scanning dependencies of target llfi-rt [ 55%] Building CXX object runtime_lib/CMakeFiles/llfi-rt.dir/CommonFaultInjectors.cpp.o [ 56%] Building C object runtime_lib/CMakeFiles/llfi-rt.dir/FaultInjectionLib.c.o [ 57%] Building CXX object runtime_lib/CMakeFiles/llfi-rt.dir/FaultInjectorManager.cpp.o [ 57%] Building C object runtime_lib/CMakeFiles/llfi-rt.dir/InstTraceLib.c.o [ 58%] Building C object runtime_lib/CMakeFiles/llfi-rt.dir/ProfilingLib.c.o [ 59%] Building C object runtime_lib/CMakeFiles/llfi-rt.dir/Utils.c.o [ 60%] Building CXX object runtime_lib/CMakeFiles/llfi-rt.dir/_FIDLSoftwareFaultInjectors.cpp.o [ 61%] Linking CXX shared library libllfi-rt.so [ 61%] Built target llfi-rt Scanning dependencies of target InjectorScanner [ 61%] Building CXX object runtime_lib/CMakeFiles/InjectorScanner.dir/InjectorScanner.cpp.o [ 62%] Linking CXX executable InjectorScanner [ 62%] Built target InjectorScanner Scanning dependencies of target bin [ 63%] Generating instrument [ 64%] Generating injectfault [ 65%] Generating profile [ 66%] Generating SoftwareFailureAutoScan [ 67%] Generating batchInstrument [ 68%] Generating batchProfile [ 69%] Generating batchInjectfault [ 70%] Generating llfi-gui [ 71%] Generating HardwareFailureAutoScan [ 72%] Generating InjectorAutoScan [ 72%] Built target bin Scanning dependencies of target tools [ 73%] Generating tracediff [ 74%] Generating compiletoIR [ 75%] Generating traceontograph [ 76%] Generating tracetodot [ 77%] Generating tracetools.py [ 78%] Generating traceunion [ 79%] Generating GenerateMakefile [ 80%] Generating zgrviewer/run.sh [ 81%] Generating FIDL/tests [ 81%] Built target tools Scanning dependencies of target config [ 82%] Generating init.py [ 83%] Generating llvm_paths.py [ 84%] Generating llvm_paths.make [ 84%] Built target config Scanning dependencies of target test_suite [ 85%] Generating HardwareFaults [ 86%] Generating SoftwareFaults [ 87%] Generating PROGRAMS [ 88%] Generating Traces [ 89%] Generating BatchMode [ 90%] Generating MakefileGeneration [ 91%] Generating test_suite.yaml [ 91%] Built target test_suite Scanning dependencies of target test_suite-SCRIPTS [ 92%] Generating build_prog.py [ 93%] Generating check_injection.py [ 94%] Generating clean_prog.py [ 94%] Generating clear_all.py [ 95%] Generating clear_llfi.py [ 96%] Generating deploy_prog.py [ 97%] Generating inject_prog.py [ 98%] Generating test_trace_tools.py [ 99%] Generating llfi_test [100%] Generating test_generate_makefile.py [100%] Built target test_suite-SCRIPTS Running all regression tests:

Tests Start on: Mon Dec 17 11:30:49 2018 python3 -u /opt/pasa_lib/llfi/test_suite/SCRIPTS/build_prog.py Build test programs successfully. python3 -u /opt/pasa_lib/llfi/test_suite/SCRIPTS/deploy_prog.py Deploy test programs successfully. python3 -u /opt/pasa_lib/llfi/test_suite/SCRIPTS/inject_prog.py 2 Fault injection ends normally. Calling: check_injection.check_injection() Calling: test_trace_tools.test_trace_tools() MSG: Testing on trace files of: ./Traces/factorial MSG: Testing on trace files of: ./Traces/BufferOverflowMemmove_Data MSG: Testing on trace files of: ./Traces/BufferOverflow_API Calling: test_generate_makefile.test_generate_makefile() MSG: Testing GenerateMakfile on: ./MakefileGeneration/normal_IR /opt/pasa_lib/llfi/test_suite/SCRIPTS/../../tools/GenerateMakefile --dir /opt/pasa_lib/llfi/test_suite/MakefileGeneration/normal_IR --all -o sad.bc rm -rf .ll .bc llfi sad.bc clang -w -emit-llvm -fno-use-cxa-atexit -c sad_cpu.c clang -w -emit-llvm -fno-use-cxa-atexit -c parboil.c clang -w -emit-llvm -fno-use-cxa-atexit -c file.c clang -w -emit-llvm -fno-use-cxa-atexit -c image.c clang -w -emit-llvm -fno-use-cxa-atexit -c main.c /opt/pasa_lib/llvm-3.4/bin/llvm-link -o sad.bc sad_cpu.bc parboil.bc file.bc image.bc main.bc /opt/pasa_lib/llvm-3.4/bin/lli /opt/pasa_lib/llfi/test_suite/MakefileGeneration/normal_IR/sad.bc -i frame.bin,reference.bin -o output.dat IO: 0.220568 GPU: 0.000000 Copy: 0.000000 Compute: 0.332234 MSG: Testing GenerateMakfile on: ./MakefileGeneration/readable_IR /opt/pasa_lib/llfi/test_suite/SCRIPTS/../../tools/GenerateMakefile --dir /opt/pasa_lib/llfi/test_suite/MakefileGeneration/readable_IR --all --readable -o mcf.ll rm -rf .ll .bc llfi mcf.ll clang -w -emit-llvm -fno-use-cxa-atexit -S pbeampp.c clang -w -emit-llvm -fno-use-cxa-atexit -S readmin.c clang -w -emit-llvm -fno-use-cxa-atexit -S implicit.c clang -w -emit-llvm -fno-use-cxa-atexit -S psimplex.c clang -w -emit-llvm -fno-use-cxa-atexit -S mcfutil.c clang -w -emit-llvm -fno-use-cxa-atexit -S treeup.c clang -w -emit-llvm -fno-use-cxa-atexit -S pbla.c clang -w -emit-llvm -fno-use-cxa-atexit -S pflowup.c clang -w -emit-llvm -fno-use-cxa-atexit -S output.c clang -w -emit-llvm -fno-use-cxa-atexit -S mcf.c clang -w -emit-llvm -fno-use-cxa-atexit -S pstart.c /opt/pasa_lib/llvm-3.4/bin/llvm-link -o mcf.ll -S pbeampp.ll readmin.ll implicit.ll psimplex.ll mcfutil.ll treeup.ll pbla.ll pflowup.ll output.ll mcf.ll pstart.ll /opt/pasa_lib/llvm-3.4/bin/lli /opt/pasa_lib/llfi/test_suite/MakefileGeneration/readable_IR/mcf.ll inp.in

MCF SPEC CPU2006 version 1.10 Copyright (c) 1998-2000 Zuse Institut Berlin (ZIB) Copyright (c) 2000-2002 Andreas Loebel & ZIB Copyright (c) 2003-2005 Andreas Loebel

nodes : 5985 active arcs : 102404 simplex iterations : 63475 objective value : 3180065918 new implicit arcs : 2393292 active arcs : 2495696 simplex iterations : 118645 objective value : 2060055866 erased arcs : 2387557 checksum : 2997477 done ==== Check Injection Result ==== ./SoftwareFaults/LowMemory_Res FAIL: No ./llfi folder found! ./SoftwareFaults/IncorrectOutput_API FAIL: No ./llfi folder found! ./SoftwareFaults/NoMessage_MPI FAIL: No ./llfi folder found! ./HardwareFaults/insttype FAIL: No ./llfi folder found! ./SoftwareFaults/InappropriateClose_API FAIL: No ./llfi folder found! ./SoftwareFaults/WrongAPI_API FAIL: No ./llfi folder found! ./SoftwareFaults/WrongSource_Data FAIL: No ./llfi folder found! ./SoftwareFaults/NoClose_API FAIL: No ./llfi folder found! ./SoftwareFaults/UnderAccumulator_Res FAIL: No ./llfi folder found! ./SoftwareFaults/Deadlock_Res FAIL: No ./llfi folder found! ./HardwareFaults/multiplebits FAIL: No ./llfi folder found! ./SoftwareFaults/StalePointer_Res FAIL: No ./llfi folder found! ./HardwareFaults/random FAIL: No ./llfi folder found! ./SoftwareFaults/WrongRetrievedAddress_IO FAIL: No ./llfi folder found! ./SoftwareFaults/BufferOverflow_API FAIL: No ./llfi folder found! ./SoftwareFaults/NoOpen_API FAIL: No ./llfi folder found! ./SoftwareFaults/NoDrain_MPI FAIL: No ./llfi folder found! ./SoftwareFaults/NoOutput_Data FAIL: No ./llfi folder found! ./SoftwareFaults/WrongRetrievedFormat_IO FAIL: No ./llfi folder found! ./SoftwareFaults/NoAck_MPI FAIL: No ./llfi folder found! ./HardwareFaults/tracing FAIL: No ./llfi folder found! ./SoftwareFaults/WrongPointer_Data FAIL: No ./llfi folder found! ./SoftwareFaults/HighFrequentEvent_Timing FAIL: No ./llfi folder found! ./SoftwareFaults/InvalidSender_MPI FAIL: No ./llfi folder found! ./BatchMode/NoOpen_API_WrongMode_API_BufferUnderflow_API FAIL: No ./llfi folder found! ./SoftwareFaults/MemoryExhaustion_Res FAIL: No ./llfi folder found! ./SoftwareFaults/RaceCondition_Timing FAIL: No ./llfi folder found! ./SoftwareFaults/WrongSavedAddress_IO FAIL: No ./llfi folder found! ./HardwareFaults/funcname FAIL: No ./llfi folder found! ./SoftwareFaults/BufferOverflowMalloc_Data FAIL: No ./llfi folder found! ./SoftwareFaults/WrongMode_API FAIL: No ./llfi folder found! ./SoftwareFaults/BufferOverflowMemmove_Data FAIL: No ./llfi folder found! ./SoftwareFaults/DataCorruption_Data FAIL: No ./llfi folder found! ./SoftwareFaults/MemoryLeak_Res FAIL: No ./llfi folder found! ./SoftwareFaults/IncorrectOutput_Data FAIL: No ./llfi folder found! ./SoftwareFaults/CPUHog_Res FAIL: No ./llfi folder found! ./SoftwareFaults/InvalidMessage_MPI FAIL: No ./llfi folder found! ./HardwareFaults/llfiindex FAIL: No ./llfi folder found! ./SoftwareFaults/WrongSavedFormat_IO FAIL: No ./llfi folder found! ./SoftwareFaults/BufferUnderflow_API FAIL: No ./llfi folder found! ./SoftwareFaults/WrongDestination_Data FAIL: No ./llfi folder found! ./BatchMode/SoftwareFailureAutoScan Subdirectories for failure modes not found! ./SoftwareFaults/ThreadKiller_Res FAIL: No ./llfi folder found! ./SoftwareFaults/PacketStorm_MPI FAIL: No ./llfi folder found! ./SoftwareFaults/InvalidPointer_Res FAIL: No ./llfi folder found! ./SoftwareFaults/NoOutput_API FAIL: No ./llfi folder found! ==== Test Trace Tools Result ==== ./Traces/factorial PASS ./Traces/BufferOverflowMemmove_Data PASS ./Traces/BufferOverflow_API PASS ==== Test MakefileGeneration Tool Result ==== ./MakefileGeneration/normal_IR PASS ./MakefileGeneration/readable_IR PASS === Overall Counts ==== Total tests: 51 Passed tests: 5 Failed tests: 46 Tests Ends on: Mon Dec 17 11:31:31 2018

What should I add to my LD_LIBRARY_PATH?

Thanks