public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-56581-4-L1A4iAQRuY@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-56581-4@http.gcc.gnu.org/bugzilla/>


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56581

Thomas Koenig <tkoenig at gcc dot gnu.org> 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 <tkoenig at gcc dot gnu.org> 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)


  parent reply	other threads:[~2013-03-12 22:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-09 20:43 [Bug fortran/56581] New: seg fault walt.brainerd at gmail dot com
2013-03-10 12:23 ` [Bug fortran/56581] " tkoenig at gcc dot gnu.org
2013-03-10 16:03 ` walt.brainerd at gmail dot com
2013-03-10 16:29 ` tkoenig at gcc dot gnu.org
2013-03-10 19:25 ` burnus at gcc dot gnu.org
2013-03-10 19:39 ` walt.brainerd at gmail dot com
2013-03-11 10:18 ` rguenth at gcc dot gnu.org
2013-03-11 10:51 ` [Bug fortran/56581] Segfault when reading source file which starts with a byte-order mark (-cpp works) burnus at gcc dot gnu.org
2013-03-12 22:05 ` tkoenig at gcc dot gnu.org [this message]
2013-03-13 16:13 ` walt.brainerd at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-56581-4-L1A4iAQRuY@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).