-
Notifications
You must be signed in to change notification settings - Fork 362
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
The scan takes long time when function has more than 3 std::vector<std::vector<?>> type parameters #1916
Comments
Thank you for quick replying. In one function signature, no more than 3 this kind of parameters will not cause the problem. Wish this information can help you to reproduce and investigate the problem easier. |
@gpangb thx. Unfortunately the problem is a hard nut to crack and we haven't yet found a solution to correctly handle it in the grammar of the parser. |
Can the plugin monitor the time used for analyzing every file when scanning, once the time exceeds a threshold, say 1 min or 30 secs, or a user defined value, stop the analyzing and print out a warning message? i.e. set a timeout for handling each file. It will be better to list all skipped files at the end of the scanning. The basic idea is:
BTW, according to the console output, it seems the scanning is serial, is that so? Is there a way to make it scan files in parallel? |
Is there any update for my suggestion? Is that make sence and doable? |
Hi @gpangb, not sure if a timeout is possible, because it seems to "hang" inside of the grammar check which is an external library. We also had the idea to parallelize parsing the files but up to know we found no one implementing it. Question is also if adding precompiled header handling would not bring more speed. At the end there is also the discussion to switch to clang as frontend, but again: bigger work and found none willing to do it... Regards, |
Description
When scanning .cpp files or .h files, if the source file contains functions which has more than 3
std::vector<std::vector<?>>
type parameters, the scan takes long time and without any output to console.For example, if the .h file has following lines:
then the scan will stop there without any output for about 1 minute. And if a .cpp file contains the function definition for above declaration, the scan will stop for about 20 minutes. But at the end, the scan will finish successfully. After testing, deleting any one parameter of type
std::vector<std::vector<?>>
from the argument list will make the scan pass without any stop.CVector4d
is a user defined class and is not defined in the scanned source file. If the type isstd::vector<std::vector<int>>
, the scan will finished quickly.Could you tell me what causes this, some rules or the scanner itself? If it caused by some rules, could you tell me which rules cause this. If it's a bug, could you tell me when it can be fixed, and what's the work around before it got fixed?
Thank you!
Steps to reproduce the problem
Steps:
Expected behavior
The scan will finished in seconds.
Actual behavior
The scan takes at least 1 minute.
Known workarounds
I don't know any workarounds.
LOG file
Note the time interval between line 2 and line 3.
Related information
The text was updated successfully, but these errors were encountered: