This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/41093] New: memory leaks with gfc_namespace
- From: "janus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Aug 2009 14:45:52 -0000
- Subject: [Bug fortran/41093] New: memory leaks with gfc_namespace
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
It seems that there is something wrong in the reference counting for
namespaces, especially (only?) for the formal_ns of procedures. This was
noticed when working on PR 40877 (memory leaks with gfc_charlen). E.g. in
bounds_check_strlen_8.f90, the formal_ns of 'F1' is never freed up.
Reduced example:
FUNCTION F1(a,b,c,d) RESULT(RES)
CHARACTER(LEN=80), OPTIONAL :: a,b,c,d
LOGICAL :: res
END FUNCTION F1
When compiling this, gfc_free_namespace is called just once for the formal_ns
of 'F1', but ns->refs is 3, so it is never freed.
--
Summary: memory leaks with gfc_namespace
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: janus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41093