[libc-commits] [PATCH] D78612: [libc] Add sanitizer instrumentation to the SIMD strlen implementation.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Apr 22 13:37:26 PDT 2020


sivachandra added a comment.

In D78612#1997532 <https://reviews.llvm.org/D78612#1997532>, @hctim wrote:

> From a libc-developer's perspective - I completely understand that having a sanitizer-friendly implementation and a sanitizer-unfriendly implementation is undesirable. The tradeoff here is an enormous maintenance burden. By emulating ASan's behaviour here - it's creating the expectation to emulate all of MSan, TSan, HWASan, UBSan, MTE and DFSan's behaviours as well. This turns strlen() into hundreds of lines of sanitizer-specific behaviour and tricks.


Totally agree that emulating every sanitizer's behavior is not the approach we should be taking. This is probably dumb, but like I have mentioned previously, is it possible to unify/simplify the API of the various sanitizers?

Since everyone from sanitizers is subscribed on this change, let me ask few general questions:

1. Should LLVM libc have code which relies on, for example, the undefined behavior like in the implementation of strlen in the change?
2. Should LLVM libc have hand-crafted sanitizer instrumentation at all? If yes, what should be the criteria to determine whether it is required?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78612/new/

https://reviews.llvm.org/D78612





More information about the libc-commits mailing list