This is an archive of the discontinued LLVM Phabricator instance.

Cleanup in sanitizer_common_interceptors.inc
AbandonedPublic

Authored by krytarowski on Feb 28 2018, 10:02 AM.

Details

Reviewers
vitalybuka
joerg
Summary

Switch a #if SANITIZER_NETBSD block to
COMMON_MAYBE_INTERCEPT_NETBSD_ALIAS*.

No functional change intended.

Requested by <vitalybuka>

Sponsored by <The NetBSD Foundation>

Diff Detail

Repository
rL LLVM

Event Timeline

krytarowski created this revision.Feb 28 2018, 10:02 AM
vitalybuka added inline comments.Mar 1 2018, 11:56 AM
lib/sanitizer_common/sanitizer_common_interceptors.inc
7270

for consistency it should be
INIT_MUTEX_LOCK
INIT_MUTEX_UNLOCK
INIT_SET_CANCEL_STATE

All INIT_* macros are already MAYBE and enabled/disabled according to the platform.

krytarowski added inline comments.Mar 3 2018, 5:12 AM
lib/sanitizer_common/sanitizer_common_interceptors.inc
7270

These ones are aliases specific to NetBSD libc.

How about: INIT_NETBSD_ALIAS* and INIT_NETBSD_ALIAS_THR*?

vitalybuka added inline comments.Mar 3 2018, 5:39 PM
lib/sanitizer_common/sanitizer_common_interceptors.inc
4049

and we need SANITIZER_INTERCEPT_* in platform
#if SANITIZER_INTERCEPT__LIBC_MUTEX_LOCK
....

#if SANITIZER_INTERCEPT__LIBC_THR_SETCANCELSTATE
....

7270

I guess the point that here we hide how (_ALIAS_) and on which platform(_NETBSD_) it works

krytarowski added inline comments.Mar 4 2018, 1:51 AM
lib/sanitizer_common/sanitizer_common_interceptors.inc
7270

These ones are NetBSD-specific and legacy internal symbols in libc, we allowed to handle non-posix or alternative libpthread implementation, but nowadays it will never happen. We will get rid of them with a new major version bump in libc (no ETA for this).

There is a prior-art in TSan for the same case.

However I will go the requested route.

krytarowski planned changes to this revision.Mar 7 2018, 1:26 AM

I've entirely switched to NetBSD kernel fixes in order to host fully-functional LLDB. Once I will be done with the debugger, I will be back to sanitizers and work on connecting a buildbot and remaining fixes and cleanup.

Addressed by @vitalybuka.

Author: vitalybuka
Date: Sat May 12 22:55:45 2018
New Revision: 332190

URL: http://llvm.org/viewvc/llvm-project?rev=332190&view=rev
Log:
[sanitizer] Replace #if SANITIZER_NETBSD with #if SANITIZER_INTERCEPT___LIBC_MUTEX

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h

Thanks for the help and sorry for waiting so long with pending patches.

krytarowski abandoned this revision.May 13 2018, 6:39 AM

Addressed by @vitalybuka.

Author: vitalybuka
Date: Sat May 12 22:55:45 2018
New Revision: 332190

URL: http://llvm.org/viewvc/llvm-project?rev=332190&view=rev
Log:
[sanitizer] Replace #if SANITIZER_NETBSD with #if SANITIZER_INTERCEPT___LIBC_MUTEX

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h

Thanks for the help and sorry for waiting so long with pending patches.

No problem. Actually I forgot about this review. I am changing mutex interceptors and I've noticed this inconsistency.