public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: gawrilow@math.tu-berlin.de To: gcc-gnats@gcc.gnu.org Subject: libstdc++/6582: memory leaks in iostream and locale Date: Mon, 06 May 2002 10:46:00 -0000 [thread overview] Message-ID: <20020506174134.12710.qmail@sources.redhat.com> (raw) >Number: 6582 >Category: libstdc++ >Synopsis: memory leaks in iostream and locale >Confidential: no >Severity: non-critical >Priority: low >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Mon May 06 10:46:02 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Ewgenij Gawrilow >Release: 3.0.4 >Organization: >Environment: n/a >Description: Some static objects created by libstdc++, namely std::cin, std::cout, std::cerr, std::clog, and the classic locale, are not destroyed at the program termination. Since they contain data members, such as strings, callback lists, etc., which hold dynamically allocated storage fragments, they look perfectly like memory leaks. These leaks do not constitute a problem as such; there are, though, two reasons for eliminating them: 1. of systematical nature: why bother to delete filebufs belonging to the streams but let other components out 2. of practical nature: when hunting for real memory leaks in the application using some automated means, be that purify or a self-made drop-in for the STL allocator, these additional leaks really disturb: The allocation requests do not come at predictable moments, so that it's rather difficult to filter them out. >How-To-Repeat: >Fix: For streams, the fix is rather trivial. The attached patch is based on the source code as included in gcc 3.0.4 distribution, but can be easily applied to the actual CVS branches. However, I didn't dare to write a patch for the classic locale, as I saw the substantial changes between the last versions of locale.cc. It seems being substantially reworked right now. I hope, the maintainer finds a few minutes to build in the destructor too. Thank you in advance! >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="gcc-3.0.4-patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="gcc-3.0.4-patch" LS0tIGdjYy0zLjAuNC9saWJzdGRjKystdjMvc3JjL2lvcy5jY34JV2VkIEp1biAgNiAwMzozOTow MSAyMDAxCisrKyBnY2MtMy4wLjQvbGlic3RkYysrLXYzL3NyYy9pb3MuY2MJRnJpIE1heSAgMyAy MDoyMjowNSAyMDAyCkBAIC0xODQsNiArMTg0LDEwIEBACiAgICAgYnVmX2NvdXQufmZpbGVidWYo KTsKICAgICBidWZfY2luLn5maWxlYnVmKCk7CiAgICAgYnVmX2NlcnIufmZpbGVidWYoKTsKKyAg ICBjb3V0Ln5vc3RyZWFtKCk7CisgICAgY2luLn5pc3RyZWFtKCk7CisgICAgY2Vyci5+b3N0cmVh bSgpOworICAgIGNsb2cufm9zdHJlYW0oKTsKICNpZmRlZiBfR0xJQkNQUF9VU0VfV0NIQVJfVAog ICAgIHdjb3V0LmZsdXNoKCk7CiAgICAgd2NlcnIuZmx1c2goKTsKQEAgLTE5MSw2ICsxOTUsMTAg QEAKICAgICBidWZfd2NvdXQufndmaWxlYnVmKCk7CiAgICAgYnVmX3djaW4ufndmaWxlYnVmKCk7 CiAgICAgYnVmX3djZXJyLn53ZmlsZWJ1ZigpOworICAgIHdjb3V0Ln53b3N0cmVhbSgpOworICAg IHdjaW4ufndpc3RyZWFtKCk7CisgICAgd2NlcnIufndvc3RyZWFtKCk7CisgICAgd2Nsb2cufndv c3RyZWFtKCk7CiAjZW5kaWYKICAgfQo=
next reply other threads:[~2002-05-06 17:46 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-05-06 10:46 gawrilow [this message] 2002-05-15 7:42 bkoz 2002-05-17 3:08 bkoz
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=20020506174134.12710.qmail@sources.redhat.com \ --to=gawrilow@math.tu-berlin.de \ --cc=gcc-gnats@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).