public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/109003] New: memory leak in module loading (mio_formal_arglist)
@ 2023-03-03  7:48 rguenth at gcc dot gnu.org
  2023-04-01 21:36 ` [Bug fortran/109003] " aldot at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-03-03  7:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109003

            Bug ID: 109003
           Summary: memory leak in module loading (mio_formal_arglist)
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

valgrind complains when building SPEC 2017 521.wrf

==24177== 32 bytes in 2 blocks are possibly lost in loss record 66 of 2,272
==24177==    at 0x4C39571: calloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==24177==    by 0x1C071F0: xcalloc (xmalloc.c:164)
==24177==    by 0x766248: mio_formal_arglist (module.cc:3201)
==24177==    by 0x766248: mio_symbol(gfc_symbol*) (module.cc:4586)
==24177==    by 0x766836: load_needed(pointer_info*) (module.cc:5195)
==24177==    by 0x7667E0: load_needed(pointer_info*) (module.cc:5154)
==24177==    by 0x7667D5: load_needed(pointer_info*) (module.cc:5153)
==24177==    by 0x7667D5: load_needed(pointer_info*) (module.cc:5153)
==24177==    by 0x7667E0: load_needed(pointer_info*) (module.cc:5154)
==24177==    by 0x7667D5: load_needed(pointer_info*) (module.cc:5153)
==24177==    by 0x7667D5: load_needed(pointer_info*) (module.cc:5153)
==24177==    by 0x7667D5: load_needed(pointer_info*) (module.cc:5153) 
==24177==    by 0x767C0B: read_module() (module.cc:5697)

I'm not sure what actually happens, but I guess sym->formal is eventually
replaced so the allocated memory gets dangling?  Or we free some of the
module memory later but not everything.

It seems valgrind complains about a lot of leaks when modules are involved.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug fortran/109003] memory leak in module loading (mio_formal_arglist)
  2023-03-03  7:48 [Bug fortran/109003] New: memory leak in module loading (mio_formal_arglist) rguenth at gcc dot gnu.org
@ 2023-04-01 21:36 ` aldot at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: aldot at gcc dot gnu.org @ 2023-04-01 21:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109003

Bernhard Reutner-Fischer <aldot at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aldot at gcc dot gnu.org

--- Comment #1 from Bernhard Reutner-Fischer <aldot at gcc dot gnu.org> ---
Sounds familiar, i thought i've fixed this already some time ago?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-01 21:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-03  7:48 [Bug fortran/109003] New: memory leak in module loading (mio_formal_arglist) rguenth at gcc dot gnu.org
2023-04-01 21:36 ` [Bug fortran/109003] " aldot at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).