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

Add the RTLD_NODELETE flag to dlopen #1030

Merged
merged 7 commits into from
Dec 18, 2024
Merged

Conversation

multiphaseCFD
Copy link
Member

@multiphaseCFD multiphaseCFD commented Dec 18, 2024

Before submitting

Please complete the following checklist when submitting a PR:

  • All new features must include a unit test.
    If you've fixed a bug or added code that should be tested, add a test to the
    tests directory!

  • All new functions and code must be clearly commented and documented.
    If you do make documentation changes, make sure that the docs build and
    render correctly by running make docs.

  • Ensure that the test suite passes, by running make test.

  • Add a new entry to the .github/CHANGELOG.md file, summarizing the
    change, and including a link back to the PR.

  • Ensure that code is properly formatted by running make format.

When all the above are checked, delete everything above the dashed
line and fill in the pull request template.


Context:

There are segfault issue for finite-shot hermitians tests with Catalyst on arm64-macos. It looks like closing libscipy_openblas.dylib has a side effect that leads to the segfault and using RTLD_NODELETE mitigates that.

Description of the Change:

Benefits:

Possible Drawbacks:

Related GitHub Issues:
[sc-80901]

Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.04%. Comparing base (9f3cf06) to head (d458dbd).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1030   +/-   ##
=======================================
  Coverage   92.04%   92.04%           
=======================================
  Files         178      178           
  Lines       27450    27450           
=======================================
  Hits        25265    25265           
  Misses       2185     2185           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@multiphaseCFD multiphaseCFD marked this pull request as ready for review December 18, 2024 19:03
@dime10
Copy link
Contributor

dime10 commented Dec 18, 2024

There are segfault issue for shor algorithm tests with Catalyst on arm64-macos. It looks like closing libscipy_openblas.dylib has a side effect that leads to the segfault and using RTLD_NODELETE mitigates that.

I think the current issue only appears when running finite-shot hermitians, so not necessarily related to the original problem found with Shor.

@multiphaseCFD
Copy link
Member Author

There are segfault issue for shor algorithm tests with Catalyst on arm64-macos. It looks like closing libscipy_openblas.dylib has a side effect that leads to the segfault and using RTLD_NODELETE mitigates that.

I think the current issue only appears when running finite-shot hermitians, so not necessarily related to the original problem found with Shor.

Thanks @dime10 for the updates! Just updated the description.

Copy link
Contributor

@dime10 dime10 left a comment

Choose a reason for hiding this comment

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

Thanks! Not sure how you guys handle it but I often leave comments in the code for why a tweak like this was necessary to help future developers.

@multiphaseCFD
Copy link
Member Author

Thanks! Not sure how you guys handle it but I often leave comments in the code for why a tweak like this was necessary to help future developers.

Good point. Comments added. Thanks @dime10

@dime10 dime10 merged commit 11b03d4 into master Dec 18, 2024
89 checks passed
@dime10 dime10 deleted the fix_sharedlib_loader_dlclose branch December 18, 2024 22:11
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