epicosy / devign

Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networks
MIT License
199 stars 70 forks source link

Only ASTs for graph embedding? #4

Open kbarbora opened 4 years ago

kbarbora commented 4 years ago

Im trying to recreate devign and I came across your repo. Thank you so much. I see that on the project (under development) you mention that you only using the ASTs instead as the paper implements the joint graph (in paper 3.1, Graph Generation section). Do you achieve the graph generation according to the paper or you ignore all the relations introduce by the paper and use only ASTs?

epicosy commented 4 years ago

Thank you for your interest Kevin. I didn't finish implementing all the relations, I had to move on with other parts of my thesis. You can try to do it by processing the rest of Joern's CPG into some objects that represent the graphs, and then extend the GraphEmbeddings with it. Follow Pytorch Geometric's documentation on Data Handling of Graphs, to figure out how to represent the adjacency matrix for all the graphs. Was it helpful?

kbarbora commented 4 years ago

yes, thank you for your feedback.

QiuJYWX commented 4 years ago

Hi @kbarbora @epicosy

When I ran python main.py -c, I came across the issue: Traceback (most recent call last): File "main.py", line 157, in main() File "main.py", line 146, in main create_task() File "main.py", line 61, in create_task graphs = prepare.json_process(PATHS.cpg, json_file) File "/home/qjy/Desktop/devign/src/prepare/cpg_generator.py", line 79, in json_process container = [graph_indexing(graph) for graph in cpg_json["functions"] if graph["file"] != "N/A"] File "/home/qjy/Desktop/devign/src/prepare/cpg_generator.py", line 79, in container = [graph_indexing(graph) for graph in cpg_json["functions"] if graph["file"] != "N/A"] KeyError: 'file'

Anyone one can provide me some advice?

1112z-c commented 2 years ago

@QiuJYWX I have met the same problem, has it been solved?Thanks