Recommend using the same OS in dynamic validation.
—————–IMPLEMENTATION————–
The static analysis component was implemented using the Clang Tool 3.4. The corresponding directory Static-Analysis.
Our guided symbolic execution was implemented based on KLEE 1.2. The directory is Guided-Symbolic-Execution/klee and Guided-Symbolic-Execution/klee-uclibc, compile it using the instruction at http://klee.github.io/build-llvm34/.
We used Simics virtual platforms 4.6 to implement the dynamic validation phase. The directory is Dynamic-Validation.
——————Static Detection————–
klee-gcc is a tool compiling device driver to clang AST, this tool is in directory Static-Analysis/scripts/klee-gcc.
Recommend using the same OS in dynamic validation.
—————–IMPLEMENTATION————–
The static analysis component was implemented using the Clang Tool 3.4. The corresponding directory Static-Analysis.
Our guided symbolic execution was implemented based on KLEE 1.2. The directory is Guided-Symbolic-Execution/klee and Guided-Symbolic-Execution/klee-uclibc, compile it using the instruction at http://klee.github.io/build-llvm34/.
We used Simics virtual platforms 4.6 to implement the dynamic validation phase. The directory is Dynamic-Validation.
——————Static Detection————–
klee-gcc is a tool compiling device driver to clang AST, this tool is in directory Static-Analysis/scripts/klee-gcc.
cdExperiment−and−Subjects/moti−examplemake CC=/path/to/klee-gcc
then compile SRacer
cdStatic−Analysis/SRacermkdir build; cd build; cmake ..
makeAfterfinishingcompilingSRaceranddevicedrivers.find $(pwd) -name “*.ast” > astList.txt
Note that ast files are generated by klee-gcc.
run the command:
SRacer/path/to/astList.txt/path/to/config.txt/output/pathi.e.,SRacerastList.txtconfig.txt./config.txtcanbefoundinExperiment−and−SubjectsandStatic−Analysis/SRacerAsimplewarningmanagertoolprovidedindirectoryExperiment−and−Subjects/static−result/iswarningManager.py.−−−−−−−−−−−−−−−−−−SymbolicExecution−−−−−−−−−−−−−−Useklee−gcc−bctocompilekernelmoduletollvmIR.TheLLVMverisonis3.4.Note:instrumentationsarerequiredtomakeKLEEabletoexecutedrivers.First,Experiment−and−Subjects/static−result/autoIns.pyisproividedtoinstrumentinteruptcalls.Second,determinevariablesassymbolicbyusingkleemakesymbolic.Third,providedguidedfilesnamedasGuideSrc.txt,sothatthemodifiedKLEEcouldregonizewhichpathsouldcoverandwhichnot.Thefileformatisasfollows:Info:filename1linenumber1filename2linenumber2filename3linenumber3VerysimilarwiththeoutputfileofSRacer(nameofstaticanalysisphase).cd Experiment-and-Subjects/moti-example
makeCC=/path/to/klee−gcc−bcklee -entry-point=dataRace_init -guidedExe -libc=uclibc exampleSym.bc
——————Dynamic Validation————–
Use Simics4.6 to dynamic validate each potentional data race.
Test case configureation:
Open checkpoint “ubuntu-gcc” (we install ubuntu on Simics)
“simics>” means in command line window (Simics GUI -> “tools”->”command line window”)
“$” means in simulated system.
simics> enable-real-time-mode
The following instructions are used to transform subjects:
ftp10.10.0.1Pressenterbin
getexample.tar.gzquit
The following instructions are used to compile drivers:
tarxfexample.tar.gzcd general
makesudo insmod example.ko
The following instructions are used to save the status so that we can use it again without redo previous steps:
simics> stop
simics> write-configuration ckp-example
simics> c
The following instructions are used to store symbol file to host:
cat/proc/kallsyms>exampleSymbolftp 10.10.0.1
Press enter
putexampleSymbolquit
When performing automatic validation (Scripts are in directory Dynamic-Validation/scripts/analysePDR.py):
If Simics is running and you want to test the next case, open “command line window” and input “quit”.
When performing validation one by one:
Scripts are provided in directory Dynamic-Validation/conf.py. It read Dynamic-Validation/Info.py as information file.
The conf.py can be run by entering run-python-scripts in command line window or selecting python file in Simics menu.