From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25405 invoked by alias); 12 Mar 2013 22:05:43 -0000 Received: (qmail 24843 invoked by uid 48); 12 Mar 2013 22:05:14 -0000 From: "tkoenig at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/56581] Segfault when reading source file which starts with a byte-order mark (-cpp works) Date: Tue, 12 Mar 2013 22:05:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: ice-on-invalid-code, rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: tkoenig at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Keywords Status Last reconfirmed Ever Confirmed Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2013-03/txt/msg00990.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56581 Thomas Koenig changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ice-on-invalid-code, | |rejects-valid Status|UNCONFIRMED |NEW Last reconfirmed|2013-03-10 00:00:00 |2013-03-12 Ever Confirmed|0 |1 --- Comment #8 from Thomas Koenig 2013-03-12 22:05:12 UTC --- We try to support this, but apparently it doesn't work (see line 2015 and following of scanner.c). Same thing happens for 4.6 and 4.7. Valgrind tells me ==11226== Memcheck, a memory error detector ==11226== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al. ==11226== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info ==11226== Command: /home/ig25/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/f951 ice.f ==11226== ==11226== Invalid write of size 4 ==11226== at 0x580400: load_line(_IO_FILE*, unsigned int**, int*, int const*) (scanner.c:1646) ==11226== by 0x5811C3: load_file(char const*, char const*, bool) (scanner.c:2009) ==11226== by 0x582F82: gfc_new_file() (scanner.c:2120) ==11226== by 0x5A1DA7: gfc_init() (f95-lang.c:224) ==11226== by 0x94F286: toplev_main(int, char**) (toplev.c:1700) ==11226== by 0x5A38454: (below main) (in /lib64/libc-2.15.so) ==11226== Address 0x5ea3e30 is 0 bytes after a block of size 288 alloc'd ==11226== at 0x4C292B8: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==11226== by 0xE54110: xcalloc (xmalloc.c:162) ==11226== by 0x58155E: load_file(char const*, char const*, bool) (scanner.c:2030) ==11226== by 0x582F82: gfc_new_file() (scanner.c:2120) ==11226== by 0x5A1DA7: gfc_init() (f95-lang.c:224) ==11226== by 0x94F286: toplev_main(int, char**) (toplev.c:1700) ==11226== by 0x5A38454: (below main) (in /lib64/libc-2.15.so)