[Bug fortran/85192] Memory leak on every read() from string

2018-04-04 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85192

Thomas Koenig  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |WORKSFORME

--- Comment #3 from Thomas Koenig  ---
Hmm... still strange.

There is no 7.2.1 in the official gcc releases, possibly the Fedora
people backported some patch which fixes this issue (but I don't
see an obvious candidate at the moment).

That's as may be, I am closing this as WORKSFORME for now.

If the problem persists with newer versions, or if there are other
problems, please reopen or submit a new bug report.

[Bug fortran/85192] Memory leak on every read() from string

2018-04-04 Thread Vasilis.Vlachoudis at cern dot ch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85192

--- Comment #2 from Vasilis.Vlachoudis at cern dot ch  ---
I am using 7.2.0 from ubuntu. I've just checked on the latest Fedora with 7.2.1
and it gives the same result as in your case, so probably it is fixed.

[Bug fortran/85192] Memory leak on every read() from string

2018-04-04 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85192

Thomas Koenig  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2018-04-04
 CC||tkoenig at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Thomas Koenig  ---
Works for me with current trunk and with gcc 7:

ig25@flaemmli:~/Krempel/Leak> gfortran b.f90 meminfo.c && ./a.out
3312
3408
3504
3600
3696
3792
3888
3888
3888
3888
ig25@flaemmli:~/Krempel/Leak> /usr/bin/gfortran-7 b.f90 meminfo.c && ./a.out
3296
3392
3488
3584
3680
3776
3872
3872
3872
3872

Also, valgrind disagrees (on a slightly reduced test case):

ig25@flaemmli:~/Krempel/Leak> cat a.f90 
! PR 85192
 real*8  x, y, z, u, v, w, erg, tme, wgt
 character*250 line
 line='1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10'
!nstart = meminfo()
 do i=1,10
read(line,*) x,y,z,u,v,w,erg,tme,wgt,ij
!print *, x,y,z,u,v,w,erg,tme,wgt,ij
!   print *,meminfo()-nstart
 enddo
 end
ig25@flaemmli:~/Krempel/Leak> gfortran a.f90 
ig25@flaemmli:~/Krempel/Leak> valgrind ./a.out
==4343== Memcheck, a memory error detector
==4343== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==4343== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==4343== Command: ./a.out
==4343== 
==4343== 
==4343== HEAP SUMMARY:
==4343== in use at exit: 0 bytes in 0 blocks
==4343==   total heap usage: 153 allocs, 153 frees, 46,760 bytes allocated
==4343== 
==4343== All heap blocks were freed -- no leaks are possible
==4343== 
==4343== For counts of detected and suppressed errors, rerun with: -v
==4343== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

What version are you using?