[Bug] StackOverflowError while generating the CPG of an open source c++ repo
Describe the bug I receive java.lang.StackOverflowError while running joern on the open source c++ repository.
To Reproduce You can totally reproduce the problem yourself as I used a google colab notebook(selecting "high ram" instance) with the following simple script:
repo_url = "https://github.com/openxla/xla/"
!git clone {repo_url}
!wget https://github.com/joernio/joern/releases/latest/download/joern-install.sh
!chmod +x ./joern-install.sh
!sudo ./joern-install.sh
!apt-get install openjdk-19-jdk-headless
!/opt/joern/joern-cli/c2cpg.sh -J-Xmx44G /content/xla --with-include-auto-discovery --log-problems
Expected behavior Varying the last line of the script I shared, with and without the following flags didn't change the fact that I receive StackOverflowError: (--with-include-auto-discovery --log-problems --output /content/workspace/xla/cpg.bin.zip) I see no generated log file to be able to check whether the error is on the exact same place or not on each run. After lowering the ram flag to 30Gb(on 51Gb ram instance), StackOverflowError still persisted.
Desktop (please complete the following information):
- OS: Ubuntu 22.04.3 LTS
- Joern Version: 2.0.245
- Java version openjdk-19-jdk-headless
- 51Gb ram, stuck at 47Gb utilization(for 44G flag option).
Additional context CPG Java StackOverflowError.txt
Please run it again without the --with-include-auto-discovery flag.
I have seen such issues w.r.t. type resolution in the past already. Many of them are due to failed macro / include resolution.