On 05/17/2016 04:46 PM, Jakub Jelinek wrote:
On Tue, May 17, 2016 at 05:38:27PM +0300, Maxim Ostapenko wrote:
Hi Jakub,

thanks for backporting this! Do you have any plans to apply this patch to
GCC 5 and 6 branches? AFAIK people hit on this ASan + newer Glibc bug by
using GCC 5.3.1 on Fedora 23.

I don't have the newer glibc on my box, therefore I'm waiting until somebody
confirms the trunk change fixed it before backporting.

I compiled GCC trunk (r236371) and today's glibc master (around commit 0014680d6a5bdeb4fe17682450105ebed19f35da), and both work together, in the sense that this test program, when compiled with ASAN, reports a memory leak:

#include <stdlib.h>
int main () { malloc(35); return 0; }

=================================================================
==30982==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 35 byte(s) in 1 object(s) allocated from:
#0 0x7fa00ea15928 in __interceptor_malloc ../../../../trunk/libsanitizer/asan/asan_malloc_linux.cc:62
    #1 0x400763  (/home/fweimer/src/gnu/glibc/build/elf/ld.so+0x400763)
    #2 0x7fa00e5d625f in __libc_start_main ../csu/libc-start.c:289

SUMMARY: AddressSanitizer: 35 byte(s) leaked in 1 allocation(s).

Before, when compiled with GCC 5.3.1 (in Fedora 22), it would report an internal error:

==30945==AddressSanitizer CHECK failed: ../../../../libsanitizer/asan/asan_rtl.cc:556 "((!asan_init_is_running && "ASan init calls itself!")) != (0)" (0x0, 0x0)
    <empty stack>


Thanks,
Florian

Reply via email to