-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
C++ extractor fails to process code based on Unreal Engine #13994
Comments
Thanks for reporting! I'll pass it on to the team. I think this issue will be solved by improvements to the frontend the team is working on. However, I don't know when those changes will be released. |
Thanks Arthur! I'd appreciate it if you could post a short update here if/when the team confirms it's a bug in the extractor, and when it can be possibly fixed. Thank you! |
@artem-smotrakov We've confirmed that this is a bug and are testing a fix internally. If all goes well, the fix will be included in CodeQL CLI v2.14.4. Note that while I was able to reproduce the bug with Unreal Engine 4.27.2 following your instructions, the corresponding sample project in Unreal Engine 5.2.1 was fine. I'm not familiar with UE, but it might be worth trying UE 5.2.1 as a workaround to use in the meantime. |
Hi @sashabu ! Thank you for the update!
Sounds awesome! 🤞
Thanks for the info -- I have not tested it with UE5. In my case, it's only UE4 unfortunately. I wish it were UE5 though :) |
Hi @sashabu Please let me know if I can help with testing the fix or anything else. Thanks! |
Hi @artem-smotrakov Thanks for the ping. The fix is now expected the next release, CodeQL CLI v2.15.2, later this month. |
Sounds great, thank you for the update! |
Hi @sashabu v2.15.2 seems to have the fix, doesn't it? At least I now see function calls and if-blocks in the database built with v2.15.2. I have not yet done better testing though. I still see about 300 errors in |
Hi @artem-smotrakov That's correct.
Could you confirm whether you're seeing the "catastrophic error" message specifically, or only the "Warning[extractor-c++]"? |
Hi @sashabu Thank you for the confirmation! I still see "catastrophic error" in the logs
I gave it about 16G via |
Hi @artem-smotrakov , The Are all the catastrophic errors now out of memory ones, or do you see others too? |
Hi @jketema
Is there any way how I can give the extractor more memory to get rid of the
Mainly |
Not really, as it's a 64-bit C++ program running out of heap space. There might be a memory leak somewhere of course, but we've not observed such errors on other code bases recently. So, we'll need to investigate.
Thanks for logs, as far as I can tell all the errors are in fact out-of-memory errors. |
Hey team,
I am trying to build a CodeQL database for a sample Unreal project. Building the code base on Unreal Engine includes two main steps:
UnrealHeaderTool
that parses the C++ headers for Unreal-related class metadata and generates custom C++ code.Unreal Engine also has
UnrealBuildTool
that runs the above steps.I use the following command to build the CodeQL database:
where
run_build_tool.bat
contains this:The
codeql database create ...
command finishes successfully. Thecodeql database print-baseline codeql-db
shows about 3K lines of C++ code. The following query returns a list of files included into the database:However, the database doesn't not include any function call, if-blocks, etc although the code have them. For example, the following query doesn't return anything:
I see multiple errors in
build-tracer.log
like this:Does it look like a bug in the C++ extractor, or am I doing anything wrong?
Steps to reproduce:
codeql-db/log/build-tracer.log
My testing environment:
The text was updated successfully, but these errors were encountered: