This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libstdc++/10276: memory leak for stringstream / ios_base callback cache.


>Number:         10276
>Category:       libstdc++
>Synopsis:       memory leak for stringstream / ios_base callback cache.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 31 12:46:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Carlo Wood
>Release:        3.3 branch
>Organization:
>Environment:
i686-gnu-linux
>Description:
The following code snippet leaks memory:

  for (int i = 0; i < 1000; ++i)
  {
    std::ostringstream s;
  }

this results in 1000 undeleted allocations that made
with 'new' in respectively ios.cc and basic_ios.tcc
at:

ios.cc:

  void
  ios_base::register_callback(event_callback __fn, int __index)
  { _M_callbacks = new _Callback_list(__fn, __index, _M_callbacks); }

and

bits/basic_ios.tcc:

      if (!pword(0)) {
        pword(0) = auto_ptr<__cache_t>(new __cache_t()).release();
        register_callback(__cache_t::_S_callback, 0);
      }


Can someone please make this high priority?
Its a regression and I really think that it
MUST be fixed before 3.3 is released.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]