Details
- Reviewers
vitalybuka - Commits
- rG3675e147a1cc: [Sanitizers] intercept ttyent api on FreeBSD.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc | ||
|---|---|---|
| 7558 | More consistent solution is to introduce Actually this part disables setttyentpath on anything but FreeBSD. Is this intentional? | |
| compiler-rt/test/sanitizer_common/TestCases/FreeBSD/ttyent.cpp | ||
| 24–31 ↗ | (On Diff #373272) | can you please extract freebsd specific part into a separate file and move common stuff into Posix or Linux? |
| compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc | ||
|---|---|---|
| 7558 | yes it is intentional this subpart is unsupported but ok about the new flag | |
| compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc | ||
|---|---|---|
| 7558 | Please keep it enabled in NetBSD. | |
| compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc | ||
|---|---|---|
| 7558 | It s enabled with a separated flag | |
| compiler-rt/test/sanitizer_common/TestCases/Linux/ttyent.cpp | ||
|---|---|---|
| 38–58 | Can this be like: void test4() {
#if defined(__NetBSD__)
if (!setttyentpath(_PATH_TTYS))
exit(1);
#else
return;
#endif
struct ttyent *typ = getttyent();
assert(typ && typ->ty_name != nullptr);
assert(typ->ty_type != nullptr);
assert(typ->ty_class != nullptr);
endttyent();
}
int main(void) {
test1();
test2();
test3();
test4(); | |
| compiler-rt/test/sanitizer_common/TestCases/Linux/ttyent.cpp | ||
|---|---|---|
| 38–58 | unfortunately I would have to ifdef the last member check which is netbsd specific. | |
| compiler-rt/test/sanitizer_common/TestCases/Linux/ttyent.cpp | ||
|---|---|---|
| 3 | Since sanitizer_common/TestCases/Linux/lit.local.cfg.py has if root.host_os not in ["Linux"]:, the test will not run on FreeBSD/NetBSD. | |
More consistent solution is to introduce
SANITIZER_INTERCEPT_SETTTYENTPATH
Actually this part disables setttyentpath on anything but FreeBSD. Is this intentional?