svf-tools / teaching-software-analysis Goto Github PK
View Code? Open in Web Editor NEWTeaching and Learning Software Analysis via SVF
License: GNU General Public License v3.0
Teaching and Learning Software Analysis via SVF
License: GNU General Public License v3.0
Hello dear author:
I really appreciate your SVF tool and the course you have provided. Thank you very much!
I have encountered some problems in assignment-2, I have followed your pseudocode in your PPT and unfortunately, the iter
object in the picture below(type of ICFGEdge) is unable to be converted to CallCFGEdge
type, so I can't get the instruction object by using getCallSite()
function. The red lines below the code show the error part.
I have beed bothered with this problem for days. Can you offere me some advice?Thank you.
Hi all
I followed all the step in https://github.com/SVF-tools/Teaching-Software-Analysis/wiki/Installation-of-Docker,-VSCode-and-its-extensions. When I try to debug the hello.cpp, the error occur like this:
and the terminal output this:
I clicked the debug anyway, the code can print but all my breakpoint didn't work.
Does anyone know how to solve it?
Thanks
Dear Sir,
I stuck in CodeGraphs exercise.
Segmentation fault occurs in line 55 in CodeGraph.cpp, so I find the location that segfault occurs.
How can I fix it?
Please give me any advice.
line 55 in CodeGraph.cpp
...
SVFIRBuilder builder;
...
getPAG() in line 55 in SVFIRBuilder.h
...
/// Constructor
SVFIRBuilder(): pag(SVFIR::getPAG()), svfMod(nullptr), curBB(nullptr),curVal(nullptr)
{
}
...
line 110 in getPAG in SVFIR.h
/// Singleton design here to make sure we only have one instance during any analysis
//@{
static inline SVFIR* getPAG(bool buildFromFile = false)
{
if (pag == nullptr)
{
pag = new SVFIR(buildFromFile); // line 110 is here !
}
return pag;
}
call build function in line 45 in SVFIR Constructor in SVFIR.cpp
SVFIR::SVFIR(bool buildFromFile) : IRGraph(buildFromFile)
{
icfg = new ICFG();
ICFGBuilder builder(icfg);
builder.build(getModule()); // line 45 is here !
}
getModule()
returns nullptr. So, parameter of build()
is nullptr
// line 155~158 in SVFIR.h
inline SVFModule* getModule()
{
return SymbolTableInfo::SymbolInfo()->getModule();
}
SymbolInfo()->getModule()
// line 157 ~ 161 in SymbolTableinfo.h
/// Module
inline SVFModule* getModule()
{
return mod;
}
SymbolTableInfo::SymbolInfo()
*// line 59 ~ 67 in SymbolTableInfo.cpp*
SymbolTableInfo SymbolTableInfo::SymbolInfo()
{
if (symInfo == nullptr)
{
symInfo = new SymbolTableInfo();
symInfo->setModelConstants(Options::ModelConsts);
}
return symInfo;
}
SymbolTableInfo Constructor
mod
initializes with nullptr
// line 114 ~ 118
/// Constructor
SymbolTableInfo(void) :
mod(nullptr), modelConstants(false), totalSymNum(0), maxStruct(nullptr), maxStSize(0)
{
}
setModelConstants()
mod
variablevoid setModelConstants(bool _modelConstants)
{
modelConstants = _modelConstants;
}
→ So, getModule()
returns nullptr
line 41 ~ 54 in ICFGBuilder::build()
in ICFGBuilder.cpp
svfModule
is nullptrvoid ICFGBuilder::build(SVFModule* svfModule)
{
for (SVFModule::const_iterator iter = svfModule->begin(), eiter = svfModule->end(); iter != eiter; ++iter)
{
const SVFFunction *fun = *iter;
if (SVFUtil::isExtCall(fun))
continue;
WorkList worklist;
processFunEntry(fun,worklist);
processFunBody(worklist);
processFunExit(fun);
}
connectGlobalToProgEntry(svfModule);
}
I have completed these four assignments, but I have encountered some difficulties.
I would be very grateful if the answer can be uploaded to a dedicated branch.
Thanks!
After I updated to the lasted version of SVF,the assignment that was written before does not work properly...
Teacher, I have a problem in getting SourceLoc info.
For detail, when I use the API SVF::SVFUtil::getSourceLoc
provided in Wiki, VSCode show here is no method named getSourceLoc
in namespace SVFUtil
.
Then I read the source code of SVF, and find LLVMUtil::getSourceLoc(const Value* val)
, but I don't know how to cast ICFGNode to LLVM Value, are there any APIs I could use?
Dear Sir,
I am currently working on assignment 04, and previous implementations on Assignment 01-03 works all fine. However, when I
try to run assignment 04, it fails, the report shows:
running test1:
[Pointer Analysis] Checking MAYALIAS
FAILURE :MAYALIAS check <id:15, id:15> at ({ ln: 16 cl: 5 fl: Assignment-4/testcase/src/test1.c })
assign-4: /home/SVF-tools/SVF/lib/MemoryModel/PointerAnalysis.cpp:629: virtual void SVF::PointerAnalysis::validateSuccessTests(std::string): Assertion `false && "test case failed!"' failed.
when I debug it with gdb, it seems like the problem is on ander->analyze().
The backtrace is as below:
I'm really confused since ander->analyze() works fine on assignment-3, any suggestions are really appreciated! Thanks!
Here is my e-mail address if discussing on github is not that desirable: [email protected] =)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.