This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [6 Regession] Usage of unitialized pointer io/list_read.c (
- From: Dominique d'HumiÃres <dominiq at lps dot ens dot fr>
- To: "jvdelisle at charter dot net" <jvdelisle at charter dot net>
- Cc: fortran at gcc dot gnu dot org, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 16 Feb 2016 14:17:34 +0100
- Subject: Re: [6 Regession] Usage of unitialized pointer io/list_read.c (
- Authentication-results: sourceware.org; auth=none
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