From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90095 invoked by alias); 25 Mar 2015 18:23:23 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 90021 invoked by uid 48); 25 Mar 2015 18:23:10 -0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/65563] Segfault on reopening fort.xxx file with explicit name Date: Wed, 25 Mar 2015 18:37:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libfortran X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dominiq at lps dot ens.fr X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-03/txt/msg02821.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65563 Dominique d'Humieres changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2015-03-25 Ever confirmed|0 |1 --- Comment #1 from Dominique d'Humieres --- With 4.8.4, 4.9.5, 4.9.2, 4.9.3, and trunk (5.0), I get the error At line 8 of file pr65563.f90 (unit = 522, file = '') Fortran runtime error: File already opened in another unit However if I compile the test with -fsanitize=address, I get with 4.9x ==91085==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200000e011 at pc 0x10a40c5d8 bp 0x7fff5580f2a0 sp 0x7fff5580f278 READ of size 2 at 0x60200000e011 thread T0 #0 0x10a40c5d7 (/opt/gcc/gcc4.9wr/lib/libasan.1.dylib+0x175d7) #1 0x7fff8bd20f01 (/usr/lib/system/libsystem_c.dylib+0x45f01) #2 0x7fff8bd499ae (/usr/lib/system/libsystem_c.dylib+0x6e9ae) #3 0x7fff8bd2e154 (/usr/lib/system/libsystem_c.dylib+0x53154) #4 0x7fff8bd2e209 (/usr/lib/system/libsystem_c.dylib+0x53209) #5 0x10b0a4dca (/opt/gcc/gcc4.9wr/lib/libgfortran.3.dylib+0x2dca) 0x60200000e011 is located 0 bytes to the right of 1-byte region [0x60200000e010,0x60200000e011) allocated by thread T0 here: #0 0x10a412a06 (/opt/gcc/gcc4.9wr/lib/libasan.1.dylib+0x1da06) #1 0x10b0a5c24 (/opt/gcc/gcc4.9wr/lib/libgfortran.3.dylib+0x3c24) Shadow bytes around the buggy address: 0x1c0400001bb0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1c0400001bc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1c0400001bd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1c0400001be0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1c0400001bf0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x1c0400001c00: fa fa[01]fa fa fa 00 fa fa fa 06 fa fa fa 06 fa 0x1c0400001c10: fa fa 05 fa fa fa 00 06 fa fa 00 00 fa fa 03 fa 0x1c0400001c20: fa fa 00 06 fa fa 00 07 fa fa 00 fa fa fa 00 00 0x1c0400001c30: fa fa 00 00 fa fa 00 00 fa fa 00 00 fa fa 00 00 0x1c0400001c40: fa fa 00 00 fa fa 00 00 fa fa 00 00 fa fa 00 00 0x1c0400001c50: fa fa 00 00 fa fa 00 00 fa fa 00 00 fa fa 00 00 while I get the above error with 4.8 and 5.0 (clean or patched trees).