Skip to content
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

enable ASan for C++ #255

Merged
merged 3 commits into from
Sep 8, 2022
Merged

Conversation

christian-rauch
Copy link
Collaborator

When looking into #253 I noticed that the AddressSanitizer is not enabled for C++ code. This is only relevant for the opencv_demo.

This PR uses the same ASAN flags for C and C++ code and for Debug as well as Release builds. While at it, I fixed some of the whitespace issues and added an additional configuration flag -c to select the camera to use.

Regarding the actual memory leaks, there are some leaks in libfontconfig.so. But overall, this seems to be constant. No matter how long I let the opencv_demo run without showing an actual tag, ASan will report SUMMARY: AddressSanitizer: 43736 byte(s) leaked in 812 allocation(s)..

However, ASan reported some division by zero errors which may be related to #213:

apriltag_math.h:73:37: runtime error: division by zero
apriltag_math.h:76:23: runtime error: division by zero
apriltag_math.h:79:14: runtime error: division by zero
apriltag.c:847:24: runtime error: division by zero
apriltag.c:847:37: runtime error: division by zero
apriltag.c:848:26: runtime error: division by zero
apriltag.c:849:26: runtime error: division by zero
apriltag.c:850:26: runtime error: division by zero
apriltag_math.h:41:17: runtime error: division by zero
apriltag_math.h:44:17: runtime error: division by zero
apriltag_math.h:64:14: runtime error: division by zero
apriltag_math.h:50:31: runtime error: division by zero
apriltag_math.h:67:23: runtime error: division by zero
apriltag_math.h:70:14: runtime error: division by zero
apriltag_quad_thresh.c:912:26: runtime error: division by zero
apriltag_quad_thresh.c:912:44: runtime error: division by zero

@christian-rauch christian-rauch merged commit e5e2341 into AprilRobotics:master Sep 8, 2022
@christian-rauch christian-rauch deleted the asan_cxx branch September 8, 2022 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants