[PATCH] PR23230 Fix asan strtol_strict/strtoll_strict tests

Kostya Serebryany kcc at google.com
Wed May 27 09:59:23 PDT 2015


================
Comment at: test/asan/TestCases/strtol_strict.c:45
@@ +44,3 @@
+void __attribute__((no_sanitize_address)) underflow_write(char *array) {
+  array[-1] = '\0';
+}
----------------
ouch. This is going to corrupt asan's heap internals and may cause other kinds of flakiness in the test. 
I would suggest to allocate a larger buffer, write 0 to the first 8 bytes,  apply __asan_poison_memory to those first 8 bytes, 
and then pass pass the address to one of those 8 bytes to strtol. 
This way you will get a reliable test.

http://reviews.llvm.org/D10063

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list