Fwd: gfortran memory leakage

Jerry DeLisle jvdelisle@charter.net
Sat Mar 30 02:28:00 GMT 2013


On 02/08/2013 01:23 AM, Janus Weil wrote:
> Hi,
> 
> this kind of bugreport should rather go to fortran@gcc.gnu.org (where
> I'm forwarding it now).
> 
> In fact I can reproduce the behavior you describe, but from a quick
> look I don't directly see where the memory goes. Maybe someone else
> does?
> 
---- snip ----


This is PR55469.  Tobias has a patch for this.  I think we should commit that
patch and backport it to fix this now since we don't have much time to look into
reimplementing with the fbuf mechanism.  The free_line/free_saved patch is easy.

Jerry


> ---------- Forwarded message ----------
> From: MATcalc_Sysadmin <sysadmin@matcalc.de>
> Date: 2013/2/7
> Subject: gfortran memory leakage
> To: gcc@gcc.gnu.org
> 
> 
> Hello,
> 
> We found a quite strange behaviour of the gfortran 4.5.3 for
> the following five examples. The first one shows heavily
> increasing memomry consuption over runtime.
> The error happens during the read command.
> 
> The other 4 exmples are okay.
> 
> 1. example
> 
>      program test1
>      character*200 test
>      REAL*8 vout
>      test='NH'
>   10 continue
>      read (test,*,end=20,err=22) vout
>   22 continue
>      write(*,*) vout,"  error"
>      goto 10
>   20 continue
>      write(*,*) vout
>      goto 10
>      end
> 
> #output:      6.90740463938966731E-310  .....
> #heavily increasing memory
> 
> 2. example
> 
>      program test1
>      character*200 test
>      integer vout
>      test='NH'
>   10 continue
>      read (test,*,end=20,err=22) vout
>   22 continue
>      write(*,*) vout,"  error"
>      goto 10
>   20 continue
>      write(*,*) vout
>      goto 10
>      end
> 
> #output: 32750 error ....
> 
> 3. example
> 
>      program test1
>      character*200 test
>      integer vout
>      test='2'
>   10 continue
>      read (test,*,end=20,err=22) vout
>   22 continue
>      write(*,*) vout,"  error"
>      goto 10
>   20 continue
>      write(*,*) vout
>      goto 10
>      end
> #output: 2  .....
> #memory okay
> 
> 4. example
> 
>      program test1
>      character*200 test
>      REAL*8 vout
>      test='2'
>   10 continue
>      read (test,*,end=20,err=22) vout
>   22 continue
> *      write(*,*) vout,"  error"
>      goto 10
>   20 continue
>      write(*,*) vout
>      goto 10
>      end2.0000000000000000
> 
> #output:  2.0000000000000000      .....
> #memory okay
> 
> 5. example
> 
>      program test1
>      character*200 test
>      REAL*8 vout
>      test='NH'  10 continue
>      read (test,'(F6.4)',end=20,err=22) vout
>   22 continue
>      write(*,*) vout,"  error"
>      goto 10
>   20 continue
>      write(*,*) vout
>      goto 10
>      end
> 
> #output:      6.94129341886360735E-310   .....
> #memory okay
> 
> The system is x86_64 running gentoo.
> 
> The results didnt change for different libc, gcc versions and also
> for different compiler flags.
> 
> Can anyone please help? Many thanks!
> 
> --
> Plänitz
> www.matcalc.de
> 



More information about the Fortran mailing list