Bug 253102 - gfortran generates incorrect code for temporary array of strings
gfortran generates incorrect code for temporary array of strings
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
7
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-08-16 18:49 EDT by Ben Webb
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version: 4.1.2-27.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-09-28 17:24:45 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
test.F90, minimal Fortran 90 testcase (540 bytes, text/plain)
2007-08-16 18:49 EDT, Ben Webb
no flags Details

  None (edit)
Description Ben Webb 2007-08-16 18:49:38 EDT
Description of problem:
The attached test.F90 contains a subroutine which constructs a temporary array
of strings from one of its own input strings. The code will compile, but the
resulting program crashes when run.

Version-Release number of selected component (if applicable):
gcc-gfortran-4.1.2-12 (latest gfortran for Fedora 7 i686 and x86_64)
gcc-gfortran-4.1.1-52.el5.2 (latest gfortran for RHEL 5 ia64)

How reproducible:
Always (at least on the i686, x86_64, and ia64 boxes I've tried it on)

Steps to Reproduce:
1. Compile the test program with 'gfortran -g test.F90'
2. Run it with './a.out'
  
Actual results:
Program crashes with a segmentation fault. gdb output suggests that the heap is
corrupted:
Program received signal SIGSEGV, Segmentation fault.
0x4f793756 in _int_free () from /lib/libc.so.6
(gdb) bt
#0  0x4f793756 in _int_free () from /lib/libc.so.6
#1  0x4f797430 in free () from /lib/libc.so.6
#2  0x4f8f50c1 in _gfortran_internal_free () from /usr/lib/libgfortran.so.1
#3  0x0804874e in __testmod__test_sub (padstr=@0xbf912523, strarr=@0xbf9124d3, 
    _padstr=5, _strarr=80) at test.F90:14
#4  0x080487f0 in MAIN__ () at test.F90:27
#5  0x08048827 in main ()



Expected results:
Program should run to completion (as in fact it does when compiled with NAG, PGI
or Intel Fortran compilers).
Comment 1 Ben Webb 2007-08-16 18:49:38 EDT
Created attachment 161701 [details]
test.F90, minimal Fortran 90 testcase
Comment 3 Fedora Update System 2007-08-29 13:27:44 EDT
gcc-4.1.2-18.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.
Comment 4 Fedora Update System 2007-09-28 17:24:42 EDT
gcc-4.1.2-27.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.