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

error when using traverseOnVFG to collect all LLVM Values #30

Open
yikuoyansui opened this issue Nov 16, 2020 · 12 comments
Open

error when using traverseOnVFG to collect all LLVM Values #30

yikuoyansui opened this issue Nov 16, 2020 · 12 comments

Comments

@yikuoyansui
Copy link

Hi,

I tried to use traverseOnVFG to collect all LLVM values with regard to one specific VFG node.
I kept getting this error "svf-ex: /home/travis/build/SVF-tools/SVF/lib/Graphs/VFG.cpp:868: const SVF::PAGNode* SVF::VFG::getLHSTopLevPtr(const SVF::VFGNode*) const: Assertion `false && "unexpected node kind!"' failed.", I am wondering whether you could provide any hint on it.

Thanks

@yuleisui
Copy link
Collaborator

You need to provide more information about the SVFGNode and its PAGNode information so that I could understand which SVFGNode you are referring to.

@yikuoyansui
Copy link
Author

Thanks for your quick reply. The program is too large. It is hard to give you specific information about the SVFGNode and its PAGNode without context. The following three statements show how I fetch the llvm value and feed it into traverseOnVFG.

PAGNode* pagNode = pag->getPAGNode(5394);
const Value* v = pagNode->getValue();
traverseOnVFG(svfg, v);

I use the node ID (5394) which can be obtained from pag.dot to get the corresponding PAGNode. The following snippet is information about this node.

Node0x55dd51a85c00 [shape=record,shape=circle,label="{[base64_decode] 5394:}"];
Node0x55dd51a85c00 -> Node0x55dd51a7f6c0[color=blue];

I use several types of nodes as the input and all of them show the same error.

If the above description is hard to follow, could you give me some high-level hints about how to properly use traverseOnVFG?

Thanks

@yuleisui
Copy link
Collaborator

yuleisui commented Nov 16, 2020

The addresses would not tell the problem. Can you send me your bc?

@yikuoyansui
Copy link
Author

Btw, I am wondering why we need to use getLHSTopLevPtr considering we have already traversed VFG and get the visited list before.

@yuleisui
Copy link
Collaborator

You can also use node->toString() to get the results for your purpose. No need to use getLHSTopLevPtr.

@yikuoyansui
Copy link
Author

I am confused that what the purpose of getLHSTopLevPtr is. Is it to get the corresponding PAGNode for VFGNode and PAGNode are the exact LLVM values (pointers), right?

@yuleisui
Copy link
Collaborator

In brief, yes. See the fixed patch for SVF here: SVF-tools/SVF@75e3b7c

and the fix for SVF-example here:
1b5edfb

@yikuoyansui
Copy link
Author

Thanks for your updates. I updated all the patches and fix, while the same error still happens. Has the error been fixed at your side? I am using the same node 5394 and the same bc.

svf-ex: /home/travis/build/SVF-tools/SVF/lib/Graphs/VFG.cpp:874: const SVF::PAGNode* SVF::VFG::getLHSTopLevPtr(const SVF::VFGNode*) const: Assertion `false && "unexpected node kind!"' failed.

Thanks

@yuleisui
Copy link
Collaborator

You will need to update svf-lib npm i --silent svf-lib --prefix ${HOME}

@yikuoyansui
Copy link
Author

Sorry to disturb you again. I did execute the above command. I checked the modification time of libSvf.a under Release-build folder and the time is no up-to-date. I am not sure whether the problem is caused by that. Thanks.

@yuleisui
Copy link
Collaborator

@JasonZhongZexin could you take a look at the npm configuration?

@JasonZhongZexin
Copy link
Contributor

@yikuoyansui I have confirmed the new update has been published to NPM. The up-to-date version of svf-lib should be v1.0.243. Could you please provide the below information, so that I could investigate the issue.

  1. What‘s the version of your OS?
  2. What’s the version of the npm and nodejs that you are using?
  3. What’s the version of the installed svf-lib?
  4. What’s the output that display on your terminal after running the svf-lib update command?

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

3 participants