[PATCH] [Sanitizers] Intercept snprintf_l() on FreeBSD

Evgeniy Stepanov eugenis at google.com
Thu Nov 27 00:18:22 PST 2014


Please add a test, either in test/asan or in lib/asan/tests/asan_test.cc

================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:892
@@ -891,1 +891,3 @@
 // https://code.google.com/p/address-sanitizer/issues/detail?id=321.
+#define VSNPRINTF_L_INTERCEPTOR_IMPL(vname, str, size, loc, ...)               \
+  {                                                                            \
----------------
Why not use VSNPRINTF_INTERCEPTOR_IMPL directly?

Also, what about all the other *printf*_l functions? They do not have to be done in 1 patch, but you'll probably run into issues with them at some point, too.


================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:906-908
@@ -892,1 +905,5 @@
+
+// FIXME: under ASan the REAL() call below may write to freed memory and
+// corrupt its metadata. See
+// https://code.google.com/p/address-sanitizer/issues/detail?id=321.
 #define VASPRINTF_INTERCEPTOR_IMPL(vname, strp, ...)                           \
----------------
emaste wrote:
> Just to confirm, the issue reported in this comment is not directly tied to the new *printf_l functionality?
It's not.

http://reviews.llvm.org/D6418






More information about the llvm-commits mailing list