This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/67414] New: [5 Regression] Error message on failed allocate
- From: "Joost.VandeVondele at mat dot ethz.ch" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 31 Aug 2015 16:32:30 +0000
- Subject: [Bug fortran/67414] New: [5 Regression] Error message on failed allocate
- Auto-submitted: auto-generated
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.