public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rnhmjoj at eurofusion dot eu" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/115072] New: Memory link with unlimited polymorphic function result Date: Mon, 13 May 2024 14:44:07 +0000 [thread overview] Message-ID: <bug-115072-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115072 Bug ID: 115072 Summary: Memory link with unlimited polymorphic function result Product: gcc Version: 13.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: rnhmjoj at eurofusion dot eu Target Milestone: --- The following program works as expected, but the result of the id(x) function does not appear to be ever deallocated creating a memory leak: program test print *, transfer(id(7), 1) contains pure function id(x) result(y) class(*), intent(in) :: x class(*), allocatable :: y y = x end function end program test Specifically, running the program in valgrind memcheck with --leak-check=full reveals this: 4 bytes in 1 blocks are definitely lost in loss record 1 of 1 at 0x484276B: malloc (in vgpreload_memcheck-amd64-linux.so) by 0x401338: id.1 (test.f90:10) by 0x401243: MAIN__ (test.f90:3) by 0x401432: main (test.f90:3) Replacing the `class(*)` with some other type does not produce a leak.
next reply other threads:[~2024-05-13 14:44 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-05-13 14:44 rnhmjoj at eurofusion dot eu [this message] 2024-05-13 17:02 ` [Bug fortran/115072] Memory leak " anlauf at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-115072-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).