davidhin / linevd

Statement-level deep learning model for automated software vulnerability detection in C/C++ (Accepted in MSR 2022)
MIT License
64 stars 24 forks source link

some problem about "gitdiff" in git.py #3

Closed GuoXinrong closed 2 years ago

GuoXinrong commented 2 years ago

Hi @davidhin , when I run the method bigvul() in /linevd/sastvd/helpers/datasets.py using the dataset "MSR_data_cleaned.csv",I met some problem ,I find that the output of the gitdiff() in /linevd/sastvd/helpers/git.py is (b'', b'/bin/sh: 1: singularity: not found\n') ,I guess it means that the patch is '',so the following method can not continue to extract the diff,added,removed infomation(usingmd_lines(patch: str)), or maybe the problem is caused because I didn't use the singularity tool? I am looking forward to your reply.

davidhin commented 2 years ago

Most of the scripts have only been run using singularity. In particular, that error is likely related to this function: https://github.com/davidhin/linevd/blob/main/sastvd/__init__.py#L102. Singularity was used for the purpose of ensuring that the code is able to be run on multiple devices consistently, instructions can be found at https://sylabs.io/guides/3.5/user-guide/quick_start.html

GuoXinrong commented 2 years ago

Hi,@davidhin I use singularity to build the man.sif,but I encounter this problem,I can't figure out how to solve it. E)A`%0Q}$55STRCU{7PY5LO

davidhin commented 2 years ago

Maybe try running singularity run -H /data/xinrongguo/linevd main.sif -p initialise instead.

You can also try and skip singularity, and try removing the lines: https://github.com/davidhin/linevd/blob/main/sastvd/__init__.py#L110-L112 and https://github.com/davidhin/linevd/blob/main/sastvd/__init__.py#L125-L127

If not, then I'm not too sure of the issue. As I'm quite busy this week, may not be able to take a thorough look until later

GuoXinrong commented 2 years ago

Thank you very much ,it works!