Skip to content
Jon Calhoun edited this page Nov 14, 2015 · 2 revisions

ASCII Format

The ASCII log file's header details the file version and file name.

File Version #: 1
File Name: matmul.c

Next the function name is displayed followed by a listing of each fault site and its properties.Each fault site's description has the following format:

#Fault_site_index LLVM_IR_opcode what_is_corrupted type_of_corruption SRC_file:line_number
Function Name: matmul
------------------------------------------------------------------------------
#101	Alloca	Result	Pointer	__NF:0
#102	Alloca	Result	Pointer	__NF:0
#103	Alloca	Result	Pointer	__NF:0
#104	Alloca	Result	Pointer	__NF:0
#105	Alloca	Result	Pointer	__NF:0
#106	Alloca	Result	Pointer	__NF:0
#107	Alloca	Result	Pointer	__NF:0
#108	Store	Value	Pointer	__NF:0
#109	Store	Value	Pointer	__NF:0
#110	Store	Value	Pointer	__NF:0
#111	Store	Value	Arith-Fix	__NF:0
#112	Store	Value	Arith-Fix	/home/aperson40/Desktop/FlipIt/examples/seq/matmul/matmul.c:4
#113	Load	Result	Arith-Fix	/home/aperson40/Desktop/FlipIt/examples/seq/matmul/matmul.c:4
#114	Load	Result	Arith-Fix	/home/aperson40/Desktop/FlipIt/examples/seq/matmul/matmul.c:4
#115	ICmp	Arg 1	Control-Branch	/home/aperson40/Desktop/FlipIt/examples/seq/matmul/matmul.c:4
#116	Store	Value	Arith-Fix	/home/aperson40/Desktop/FlipIt/examples/seq/matmul/matmul.c:5
#117	Load	Result	Arith-Fix	/home/aperson40/Desktop/FlipIt/examples/seq/matmul/matmul.c:5
#118	Load	Result	Arith-Fix	/home/aperson40/Desktop/FlipIt/examples/seq/matmul/matmul.c:5
#119	ICmp	Arg 1	Control-Branch	/home/aperson40/Desktop/FlipIt/examples/seq/matmul/matmul.c:5
#120	Load	Result	Arith-Fix	/home/aperson40/Desktop/FlipIt/examples/seq/matmul/matmul.c:6
...

If a source file is not found, we display __NF for file not found. This could be because -g is not used when compiling, or there is not a direct mapping to source code (e.g. allocating stack space). The type of injection for each fault site is defined as:

  • Arith-FP - injection is in a floating-point value
  • Pointer - injection is in a pointer
  • Arith-Fix - injection is in an integer type
  • Control-Loop - injection is in a loop induction variable
  • Control-Branch - injection is in a comparison used to direct control flow

Binary Format

The header of the binary file has the following layout:

-----------------------------------------------------------------------------------
| version number (1-byte) | file name size (2-bytes) | file name (0-2^16 -1 bytes) |
-----------------------------------------------------------------------------------

The function header has the following layout:

------------------------------------------------------------------------------------------------------------------------------
| not valid opcode (1-byte) | function name size (1-byte) | function name (0-255) bytes | starting fault site index (8-bytes) |
------------------------------------------------------------------------------------------------------------------------------

Each fault site has the following layout:

-----------------------------------------------------------------------------------------------------------------------------------------------
| opcode (1 byte) | injection type (3 bits) | what is corrupted ( 5 bits) | line number (2-bytes | new optional file name (0- 2^16 -1 bytes) | 
-----------------------------------------------------------------------------------------------------------------------------------------------

If the most significant bit of the line number is set, this signifies that the optional file name is provided to correctly map this fault site to source code. ANDing the line number with the mask 0x7FFF provides the line number in the provided file name.

Clone this wiki locally