This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: segfault with gfortran > 4.0.3
Hi,
Thanks very much FX for working out a simplified case.
FX's code works fine with gfortran 4.0.3 (Ubuntu 6.06), but fails with
gfortran 4.1.1 (FC5), as shown below (success on ubuntu followed by
failure on FC5):
- - - - - -
john@roadwork:~$ gfortran -c -o simplified.o simplified.f90
john@roadwork:~$ cat simplified.f90
subroutine bar(s, n)
integer n
character s*(n)
character*3, dimension(:), pointer :: m
contains
subroutine gee
m(1) = s(1:3)
end subroutine gee
end subroutine bar
john@roadwork:~$ gfortran --version
GNU Fortran 95 (GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5))
Copyright (C) 2006 Free Software Foundation, Inc.
GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING
- - - - - - -
[adrud@cruncher2 ~]$ gfortran --version
GNU Fortran 95 (GCC) 4.1.1 20060525 (Red Hat 4.1.1-1)
Copyright (C) 2006 Free Software Foundation, Inc.
GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING
[adrud@cruncher2 ~]$ gfortran -c -o simplified.o simplified.f90
simplified.f90:7: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.
[adrud@cruncher2 ~]$ cat simplified.f90
subroutine bar(s, n)
integer n
character s*(n)
character*3, dimension(:), pointer :: m
contains
subroutine gee
m(1) = s(1:3)
end subroutine gee
end subroutine bar
[adrud@cruncher2 ~]$ gfortran --version
GNU Fortran 95 (GCC) 4.1.1 20060525 (Red Hat 4.1.1-1)
Copyright (C) 2006 Free Software Foundation, Inc.
GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING
- - - - - - -
I'll update the bug on the redhat bugzilla.
I haven't checked this with the 4.2.0 windows version of gfortran.
Cheers
JP
François-Xavier Coudert wrote:
Hello John,
It shouldn't be too difficult. Put all the code from the
tarball into one file, check the segfault still occurs, then
start chopping out BLOCK IF and DO LOOPs until the Segfault
goes away. Restore the minimum code to again cause the Segfault,
and start chopping out peripherial code (whole subroutines and
functions). You'll probably reduce the 3000+ lines of code down
to a very generic 10 to 20 of lines of code. At this point,
there is no legal issue.
The following code reproduces the problem:
subroutine bar(s, n)
integer n
character s*(n)
character*3, dimension(:), pointer :: m
contains
subroutine gee
m(1) = s(1:3)
end subroutine gee
end subroutine bar
I think it's short enough to be legally OK.
FX
--
John Pye
Department of Mechanical and Manufacturing Engineering
University of New South Wales, Sydney, Australia
http://pye.dyndns.org/