Commit ae7ae40
committed
436: rm the existing extension before cp the new one
It seems that directly copying the new .so over the old one is slightly
different to rm the old .so then copying the new one. This fixes a segfault
that was observed when an existing ext was already in the ext directory. This
didn't manifest before, because `make install` (the approach used by compiling
from source) uses basically:
$extSrcPath/build/shtool --debug install -c {$extSrcPath}modules/* $dest
This is a shell script, and ultimately it boils down to:
- cp (or mv) the .so to a temp file in the dest path
- rm the dest file
- mv the temp file to the dest file
It was observed that this approach did not cause the segfault, but previous to
this commit, PIE was only doing:
- cp the .so to the dest file
It seems there is some much lower-level differences in how these operations
affect the running processes, so this commit changes PIE to `rm` the target
file if it already exists first, which seems to solve the issue.1 parent 531433d commit ae7ae40
1 file changed
+25
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
51 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
52 | 63 | | |
| 64 | + | |
53 | 65 | | |
54 | 66 | | |
55 | 67 | | |
56 | 68 | | |
57 | 69 | | |
58 | 70 | | |
59 | | - | |
| 71 | + | |
60 | 72 | | |
61 | 73 | | |
62 | 74 | | |
| |||
71 | 83 | | |
72 | 84 | | |
73 | 85 | | |
74 | | - | |
| 86 | + | |
75 | 87 | | |
76 | 88 | | |
77 | | - | |
| 89 | + | |
78 | 90 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
84 | 97 | | |
85 | | - | |
| 98 | + | |
| 99 | + | |
86 | 100 | | |
87 | 101 | | |
88 | 102 | | |
| |||
0 commit comments