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

Running maturin develop can trigger SIGSEV in running process #758

Closed
1 of 2 tasks
cswinter opened this issue Dec 28, 2021 · 4 comments · Fixed by #760
Closed
1 of 2 tasks

Running maturin develop can trigger SIGSEV in running process #758

cswinter opened this issue Dec 28, 2021 · 4 comments · Fixed by #760
Labels
bug Something isn't working

Comments

@cswinter
Copy link

Bug Description

I ran maturin develop while a PyO3/maturin package was being used by another Python process, and the Python process died with
terminated by signal SIGSEGV (Address boundary error).

Your Python version (python -V)

Python 3.8.10

Your pip version (pip -V)

pip 21.3.1

What bindings you're using

pyo3

Does cargo build work?

  • Yes, it works

If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)?

  • Yes

Steps to Reproduce

  1. Install a Rust/Python package with maturin develop
  2. Start a Python process that imports and calls into the Rust library
  3. Run maturin develop again while Python process is still running
  4. Segfault
@cswinter cswinter added the bug Something isn't working label Dec 28, 2021
@cswinter
Copy link
Author

This could still be a coincidence, but the timing was very suspicious and the program was running fine before many times and doesn't use any unsafe code.

@davidhewitt
Copy link
Member

This sounds completely expected, although it may be worth pointing out in the docs.

As far as I'm aware, in Linux it's completely expected that if you replace a shared library while a process has loaded part of it into memory, then when the process needs to load more of the shared library you're almost certain to get crashes like this.

@davidhewitt
Copy link
Member

Oh, actually it might be possible for us to change something? https://stackoverflow.com/questions/3855004/overwriting-library-file-causes-segmentation-fault

@messense
Copy link
Member

@cswinter Can you try to remove the existing so file first here:

let target = rust_module.join(&so_filename);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants