-
Notifications
You must be signed in to change notification settings - Fork 472
Open
Description
When I tried to analyze a big project, the phrase of building pta is time-consuming. Therefore, I used the api solveAndwritePtsToFile to save the pta to a file, and load the file using readPtsFromFile to save time. But the error was occurred when using the solveAndwritePtsToFile.
There is my code to save pta:
int main(int argc, char** argv) {
if (argc < 2) {
llvm::errs() << "Usage: " << argv[0] << " <bitcode1.bc> [more.bc...]\n";
return 1;
}
std::vector<std::string> mods;
mods = OptionBase::parseOptions(
argc, argv, "Source-Sink Bug Detector", "[options] <input-bitcode...>"
);
if (Options::WriteAnder() == "ir_annotator")
{
LLVMModuleSet::preProcessBCs(mods);
}
SVFModule* svfModule = LLVMModuleSet::buildSVFModule(mods);
// 3) SVFIR
SVFIRBuilder irBuilder(svfModule);
SVFIR* svfir = irBuilder.build();
//PTACallGraph* callgraph = ander->getPTACallGraph();
/// ICFG
//ICFG* icfg = pag->getICFG();
/// Value-Flow Graph (VFG)
//VFG* vfg = new VFG(callgraph);
// 4) PTA(Andersen)
AndersenWaveDiff* ander = AndersenWaveDiff::createAndersenWaveDiff(svfir);
ander->solveAndwritePtsToFile("/home/hyb/Desktop/SVF-2.9/cache/ander.pts"); //error occur!!
I tried to import some different IR, but the error was the same like the following:
****Persistent Points-To Cache Statistics: Andersen's analysis bitvector****
################ (program : example.pre.bc)###############
###something###
#######################################################
Storing ObjVar to '/home/admin/Desktop/SVF-2.9/cache/ander.pts'...
Storing pointer analysis results to '/home/admin/Desktop/SVF-2.9/cache/ander.pts'...
saveptaandsvfg: /home/admin/Desktop/SVF-2.9/svf/include/Graphs/GenericGraph.h:409: SVF::GenericGraph<NodeTy, EdgeTy>::NodeType* SVF::GenericGraph<NodeTy, EdgeTy>::getGNode(SVF::NodeID) const [with NodeTy = SVF::SVFVar; EdgeTy = SVF::SVFStmt; SVF::GenericGraph<NodeTy, EdgeTy>::NodeType = SVF::SVFVar; SVF::NodeID = unsigned int]: Assertion `it != IDToNodeMap.end() && "Node not found!"' failed.
The stack trace is

I have tried to debug the error cause. It seems like the number of some type Node has n, and nodeid is compatible when the first call to SVFIR::getBaseObj in createAndersenWaveDiff. But the number of Node and nodeid is incompatible when the second call to SVFIR::getBaseObj in solveAndwritePtsToFile. nodeid is larger than the number of Node and couldn't find the node according to nodeid, asserting "Node not found!".
Could anyone give me some advice?
BTW, no error was occurred when using command wpa -ander -svfg -write-ander pta -write-svfg svfg example.bc to save pta and svfg.
Metadata
Metadata
Assignees
Labels
No labels