[6 Regession] Usage of unitialized pointer io/list_read.c (

Dominique d'Humières dominiq@lps.ens.fr
Tue Feb 16 13:17:00 GMT 2016


Hi Jerry,

> Thanks for review. Committed to trunk r233436.

The test gfortran.dg/read_bang4.f90 fails on x86_64-apple-darwin15:

a.out(15552,0x7fff7b2e3000) malloc: *** error for object 0x7fb472804c00: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

Program received signal SIGABRT: Process abort signal.

If I compile the test with -fsanitize=address, I get

=================================================================
==15561==ERROR: AddressSanitizer: attempting double-free on 0x61a00001c280 in thread T0:
    #0 0x106d1ac40 in wrap_free.part.0 sanitizer_malloc_mac.inc:103
    #1 0x106c0078f in _gfortrani_list_formatted_read list_read.c:137
    #2 0x4400000042  (<unknown module>)

0x61a00001c280 is located 0 bytes inside of 1200-byte region [0x61a00001c280,0x61a00001c730)
freed by thread T0 here:
    #0 0x106d19e09 in wrap_realloc sanitizer_malloc_mac.inc:108
    #1 0x106b38a14 in _gfortrani_xrealloc memory.c:98

previously allocated by thread T0 here:
    #0 0x106d19fe9 in wrap_calloc sanitizer_malloc_mac.inc:114
    #1 0x106b389d2 in _gfortrani_xcalloc memory.c:84

SUMMARY: AddressSanitizer: double-free sanitizer_malloc_mac.inc:103 in wrap_free.part.0
==15561==ABORTING

Program received signal SIGABRT: Process abort signal.

TIA

Dominique



More information about the Gcc-patches mailing list