The thread you linked to shared that the bug found in that thread is fixed in recent versions but the fix was not backported to the LTA.
Since this is the case, and since you can’t share any files for further investigation on our side, it looks like your best bet is to upgrade to the current version, which is 10.6 at this writing.
Can I check anything in the debug files to found the route of the issue? It contains lots of information from the build machine, the files, etc and throw the error full randomly
I think I cannot update the sonarqube server, because every team use same sonar server in my company … so that not too easy
We updated to the latest version of SonarQube (10.7)
Updated build wrapper and sonar scanner to the latest versions
I got same error
I downloadad the reproducer file, but it contains lots of sensitive data so I cannot send the full xz file …
Can I run sonar scanner any parameter which is doesnt log out the sensitive data (for example source code)?
Or Which file is needed? That is the most problematic file: sonar-cfamily.reproducer
Can you provide your analysis log, redacted as necessary?
The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.
Hi @Endre_Vass, and thanks for sharing the problem with us,
Unfortunately, without the reproducer tar.xz, I can only guess.
This exception basically means that the native part of the analyzer has crashed. There could be many reasons for that, and this is why looking at the reproducer is the most efficient way to identify the problem and suggest solutions.
That said, I had a quick look at the logs you shared, and one thing that stood out to me is the parsing errors the analyzer encounters while parsing system headers:
Parsing errors can occasionally cause the parser to go into an invalid state, increasing the likelihood of a crash. The errors above might have been caused by some includes before corecrt_malloc.h that add conflicting function declarations. However, without the reproducer, it is really hard for me to know how we ended up with these errors.
You can check if the problem is reproducible on a new project that uses the same MSVC toolset version, and try to include the same set of headers as your current project. If you find it is reproducible, then you can generate the reproducer on the new project and share that one to avoid sharing sensitive data from the original project.
I hope this helps, and let me know if you would like to open a private thread with you if you are willing to share any additional details in private,
Thanks for sharing, this means that my guess above about the parsing errors being related is incorrect.
Unfortunately, it is very hard for me to think about any additional guesses given only these logs. It would be very helpful if you can share the reproducer privately; I already started a thread.
Otherwise, I can only suggest trying to reproduce on the new “empty” project by changing the settings/code, …etc.
Yes, now I try to comment out includes in the original source, and now I found which file is the problematic. It’s contains two #define , now I try to check what is the problem
So if the code are outside of the class definition, the scanner crash, but I change the name of the constexpr ‘value’, it works but ofc, cannot compile the code…
That is a header file, so I cannot exclude from the check Can you help me?
Hi @Endre_Vass, and thanks for sharing the example,
I might be missing something, but the code you shared in the first snippet doesn’t compile as it has multiple declarations of func2. Analysis works fine though when I remove the duplicated definitions and add the necessary headers. See this Compiler Explorer link.
For me, this doesn’t necessarily imply that this is the root problem causing the crash; Changing something like that can influence the paths taken by the parser indeed, so that it doesn’t hit the crash, but this doesn’t mean that the problem lies in the way member functions are parsed out of the class.
To prove this, you can take the anonymized snippet you shared, paste it in a new empty MSVC project, and add the necessary headers/configuration to make it build. Does analysis crash on that new project? If so, you can share the reproducer with us, and this would enable us to track the issue further on our side.
I tried to reproduce it on a small project, but the small project works.
It have multiple pahse of the problem but fixed if I change the code and move the functions into the class … I try to share more information
Thanks @Endre_Vass for sharing the logs and the reproducer files,
This turned out to be CPP-5626. This was already fixed in CFamily version 6.60 (currently available on SonarCloud, and will be available on SonarQube 10.8 - expected around the beginning of December).
A workaround to unblock the analysis was also shared with the user…