-
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
Cannot find a project file to assign the valgrind error when using meson #1714
Comments
Hi @bartlibert, I don't use the sensor so I can only guess:
In your sample it seams that files are from a library or in test code? Regards, |
Hi @guwirth, I already had a look at the code and I assumed that the "getLastOwnFrame" call would try to find a file within the source folder(s), hence it should find test_pdfForm.cpp and try to assign to that. Am I interpreting this wrong and is "getLastOwnFrame" badly named? |
Hi @bartlibert, is
Regards, |
It is inside the unit folder (so the tests), which is also in the "sonar.sources" config variable, so I don't know if it should be handled differently? |
tl;dr: Valgrind output MUST contain absolute paths for <dir> entries and they MUST start with whatever you put as projectBaseDir. @guwirth Been debugging this for a few days... had basically the same issue as @bartlibert and I think I finally found the issue. Inside getLastOwnFrame we loop over every frame in the valgrind stack trying to find one that's "owned" by our project (Bart was right about that part): sonar-cxx/cxx-sensors/src/main/java/org/sonar/cxx/sensors/valgrind/ValgrindStack.java Lines 91 to 98 in 4f9280b
You might get this far and think the issue of "ownership" has to do with whether or not the file is indexed or being excluded for some reason but you'd be wrong in chasing that lead. Instead it's this nasty snippet: sonar-cxx/cxx-sensors/src/main/java/org/sonar/cxx/sensors/valgrind/ValgrindStack.java Lines 38 to 40 in 4f9280b
|
Hi @shua27, thanks for your feedback. First of all I like to ask you to read:
Does this make sense for Valgrind?
If you create the reports on another computer, you need to adjust the paths in the report files to match the paths on the computer running the scanner. Or is the problem the “has no support for relative paths in valgrind output“? Do you have a sample report file / snippet showing the issue? Or even better: a patch for the issue? I’m not familiar with Valgrind and don’t have the possibility to make own tests… but we are for sure interested to improve the sensor. Regards, |
To be fixed: … sensor (woefully) has no support for relative paths in valgrind output. |
I also have same issue and fixed by recompiling program with option -g. Here is example: gcc -g -o use_after_free use_after_free.c. Include the -g flag for debugging symbols, which helps tools like Valgrind provide more useful output. |
Description
I have a moderately complex meson setup that is reused by several projects and I find the valgrind (memcheck) results are not fed into sonarqube, giving the error
"Cannot find a project file to assign the valgrind error".
I cannot share everything because some proprietary code is involved, but I'll try to sketch the situation as well as possible.
Repository layout
Sonar properties file
Valgrind
Sample valgrind error frame output
** Sonar log snippet **
The text was updated successfully, but these errors were encountered: