BugFinder unable to find any NTL?
조회 수: 1 (최근 30일)
이전 댓글 표시
I know that BugFinder analysis is not supposed to be as exhaustive as CodeProver, but somehow even the most simplistic form of non terminating loops are not marked in the results. Is this expected behavior?
In a file I analyzed using a few tools,
while(g_tj.rounds);
can be not terminating because g_tj is not marked volatile, so the compiler would be allowed to cache the access. This is of course marked as a red check in CodeProver, but even free ccpcheck marks it as suspicious.
As you can see in the image from the BugFinder result, the tooltip seems to be speculating about non termination, but the line is not marked (for that) in the result output, even though all BugFinder checks are enabled.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/502628/image.jpeg)
What am I missing?
댓글 수: 0
채택된 답변
Anirban
2021년 1월 29일
편집: Anirban
2021년 1월 29일
Hi Oliver,
Code Prover can find this and other much more sophisticated cases of non-terminating loops. Bug Finder uses the same engine underneath (with different underlying assumptions for faster analysis) and as you have noticed in the tooltip, Bug Finder can also detect this simple infinite loop. However, this capability is not available as a checker in Bug Finder.
In practice, infinite loops such as the ones you point will also manifest as an issue in the loop body (for instance, an Out of Bounds Array Index on some array access or an Overflow on some math operation), and Bug Finder will be able to detect those issues. Therefore, a checker on the loop statement itself is not always necessary.
In most cases, it is safe to assume that Bug Finder will find simpler cases while Code Prover, because of its exhaustive analysis, will find more sophisticated examples of an issue. For instance, both products have an Out of Bounds Array Index checker. The case of non-terminating loops seems to be an exception currently where Bug Finder does not have an explicit checker at all. This situation might change in future releases.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Run Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!