=?utf-8?q?Andrés?= Villegas <andre...@google.com>, =?utf-8?q?Andrés?= Villegas <andre...@google.com> Message-ID: In-Reply-To: <llvm.org/llvm/llvm-project/pull/77...@github.com>
================ @@ -0,0 +1,33 @@ +// COM: End to end test for the sanitizer symbolizer markup. Since it uses debug info +// COM: to do offline symbolization we only check that the current module is correctly symbolized +// REQUIRES: linux +// RUN: %clangxx_asan %s -Wl,--build-id=0x12345678 -o %t.main +// RUN: mkdir -p %t/.build-id/12 +// RUN: cp %t.main %t/.build-id/12/345678.debug +// RUN: %env_asan_opts=enable_symbolizer_markup=1 not %run %t.main 2>%t/sanitizer.out +// RUN: llvm-symbolizer --filter-markup --debug-file-directory=%t < %t/sanitizer.out | FileCheck %s + +#include <stdlib.h> + +[[gnu::noinline]] char *alloc() { + char *x = (char *)malloc(10 * sizeof(char)); + return x; +} +int main() { + char *x = alloc(); + free(x); + return x[5]; +} +// CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}} +// CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}} +// CHECK: {{READ of size 1 at 0x.* thread T0}} +// CHECK: {{ #0 0x.* main .*use-after-free-symbolizer-markup.cpp:}}[[@LINE-5]] ---------------- avillega wrote: Done https://github.com/llvm/llvm-project/pull/77702 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits