https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61693

            Bug ID: 61693
           Summary: [asan] is not intercepting aligned_alloc
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: larsbj at gullik dot net
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org

cat aligned_alloc.c
#include <stdlib.h>

int main(void)
{
  void * p = aligned_alloc(128, 1024);
  free(p);
}

$ gcc -std=c11 -fsanitize=address aligned_alloc.c && ./a.out 
=================================================================
==28341==ERROR: AddressSanitizer: attempting free on address which was not
malloc()-ed: 0x000000728080 in thread T0
    #0 0x7fa78060d2d7 in __interceptor_free
../../../../gcc/libsanitizer/asan/asan_malloc_linux.cc:62
    #1 0x40077e in main (/home/lgb/Development/test/a.out+0x40077e)
    #2 0x31c0821d64 in __libc_start_main (/lib64/libc.so.6+0x31c0821d64)
    #3 0x400688 (/home/lgb/Development/test/a.out+0x400688)

AddressSanitizer can not describe address in more detail (wild memory access
suspected).
SUMMARY: AddressSanitizer: bad-free
../../../../gcc/libsanitizer/asan/asan_malloc_linux.cc:62 __interceptor_free
==28341==ABORTING


AFAICS the asan interceptor for aligned_alloc is missing.

Reply via email to