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

tests: Fix ASAN build on macOS #425

Merged
merged 1 commit into from
Jul 29, 2024
Merged

Conversation

neverpanic
Copy link
Collaborator

@neverpanic neverpanic commented Jul 29, 2024

Description

On macOS, the variable for library preloading is DYLD_INSERT_LIBRARIES, not LD_PRELOAD. Adjust the CHECKER env variable to use that on macOS machines.

Change fake_dlclose to a library rather than a shared module. This doesn't make a difference on Linux, but on macOS, dyld(1) refuses to insert a shared module into a processes address space using DYLD_INSERT_LIBRARIES, but allows a library in the same place.

Checklist

  • Code modified for feature
  • Test suite updated with functionality tests
  • Test suite updated with negative tests
  • Documentation updated

Reviewer's checklist:

  • Any issues marked for closing are addressed
  • There is a test suite reasonably covering new functionality or modifications
  • This feature/change has adequate documentation added
  • Code conform to coding style that today cannot yet be enforced via the check style test
  • Commits have short titles and sensible commit messages
  • Coverity Scan has run if needed (code PR) and no new defects were found

On macOS, the variable for library preloading is DYLD_INSERT_LIBRARIES,
not LD_PRELOAD. Adjust the CHECKER env variable to use that on macOS
machines.

Change fake_dlclose to a library rather than a shared module. This
doesn't make a difference on Linux, but on macOS, dyld(1) refuses to
insert a shared module into a processes address space using
DYLD_INSERT_LIBRARIES, but allows a library in the same place.

Signed-off-by: Clemens Lang <[email protected]>
Copy link
Contributor

@Jakuje Jakuje left a comment

Choose a reason for hiding this comment

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

thank you! Looks good!

@simo5 simo5 added the covscan-ok Coverity scan passed label Jul 29, 2024
@simo5 simo5 merged commit 20de6d6 into latchset:main Jul 29, 2024
36 checks passed
@simo5
Copy link
Member

simo5 commented Jul 29, 2024

Thanks Clemens!

@neverpanic neverpanic deleted the macos-asan branch August 2, 2024 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
covscan-ok Coverity scan passed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants