public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "Joost.VandeVondele at mat dot ethz.ch" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/67414] New: [5 Regression] Error message on failed allocate
Date: Mon, 31 Aug 2015 16:32:00 -0000	[thread overview]
Message-ID: <bug-67414-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67414

            Bug ID: 67414
           Summary: [5 Regression] Error message on failed allocate
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Joost.VandeVondele at mat dot ethz.ch
  Target Milestone: ---

For 4.9 and earlier a gfortran compiled binary would print a clear error
message if an allocate would fail like in:

> cat test.f90 
INTEGER, POINTER, DIMENSION(:) :: leak
DO
  ALLOCATE(leak(1000))
  leak=0
ENDDO
END
> gfortran -g test.f90
> ulimit -v 1000000
> ./a.out
Operating system error: Cannot allocate memory
Allocation would exceed memory limit

With gcc 5 I get only part of the error, but also a backtrace (which is nice) :

> ./a.out
Operating system error: 
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x7F610BCC0B87
#1  0x7F610BCBFD80
#2  0x3BA4A3269F
#3  0x3BA4A2B38F
#4  0x7F610BCC1A92
#5  0x7F610BCC1B80
#6  0x400786 in MAIN__ at test.f90:3 (discriminator 3)
Segmentation fault

With gcc 6, unfortunately, the backtrace is replace with an error message:
> ./a.out
Operating system error: 
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:

Something went wrong while printing the backtrace: mmap

Something went wrong while printing the backtrace: mmap

Something went wrong while printing the backtrace: mmap
Segmentation fault

Ideally, we get both the clear error message and a backtrace.


             reply	other threads:[~2015-08-31 16:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-31 16:32 Joost.VandeVondele at mat dot ethz.ch [this message]
2015-08-31 21:03 ` [Bug fortran/67414] " jb at gcc dot gnu.org
2015-09-01  8:34 ` [Bug fortran/67414] [5/6 " rguenth at gcc dot gnu.org
2015-09-02 14:52 ` jb at gcc dot gnu.org
2015-09-02 15:16 ` jb at gcc dot gnu.org

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-67414-4@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).