[llvm-commits] [compiler-rt] r161874 - in /compiler-rt/trunk/lib: asan/tests/asan_test.cc sanitizer_common/sanitizer_posix.cc

Timur Iskhodzhanov timurrrr at google.com
Fri Dec 26 02:37:01 PST 2014


Testcase?

Tue Aug 14 2012 at 7:21:13 PM, Kostya Serebryany <kcc at google.com>:

> Author: kcc
> Date: Tue Aug 14 10:18:40 2012
> New Revision: 161874
>
> URL: http://llvm.org/viewvc/llvm-project?rev=161874&view=rev
> Log:
> [asan] better diagnostics for mmap failure
>
> Modified:
>     compiler-rt/trunk/lib/asan/tests/asan_test.cc
>     compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc
>
> Modified: compiler-rt/trunk/lib/asan/tests/asan_test.cc
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> asan/tests/asan_test.cc?rev=161874&r1=161873&r2=161874&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/asan/tests/asan_test.cc (original)
> +++ compiler-rt/trunk/lib/asan/tests/asan_test.cc Tue Aug 14 10:18:40 2012
> @@ -1879,7 +1879,7 @@
>      char *x = (char*)malloc(kAllocSize);
>      memset(x, 0, kAllocSize);
>      total_size += kAllocSize;
> -    fprintf(stderr, "total: %ldM\n", (long)total_size >> 20);
> +    fprintf(stderr, "total: %ldM %p\n", (long)total_size >> 20, x);
>    }
>  }
>
>
> Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> sanitizer_common/sanitizer_posix.cc?rev=161874&r1=161873&
> r2=161874&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc (original)
> +++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc Tue Aug 14
> 10:18:40 2012
> @@ -17,10 +17,12 @@
>  #include "sanitizer_libc.h"
>  #include "sanitizer_procmaps.h"
>
> +#include <errno.h>
>  #include <pthread.h>
>  #include <stdarg.h>
>  #include <stdio.h>
>  #include <stdlib.h>
> +#include <string.h>
>  #include <sys/mman.h>
>  #include <sys/resource.h>
>  #include <sys/time.h>
> @@ -45,8 +47,9 @@
>                              PROT_READ | PROT_WRITE,
>                              MAP_PRIVATE | MAP_ANON, -1, 0);
>    if (res == (void*)-1) {
> -    Report("ERROR: Failed to allocate 0x%zx (%zd) bytes of %s\n",
> -           size, size, mem_type);
> +    Report("ERROR: Failed to allocate 0x%zx (%zd) bytes of %s: %s\n",
> +           size, size, mem_type, strerror(errno));
> +    DumpProcessMap();
>      CHECK("unable to mmap" && 0);
>    }
>    return res;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141226/e48487d3/attachment.html>


More information about the llvm-commits mailing list