-
Notifications
You must be signed in to change notification settings - Fork 100
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 segfaults caused by modifying existing shared library #295
Conversation
When the built shared library is copied to the correct location, it actually *modifies* any existing shared library, which causes any running process using it to segfault. To fix this, we first delete any existing shared library (which is safe to do) and then copy the newly built shared library to the correct location as a new file. Related to PyO3#257
Co-authored-by: Adam Reichold <adamreichold@users.noreply.github.com>
Thank you for the review! ❤️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, logic looks good to me, could you just add a CHANGELOG entry please? Then let's merge 👍
I've added some words to the changelog, though I don't think I really expressed it well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's great as-is - thanks! 👍
@davidhewitt: any chance of a release to include this change? It caused a significant outage for us today :(. |
Sorry for the delay on release here. I'll try to put live tomorrow. |
See #331 |
## 1.6.0 (2023-04-27) ### Changed - Prefer passing `--crate-type` option to cargo if "toolchain >= 1.64". [#322](PyO3/setuptools-rust#322) ### Fixed - Fix a bug where rebuilding the library would cause any running processes using it to segfault. [#295](PyO3/setuptools-rust#295) - Fix `setup.cfg` format for compatibility with "poetry==1.4.0". [#319](PyO3/setuptools-rust#319)
Thank you! ❤️ |
When the built shared library is copied to the correct location, it actually modifies any existing shared library, which causes any running process using it to segfault.
To fix this, we first delete any existing shared library (which is safe to do) and then copy the newly built shared library to the correct location as a new file.
Related to #257
At least, this is the behaviour on Linux, I'm not sure about other OSes.