https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85389
Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2018-04-13 Assignee|unassigned at gcc dot gnu.org |marxin at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> --- Confirmed. Note that with GCC 8 there's more verbose assert: gcc pr85329.c -fsanitize=address && ./a.out ==6101==AddressSanitizer's allocator is terminating the process instead of returning 0 ==6101==If you don't like this behavior set allocator_may_return_null=1 ==6101==AddressSanitizer CHECK failed: ../../../../libsanitizer/sanitizer_common/sanitizer_allocator.cc:216 "((0)) != (0)" (0x0, 0x0) #0 0x7ffff6f061a9 in AsanCheckFailed ../../../../libsanitizer/asan/asan_rtl.cc:67 #1 0x7ffff6f212ed in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) ../../../../libsanitizer/sanitizer_common/sanitizer_termination.cc:77 #2 0x7ffff6f0b50a in __sanitizer::ReportAllocatorCannotReturnNull() ../../../../libsanitizer/sanitizer_common/sanitizer_allocator.cc:216 #3 0x7ffff6f0b557 in __sanitizer::ReturnNullOrDieOnFailure::OnBadRequest() ../../../../libsanitizer/sanitizer_common/sanitizer_allocator.cc:232 #4 0x7ffff6e38d5e in __asan::asan_posix_memalign(void**, unsigned long, unsigned long, __sanitizer::BufferedStackTrace*) ../../../../libsanitizer/asan/asan_allocator.cc:863 #5 0x7ffff6efc078 in __interceptor_posix_memalign ../../../../libsanitizer/asan/asan_malloc_linux.cc:157 #6 0x40086b in main (/home/marxin/Programming/testcases/a.out+0x40086b) #7 0x7ffff6a72a86 in __libc_start_main (/lib64/libc.so.6+0x21a86) #8 0x400799 in _start (/home/marxin/Programming/testcases/a.out+0x400799)