Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the meaning of the output? #1576

Open
tttturtle-russ opened this issue Oct 15, 2024 · 0 comments
Open

What is the meaning of the output? #1576

tttturtle-russ opened this issue Oct 15, 2024 · 0 comments

Comments

@tttturtle-russ
Copy link
Contributor

tttturtle-russ commented Oct 15, 2024

Hi, thanks for the brilliant framework at first.
I'm trying to use SVF to analyze the linux kernel concurrent bugs, I run the following command to analyze the bitcode

wpa -ander -dump-mssa -stat=false -svfg -race combined.bc

and I get the results:

==========FUNCTION: list_add_tail.824==========
11638V_1 = ENCHI(MR_11638V_0)   pts{152633 }
11636V_1 = ENCHI(MR_11636V_0)   pts{152632 }
16574V_1 = ENCHI(MR_16574V_0)   pts{69093 }
16572V_1 = ENCHI(MR_16572V_0)   pts{69091 }

IntraICFGNode56814 {fun: list_add_tail.824{ "ln": 100, "fl": "./include/linux/list.h" }}
AddrStmt: [Var69090 <-- Var69091]
   %3 = alloca ptr, align 8 { "ln": 100, "fl": "./include/linux/list.h" }
IntraICFGNode56815 {fun: list_add_tail.824{ "ln": 100, "fl": "./include/linux/list.h" }}
AddrStmt: [Var69092 <-- Var69093]
   %4 = alloca ptr, align 8 { "ln": 100, "fl": "./include/linux/list.h" }
IntraICFGNode56816 {fun: list_add_tail.824}
StoreStmt: [Var69090 <-- Var69088]
   store ptr %0, ptr %3, align 8 
16572V_2 = STCHI(MR_16572V_1)   pts{69091 }

IntraICFGNode56817 {fun: list_add_tail.824}
StoreStmt: [Var69092 <-- Var69089]
   store ptr %1, ptr %4, align 8 
16574V_2 = STCHI(MR_16574V_1)   pts{69093 }

LDMU(MR_16572V_2)       pts{69091 }
IntraICFGNode56818 {fun: list_add_tail.824{ "ln": 102, "cl": 13, "fl": "./include/linux/list.h" }}
LoadStmt: [Var69098 <-- Var69090]
   %5 = load ptr, ptr %3, align 8, !dbg !149621 { "ln": 102, "cl": 13, "fl": "./include/linux/list.h" }

LDMU(MR_16574V_2)       pts{69093 }
IntraICFGNode56819 {fun: list_add_tail.824{ "ln": 102, "cl": 18, "fl": "./include/linux/list.h" }}
LoadStmt: [Var69099 <-- Var69092]
   %6 = load ptr, ptr %4, align 8, !dbg !149622 { "ln": 102, "cl": 18, "fl": "./include/linux/list.h" }
IntraICFGNode56820 {fun: list_add_tail.824{ "ln": 102, "cl": 24, "fl": "./include/linux/list.h" }}
GepStmt: [Var69100 <-- Var69099]
   %7 = getelementptr inbounds %struct.list_head, ptr %6, i32 0, i32 1, !dbg !149623 { "ln": 102, "cl": 24, "fl": "./include/linux/list.h" }

LDMU(MR_11638V_1)       pts{152633 }
IntraICFGNode56821 {fun: list_add_tail.824{ "ln": 102, "cl": 24, "fl": "./include/linux/list.h" }}
LoadStmt: [Var69101 <-- Var69100]
   %8 = load ptr, ptr %7, align 8, !dbg !149623 { "ln": 102, "cl": 24, "fl": "./include/linux/list.h" }

LDMU(MR_16574V_2)       pts{69093 }
IntraICFGNode56822 {fun: list_add_tail.824{ "ln": 102, "cl": 30, "fl": "./include/linux/list.h" }}
LoadStmt: [Var69102 <-- Var69092]
   %9 = load ptr, ptr %4, align 8, !dbg !149624 { "ln": 102, "cl": 30, "fl": "./include/linux/list.h" }

CALMU(MR_11638V_1)      pts{152633 }
CALMU(MR_11636V_1)      pts{152632 }
CallICFGNode56823 {fun: list_add_tail.824{ "ln": 102, "cl": 2, "fl": "./include/linux/list.h" }}
CallPE: [Var69606 <-- Var69098]
   call void @__list_add.832(ptr noundef %5, ptr noundef %8, ptr noundef %9) #27, !dbg !149625 { "ln": 102, "cl": 2, "fl": "./include/linux/list.h" }
CallPE: [Var69607 <-- Var69101]
   call void @__list_add.832(ptr noundef %5, ptr noundef %8, ptr noundef %9) #27, !dbg !149625 { "ln": 102, "cl": 2, "fl": "./include/linux/list.h" }
CallPE: [Var69608 <-- Var69102]
   call void @__list_add.832(ptr noundef %5, ptr noundef %8, ptr noundef %9) #27, !dbg !149625 { "ln": 102, "cl": 2, "fl": "./include/linux/list.h" }
11638V_2 = CALCHI(MR_11638V_1)  pts{152633 }
11636V_2 = CALCHI(MR_11636V_1)  pts{152632 }

IntraICFGNode56827 {fun: list_add_tail.824{ "ln": 103, "cl": 1, "fl": "./include/linux/list.h" }}
   ret void, !dbg !149626 { "ln": 103, "cl": 1, "fl": "./include/linux/list.h" }
RETMU(MR_11638V_2)      pts{152633 }
RETMU(MR_11636V_2)      pts{152632 }
RETMU(MR_16574V_2)      pts{69093 }
RETMU(MR_16572V_2)      pts{69091 }

According to the source code

SVFUtil::outs() << "LDMU(MR_" << this->getMR()->getMRID() << "V_" << this->getMRVer()->getSSAVersion() << ") \t" <<

and
SVFUtil::outs() << this->getMR()->getMRID() << "V_" << this->getResVer()->getSSAVersion() <<

The LDMU and STCHI represent the read and write instruction to a memory.
My question is

  1. Is the command right? Am I missing some options?
  2. what exactly does the output mean, for example,
IntraICFGNode56814 {fun: list_add_tail.824{ "ln": 100, "fl": "./include/linux/list.h" }}
AddrStmt: [Var69090 <-- Var69091]
   %3 = alloca ptr, align 8 { "ln": 100, "fl": "./include/linux/list.h" }
IntraICFGNode56815 {fun: list_add_tail.824{ "ln": 100, "fl": "./include/linux/list.h" }}
AddrStmt: [Var69092 <-- Var69093]
   %4 = alloca ptr, align 8 { "ln": 100, "fl": "./include/linux/list.h" }
IntraICFGNode56816 {fun: list_add_tail.824}
StoreStmt: [Var69090 <-- Var69088]
   store ptr %0, ptr %3, align 8 
16572V_2 = STCHI(MR_16572V_1)   pts{69091 }

means in line 100 of include/linux/list.h writes to a memory location?
Or

LDMU(MR_16574V_2)       pts{69093 }
IntraICFGNode56822 {fun: list_add_tail.824{ "ln": 102, "cl": 30, "fl": "./include/linux/list.h" }}
LoadStmt: [Var69102 <-- Var69092]
   %9 = load ptr, ptr %4, align 8, !dbg !149624 { "ln": 102, "cl": 30, "fl": "./include/linux/list.h" }

means in line 102 of include/linux/list.h reads from memory?
Thanks so much for answering the question!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant