Page MenuHomePhabricator

distutils_rust: use atomic replace to install the .so file
AbandonedPublic

Authored by quark on Dec 18 2017, 2:17 PM.

Details

Reviewers
mbthomas
Group Reviewers
Restricted Project
Summary

Python loads .so using mmap. Rewriting a .so in-place when there is a Python
process with that .so mmap-ed could crash that Python process. Therefore
let's avoid rewriting the destination .so in-place.

This was discovered by a txnclose Python hook I used to keep binaries
up-to-date. It caused segfault after building the Rust extensions currently
loaded by the Python process running the hook.

Diff Detail

Repository
rFBHGX Facebook Mercurial Extensions
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

quark created this revision.Dec 18 2017, 2:17 PM
Herald added a reviewer: Restricted Project. ยท View Herald TranscriptDec 18 2017, 2:17 PM
mbthomas accepted this revision.Jan 8 2018, 2:35 PM
This revision is now accepted and ready to land.Jan 8 2018, 2:35 PM
quark abandoned this revision.Feb 16 2020, 8:35 PM