Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[MXNET-953] - Add ASAN sanitizer, Enable in CI #12370

Merged
merged 4 commits into from
Sep 19, 2018

Conversation

KellenSunderland
Copy link
Contributor

@KellenSunderland KellenSunderland commented Aug 27, 2018

Description

Add ASAN support so that users can create ASAN builds of MXNet. These builds should help users more easily address memory leaks and buffer overflows.

Enable ASAN builds in CI to display memory usage errors.

More detailed information here: https://cwiki.apache.org/confluence/display/MXNET/Detecting+Memory+Leaks+and+Buffer+Overflows+in+MXNet

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

@KellenSunderland
Copy link
Contributor Author

KellenSunderland commented Aug 27, 2018

Iterating on some tests locally.

Note: ASAN likely requires privileged docker containers.

@KellenSunderland KellenSunderland changed the title WIP: Add clang Sanitizers to CI WIP: Add google aanitizers to CI Sep 10, 2018
@KellenSunderland KellenSunderland changed the title WIP: Add google aanitizers to CI WIP: Add google sanitizers to CI Sep 10, 2018
@KellenSunderland KellenSunderland changed the title WIP: Add google sanitizers to CI WIP: Add ASAN sanitizer to CI Sep 11, 2018
@KellenSunderland
Copy link
Contributor Author

@KellenSunderland KellenSunderland changed the title WIP: Add ASAN sanitizer to CI [MXNET-953] - Add ASAN sanitizer, Enable in CI Sep 14, 2018
@KellenSunderland
Copy link
Contributor Author

@mxnet-label-bot can you please add [pr-awaiting-review]

@marcoabreu marcoabreu added the pr-awaiting-review PR is waiting for code review label Sep 14, 2018
# under the License.

sudo add-apt-repository ppa:jonathonf/gcc-8.0
sudo add-apt-repository ppa:jonathonf/gcc-7.3
Copy link
Contributor

Choose a reason for hiding this comment

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

Why 7.3 is also needed?

Copy link
Contributor Author

@KellenSunderland KellenSunderland Sep 18, 2018

Choose a reason for hiding this comment

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

Good spot. It's an error by the backport author. There's a dependency that is actually only available if you have both added.


pushd .
cd /work/build
export CC="gcc-8"
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add cmake arguments -DCMAKE_CXX_COMPILER=/usr/bin/g++-8 -DCMAKE_CC_COMPILER=/usr/bin/gcc-8 instead? It would be more cmake'ish.

@KellenSunderland
Copy link
Contributor Author

KellenSunderland commented Sep 18, 2018 via email

@marcoabreu marcoabreu added pr-awaiting-response PR is reviewed and waiting for contributor to respond and removed pr-awaiting-review PR is waiting for code review labels Sep 18, 2018
Use CMake to specify the compiler used for ASAN.  This is more portable
and doesn't rely on env vars.
@marcoabreu marcoabreu merged commit db295ef into apache:master Sep 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-awaiting-response PR is reviewed and waiting for contributor to respond
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants