This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

Memory leak in ios.cc:326


While testing libcwd with g++-3.3, I run into a
possible memory leak at ios.cc:326:

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

I can't investigate this futrher, but it seems
that it is possible that this leaks under certain circumstances.

After running a pretty complex, threaded test application
that frees all memory of its own, I still see the following
allocations at the end of the application being left over:

Listing just one thread,

8192       (0000) MALLOC  : Allocated memory by thread 65545: 760 bytes in 20 blocks:
8192       (0000)           0x8e27278               ios.cc:326  <unknown type>; (sz = 16)
8192       (0000)           0x8e25338               memory:183  <unknown type>; (sz = 60)
8192       (0000)           0x8e218d0               ios.cc:326  <unknown type>; (sz = 16)
8192       (0000)           0x8e28808               memory:183  <unknown type>; (sz = 60)
8192       (0000)           0x8e25168               ios.cc:326  <unknown type>; (sz = 16)
8192       (0000)           0x8e1bbc0               memory:183  <unknown type>; (sz = 60)
8192       (0000)           0x8e21bc8               ios.cc:326  <unknown type>; (sz = 16)
8192       (0000)           0x8befd80               memory:183  <unknown type>; (sz = 60)
8192       (0000)           0x8e1b9e8               ios.cc:326  <unknown type>; (sz = 16)
8192       (0000)           0x8e1b948               memory:183  <unknown type>; (sz = 60)
8192       (0000)           0x8e1a560               ios.cc:326  <unknown type>; (sz = 16)
8192       (0000)           0x8e17760               memory:183  <unknown type>; (sz = 60)
8192       (0000)           0x8e18618               ios.cc:326  <unknown type>; (sz = 16)
8192       (0000)           0x8e16350               memory:183  <unknown type>; (sz = 60)
8192       (0000)           0x8e15c10               ios.cc:326  <unknown type>; (sz = 16)
8192       (0000)           0x8e142b8               memory:183  <unknown type>; (sz = 60)
8192       (0000)           0x8c77f00               ios.cc:326  <unknown type>; (sz = 16)
8192       (0000)           0x8c77760               memory:183  <unknown type>; (sz = 60)
8192       (0000)           0x8be34b0               ios.cc:326  <unknown type>; (sz = 16)
8192       (0000)           0x8be3410               memory:183  <unknown type>; (sz = 60)

most threads have 'lists' like this.

The reason I can't investigate this further is
that I can't seem to set breakpoints with gdb
here (or anywhere inside libstdc++ :().

-- 
Carlo Wood <carlo at alinoe dot com>


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