public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/115630] New: Bounded queue does not finalize controlled components
@ 2024-06-25  7:07 saulius.grazulis at bti dot vu.lt
  2024-06-27 10:55 ` [Bug ada/115630] " ebotcazou at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: saulius.grazulis at bti dot vu.lt @ 2024-06-25  7:07 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115630
           Summary: Bounded queue does not finalize controlled components
           Product: gcc
           Version: 13.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: saulius.grazulis at bti dot vu.lt
                CC: dkm at gcc dot gnu.org
  Target Milestone: ---

Created attachment 58510
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58510&action=edit
Source code, compilation and run logs and command history to reproduce the bug

The controlled components of an instance of the
Ada.Containers.Synchronized_Queue_Interfaces does not run the Finalize
procedure for the elements that are still in the queue when the queue goes out
of scope (e.g. when the control exits a 'declare' block). This can be
demonstrated to lead to memory leaks if Finalize is used to release the memory
(see 'check_queue_finalisation.adb').

When 'check_queue_finalisation' is run, 'Dispose' is called only once from the
'Finalize'. The expected behaviour is that 'Dispose' is called for all
allocated blocks eventually.

The finalisers are not always called even if I wrap my Controlled type value in
am Indefinite_Holder ('check_indefinite_queue_finalisation.adb').

The code works as expected for Unbounded_Synchronized_Queues with an
Indefinite_Holder wrapper ('check_unbounded_indefinite_queue_finalisation.adb')

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

end of thread, other threads:[~2024-06-27 11:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-25  7:07 [Bug ada/115630] New: Bounded queue does not finalize controlled components saulius.grazulis at bti dot vu.lt
2024-06-27 10:55 ` [Bug ada/115630] " ebotcazou at gcc dot gnu.org
2024-06-27 11:26 ` saulius.grazulis at bti dot vu.lt
2024-06-27 11:29 ` saulius.grazulis at bti dot vu.lt
2024-06-27 11:33 ` ebotcazou 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).