Skip to content

Improve support for sanitizers with AppleClang#144

Merged
olupton merged 5 commits into
masterfrom
olupton/macos-sanitizers
Sep 15, 2022
Merged

Improve support for sanitizers with AppleClang#144
olupton merged 5 commits into
masterfrom
olupton/macos-sanitizers

Conversation

@olupton

@olupton olupton commented Sep 14, 2022

Copy link
Copy Markdown
Contributor
  • The runtime library name is slightly different with AppleClang than with Clang.
  • We need to set DYLD_INSERT_LIBRARIES instead of LD_PRELOAD on macOS.
  • We need to launch tests using the actual Python executable, not a shim, otherwise the preloading will be ignored.

Comment on lines +225 to +228
# Helper function strips away Python shims on macOS, so we can launch tests using the actual Python
# binary. Without this, preloading the sanitizer runtimes does not work on macOS. See
# https://jonasdevlieghere.com/sanitizing-python-modules/ and
# https://tobywf.com/2021/02/python-ext-asan/ for more information.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

interesting!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@pramodk thinking of SKIP_EMBEDDED_PYTHON_TEST? :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

while working on wheels with the apple security settings etc, I am glad that I/we didn't come across this!

@nrnhines nrnhines left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Glad this is becoming available. I've been limited to using nrniv with the address sanitizer on my Apple M1.

@olupton olupton merged commit b668787 into master Sep 15, 2022
@olupton olupton deleted the olupton/macos-sanitizers branch September 15, 2022 14:12
olupton added a commit that referenced this pull request Feb 23, 2023
olupton added a commit that referenced this pull request Feb 24, 2023
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.

4 participants