From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69924 invoked by alias); 31 Aug 2015 16:32:34 -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 69888 invoked by uid 48); 31 Aug 2015 16:32:31 -0000 From: "Joost.VandeVondele at mat dot ethz.ch" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: Joost.VandeVondele at mat dot ethz.ch X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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-08/txt/msg02147.txt.bz2 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.