Commit 926cbdd
authored
[sanitizer_common] child_stdin_fd_ should only be set on posix_spawn path (llvm#171508)
llvm#170809 added the child_stdin_fd_ field on SymbolizerProcess to allow
the parent process to hold on to the read in of the child's stdin pipe.
This was to avoid SIGPIPE.
However, the `StartSubprocess` path still closes the stdin fd in the
parent here:
https://github.com/llvm/llvm-project/blob/7f5ed91684c808444ede24eb01ad9af73b5806e5/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp#L525-L535
This could cause a double-close of this fd (problematic in the case of
fd reuse).
This moves the `child_stdin_fd_` field to only be initialized on the
posix_spawn path. This should ensure llvm#170809 only truly affects Darwin.1 parent 8f3c8da commit 926cbdd
File tree
1 file changed
+4
-3
lines changed- compiler-rt/lib/sanitizer_common
1 file changed
+4
-3
lines changedLines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
179 | 183 | | |
180 | 184 | | |
181 | 185 | | |
| |||
192 | 196 | | |
193 | 197 | | |
194 | 198 | | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | 199 | | |
199 | 200 | | |
200 | 201 | | |
| |||
0 commit comments