pyximport: fix a bug crashing other processes #188

Merged
merged 1 commit into from Mar 4, 2013

Projects

None yet

2 participants

@pv
Contributor
pv commented Feb 24, 2013

pyxbuild overwrites .so file contents, corrupting any mmapped code image
loaded. If pyximporting the same module from two different processes, on
Linux this leads to crashes with bus error.

This commit fixes the issue by unlinking the file first. On Linux et
al., this does not change the file contents of any open FDs. On
Windows, unlinking fails, and we just switch to using a different file
name.

@pv pv pyximport: fix a bug crashing other processes
pyxbuild overwrites .so file contents, corrupting any mmapped code image
loaded. If pyximporting the same module from two different processes, on
Linux this leads to crashes with bus error.

This commit fixes the issue by unlinking the file first. On Linux et
al., this does not change the file contents of any open FDs.  On
Windows, unlinking fails, and we just switch to using a different file
name.
e2f2580
@scoder
Contributor
scoder commented Mar 4, 2013

Makes sense to me. Thanks!

@scoder scoder merged commit e682668 into cython:master Mar 4, 2013

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment