Skip to content

Add AddressSanitizer and valgrind support#61

Merged
white238 merged 2 commits intomasterfrom
feature/white238/memcheck
May 18, 2020
Merged

Add AddressSanitizer and valgrind support#61
white238 merged 2 commits intomasterfrom
feature/white238/memcheck

Conversation

@white238
Copy link
Copy Markdown
Member

@white238 white238 commented May 15, 2020

First shot at enabling memory checking. I added two options: AddressSanitizer (seems to be the new hotness) and valgrind (tried and true, but cumbersome and slow).

I added documentation here:

https://serac.readthedocs.io/en/feature-white238-memcheck/memory_checking.html

The next step is to make it easier to use. Could be in another PR though.

Improvement ideas:

  1. Outputting a script that has the options already defined in it
  2. Script to consolidate the memory check reports after they run, there might be some plugins to gitlab or azure to help with this
  3. Automate with CI for every PR so we don't slide.

Thoughts?

@white238
Copy link
Copy Markdown
Member Author

LGTM

@jamiebramwell
Copy link
Copy Markdown
Member

This looks great! I definitely would like to see ease-of-use scripts (#1) and integration with CI (#3) in a future PR. I think it's important to get it started now before we slide.

I also think keeping around memcheck and AddressSanitizer is a good idea for now until we can kick the tires a bit to see which is better. I know memcheck can be painfully slow on big problems, so I'm tempted to go with Asan.

Copy link
Copy Markdown
Member

@jamiebramwell jamiebramwell left a comment

Choose a reason for hiding this comment

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

Thanks for looking at this!

.. ##
.. ## SPDX-License-Identifier: (BSD-3-Clause)

===============
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍


// mesh
const char *mesh_file = "../../data/beam-hex.mesh";
std::string base_mesh_file = std::string(SERAC_SRC_DIR) + "/data/beam-hex.mesh";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I assume SERAC_SRC_DIR is in the config header. Should we change the tests do it this way instead?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Would you like me to remove the command line path? I could push that to this PR if you want. It is one less thing to remember / copy&paste.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wouldn't worry about it now. I can add it to my next PR.

@white238
Copy link
Copy Markdown
Member Author

This looks great! I definitely would like to see ease-of-use scripts (#1) and integration with CI (#3) in a future PR. I think it's important to get it started now before we slide.

I also think keeping around memcheck and AddressSanitizer is a good idea for now until we can kick the tires a bit to see which is better. I know memcheck can be painfully slow on big problems, so I'm tempted to go with Asan.

Also Asan is kinda the new hotness, there is usually value in going with what the community is converging on even if its a bit behind.

Copy link
Copy Markdown
Contributor

@samuelpmish samuelpmish left a comment

Choose a reason for hiding this comment

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

Looks great, can't wait to give it a shot!

@white238 white238 merged commit 553f454 into master May 18, 2020
@white238 white238 deleted the feature/white238/memcheck branch May 18, 2020 20:10
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