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 running joern get_func_graph #12

Open
billquan opened this issue Nov 14, 2024 · 4 comments
Open

Error when running joern get_func_graph #12

billquan opened this issue Nov 14, 2024 · 4 comments

Comments

@billquan
Copy link

Hi,

I'm trying to apply DeepDFA to new data. I'm trying to follow the data preprocessing steps you have for the BigVul dataset. But when I ran the DeepDFA/DDFA/sastvd/scripts/getgraphs.py and checked the logs from joern, it seemed joern failed to compile get_func_graph, showing the following errors:
image
What is the reason of this?

@billquan
Copy link
Author

Which version of Joern should be used? it seems that the version 1.1.107 specified in install_joern.sh is not correct.

@nss2024
Copy link

nss2024 commented Nov 18, 2024

using the joern 1.1.1072 and
you can refer to this blog
"https://agencies.tistory.com/249"
"https://agencies.tistory.com/250"
"https://agencies.tistory.com/252"

@Byw111
Copy link

Byw111 commented Dec 23, 2024

using the joern 1.1.1072 and you can refer to this blog "https://agencies.tistory.com/249" "https://agencies.tistory.com/250" "https://agencies.tistory.com/252"

Hello, I have reproduced according to the link you sent, but encountered an error when running maincli. Have you encountered this issue? If not, would it be convenient for you to send me your source code?
error:

Traceback (most recent call last):
  File "/home/vul/Downloads/DeepDFA (2)/DeepDFA/DDFA/code_gnn/main_cli.py", line 318, in <module>
    MyLightningCLI(FlowGNNGGNNModule, BigVulDatasetLineVDDataModule, parser_kwargs={
  File "/home/vul/miniconda3/envs/dfa/lib/python3.10/site-packages/pytorch_lightning/utilities/cli.py", line 157, in __init__
    super().__init__(*args, **kwargs)
  File "/home/vul/miniconda3/envs/dfa/lib/python3.10/site-packages/pytorch_lightning/cli.py", line 350, in __init__
    self._run_subcommand(self.subcommand)
  File "/home/vul/miniconda3/envs/dfa/lib/python3.10/site-packages/pytorch_lightning/cli.py", line 626, in _run_subcommand
    fn(**fn_kwargs)
  File "/home/vul/miniconda3/envs/dfa/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 696, in fit
    self._call_and_handle_interrupt(
  File "/home/vul/miniconda3/envs/dfa/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 650, in _call_and_handle_interrupt
    return trainer_fn(*args, **kwargs)
  File "/home/vul/miniconda3/envs/dfa/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 735, in _fit_impl
    results = self._run(model, ckpt_path=self.ckpt_path)
  File "/home/vul/miniconda3/envs/dfa/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 1166, in _run
    results = self._run_stage()
  File "/home/vul/miniconda3/envs/dfa/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 1252, in _run_stage
    return self._run_train()
  File "/home/vul/miniconda3/envs/dfa/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 1283, in _run_train
    self.fit_loop.run()
  File "/home/vul/miniconda3/envs/dfa/lib/python3.10/site-packages/pytorch_lightning/loops/loop.py", line 195, in run
    self.on_run_start(*args, **kwargs)
  File "/home/vul/miniconda3/envs/dfa/lib/python3.10/site-packages/pytorch_lightning/loops/fit_loop.py", line 211, in on_run_start
    self.trainer.reset_train_dataloader(self.trainer.lightning_module)
  File "/home/vul/miniconda3/envs/dfa/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 1812, in reset_train_dataloader
    self.train_dataloader = self._data_connector._request_dataloader(RunningStage.TRAINING)
  File "/home/vul/miniconda3/envs/dfa/lib/python3.10/site-packages/pytorch_lightning/trainer/connectors/data_connector.py", line 453, in _request_dataloader
    dataloader = source.dataloader()
  File "/home/vul/miniconda3/envs/dfa/lib/python3.10/site-packages/pytorch_lightning/trainer/connectors/data_connector.py", line 530, in dataloader
    return method()
  File "/home/vul/Downloads/DeepDFA (2)/DeepDFA/DDFA/sastvd/linevd/datamodule.py", line 124, in train_dataloader
    return GraphDa
```taLoader(
  File "/home/vul/miniconda3/envs/dfa/lib/python3.10/site-packages/pytorch_lightning/utilities/data.py", line 516, in wrapper
    init(obj, *args, **kwargs)
  File "/home/vul/miniconda3/envs/dfa/lib/python3.10/site-packages/dgl/dataloading/dataloader.py", line 1459, in __init__
    super().__init__(
  File "/home/vul/miniconda3/envs/dfa/lib/python3.10/site-packages/pytorch_lightning/utilities/data.py", line 516, in wrapper
    init(obj, *args, **kwargs)
  File "/home/vul/miniconda3/envs/dfa/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 347, in __init__
    sampler = RandomSampler(dataset, generator=generator)  # type: ignore[arg-type]
  File "/home/vul/miniconda3/envs/dfa/lib/python3.10/site-packages/torch/utils/data/sampler.py", line 107, in __init__
    raise ValueError("num_samples should be a positive integer "
ValueError: num_samples should be a positive integer value, but got num_samples=0

@nss2024
Copy link

nss2024 commented Dec 26, 2024

ValueError: num_samples should be a positive integer value, but got num_samples=0

this error might be dataset csv error
you need to using this dataset
link : https://figshare.com/articles/dataset/Dataflow_Analysis-Inspired_Deep_Learning_for_Efficient_Vulnerability_Detection/21225413

  • MSR (csv file)

"https://agencies.tistory.com/255"

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