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

Fix a segfault on macOS when _dyld_shared_cache_contains_path is not available #615

Merged
merged 1 commit into from
May 30, 2024

Commits on May 30, 2024

  1. Fix a segfault when _dyld_shared_cache_contains_path is not available

    The _dyld_shared_cache_contains_path is only available in macOS 11.0 or
    later. As we are compiling in a new system that's newer than 11.0 but
    setting the deployment target to an older version, it's possible that
    the _dyld_shared_cache_contains_path is not available in the target
    platform and in that case we will segfault when calling it. It's also
    possible that when compiling memray in an old system
    _dyld_shared_cache_contains_path is not even prototyped in the headers.
    
    To handle this, we change to fetch the function via a dlopen/dlsym
    approach that will be generic in all macOS versions at the cost of an
    extra call to dlopen the first time we interpose symbols.
    
    Signed-off-by: Pablo Galindo <[email protected]>
    pablogsal committed May 30, 2024
    Configuration menu
    Copy the full SHA
    9225e1a View commit details
    Browse the repository at this point in the history