Return saved values only if installed sigaction is our wrapper.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
LGTM with a nit
| compiler-rt/lib/tsan/rtl/tsan_interceptors.cc | ||
|---|---|---|
| 2309 ↗ | (On Diff #122569) | I think we should at least zero old. Otherwise there is no way to distinguish when it's filled and when it's uninit garbage. | 
| compiler-rt/lib/tsan/rtl/tsan_interceptors.cc | ||
|---|---|---|
| 2309 ↗ | (On Diff #122569) | if (res != 0) it's OK to expect garbage there | 
| compiler-rt/lib/tsan/rtl/tsan_interceptors.cc | ||
|---|---|---|
| 2309 ↗ | (On Diff #122569) | 
 This is not the case when cb != rtl_sigaction. We return 0 and leave garbage in old. Does libc ever return res=0 and garbage in old? If not, we should not too. | 
| compiler-rt/lib/tsan/rtl/tsan_interceptors.cc | ||
|---|---|---|
| 2309 ↗ | (On Diff #122569) | if (res == 0 && cb != rtl_sigaction && cb != rtl_sighandler) "old" contains something that was set by REAL(sigaction)(sig, &newact, old) call above, which is not garbage. | 
| compiler-rt/lib/tsan/rtl/tsan_interceptors.cc | ||
|---|---|---|
| 2309 ↗ | (On Diff #122569) | That's what I missed! We now pass old to sigaction. |