https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112828
Bug ID: 112828
Summary: Abort with malloc(): corrupted top size
Product: gcc
Version: 13.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: townsend at astro dot wisc.edu
Target Milestone: ---
Created attachment 56768
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56768&action=edit
MWE demonstrating problem
When I compile the attached MWE with
gfortran -o test test.f90
...I get the following runtime error:
malloc(): corrupted top size
Program received signal SIGABRT: Process abort signal.
Backtrace for this error:
#0 0x7f13a2e7760f in ???
#1 0x7f13a2ec500c in ???
#2 0x7f13a2e77571 in raise
#3 0x7f13a2e614b1 in abort
#4 0x7f13a2e623b4 in ???
#5 0x7f13a2ece874 in ???
#6 0x7f13a2ed1fdf in ???
#7 0x7f13a2ed2b59 in __libc_malloc
#8 0x40191a in MAIN__
#9 0x401c8c in main
Aborted
If I comment out the first allocate statement (the one with the STAT argument),
then the program runs without problem (even though this statement isn't
actually executed). There are a number of other things that make the bug go
away; e.g., shrinking the length of the character variables in the main program
to 20 or smaller. Setting the length to 21 still runs without error, but the
second element of c_r ends up with some junk in it, viz:
foo foo A
cheers,
Rich