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

By pass address sanitizer for BadEuler1DSolver member function #261

Merged
merged 3 commits into from
Dec 5, 2023

Conversation

j8xixo12
Copy link
Collaborator

@j8xixo12 j8xixo12 commented Dec 3, 2023

@tigercosmos, we can continue the discussion of #257 here.

I have added ElementBase::neg() and ElementBase::xpos() to address sanitize whitelist.

After bypass address sanity check, modmesh still got tons of memory detection.

Here is the final result snippet : SUMMARY: AddressSanitizer: 166560 byte(s) leaked in 2070 allocation(s).

I also attached the sanitizer log : asan_log.txt

reference : Google sanitizer - How to turn off instrumentation

#if defined(USE_SANITIZER) && (defined(__clang__) || defined(__GNUC__))
#define ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
#else
#define ATTRIBUTE_NO_SANITIZE_ADDRESS
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can leave a TODO here for Windows.

Copy link
Collaborator Author

@j8xixo12 j8xixo12 Dec 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the advice!
I have left a TODO comment in 0132dce

@tigercosmos
Copy link
Collaborator

I also noticed that there are tons of issues from asan...
I think we need to have a list first, and start to address them one by one.

@j8xixo12
Copy link
Collaborator Author

j8xixo12 commented Dec 4, 2023

I also noticed that there are tons of issues from asan... I think we need to have a list first, and start to address them one by one.

Agree. I'll help to organize these asan issues.

If this PR is ready to merge, I think we can open an issue to track these asan issue, then this PR can be close.

@tigercosmos, @yungyuc what do you think ?

@j8xixo12 j8xixo12 force-pushed the sanitizer_enhancement branch from a9ab6f7 to 0132dce Compare December 4, 2023 14:58
@tigercosmos
Copy link
Collaborator

thanks. LGTM

@@ -40,4 +40,11 @@
#include <modmesh/mesh/mesh.hpp>
#include <modmesh/toggle/toggle.hpp>

// TODO Add MSVC case once sanitizer can be default turned on for CI testing
#if defined(USE_SANITIZER) && (defined(__clang__) || defined(__GNUC__))
#define ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about we name this kind of macros as ASAN_...?

Copy link
Collaborator Author

@j8xixo12 j8xixo12 Dec 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the recommendations, I have changed the marco in 58ed2df

@yungyuc yungyuc added the test testing and continuous integration label Dec 4, 2023
@yungyuc
Copy link
Member

yungyuc commented Dec 5, 2023

LGTM. Merging.

@yungyuc yungyuc merged commit 42edba1 into solvcon:master Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test testing and continuous integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants