leak detected using valgrind

Discussion in 'C++' started by Alexandre, Nov 13, 2003.

  1. Alexandre

    Alexandre Guest

    Hi,
    I'm currently investigating a leak in a c++ program. I've run
    valgrind to detect it and valgrind give me some result like this
    one...


    ==5336== 64064 bytes in 728 blocks are still reachable in loss record
    14 of 16
    ==5336== at 0x40026B30: __builtin_new (vg_replace_malloc.c:172)
    ==5336== by 0x4028C531: AnObject::AnObject(AnObject const &)
    (anobject.cpp:140)
    ==5336== by 0x85310EF: ClassA::ClassA(ClassA const &)
    (/usr/include/g++-3/stl_pair.h:68)
    ==5336== by 0x852F863: ClassB::ClassB(ClassB const &)
    (/usr/include/g++-3/stl_pair.h:68)

    Are those still reachable block a real problem ?? Or do I need to
    look elsewhere...

    Thanks
    Alexandre, Nov 13, 2003
    #1
    1. Advertising

  2. Alexandre wrote:
    > Hi,
    > I'm currently investigating a leak in a c++ program. I've run
    > valgrind to detect it and valgrind give me some result like this
    > one...
    >
    >
    > ==5336== 64064 bytes in 728 blocks are still reachable in loss record
    > 14 of 16
    > ==5336== at 0x40026B30: __builtin_new (vg_replace_malloc.c:172)
    > ==5336== by 0x4028C531: AnObject::AnObject(AnObject const &)
    > (anobject.cpp:140)
    > ==5336== by 0x85310EF: ClassA::ClassA(ClassA const &)
    > (/usr/include/g++-3/stl_pair.h:68)
    > ==5336== by 0x852F863: ClassB::ClassB(ClassB const &)
    > (/usr/include/g++-3/stl_pair.h:68)
    >
    > Are those still reachable block a real problem ?? Or do I need to
    > look elsewhere...


    Which version of GCC are you using ? Does it support GLIBCPP_FORCE_NEW ?

    See this:

    http://groups.google.com/groups?selm=

    and this:

    http://vv.cs.byu.edu/cs586/archive/000186.html

    I just read up that in GCC 3.4 this is now GLIBCXX_FORCE_NEW ...
    Gianni Mariani, Nov 13, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rsina
    Replies:
    2
    Views:
    1,044
    ettipmoez
    Nov 29, 2004
  2. Andreas Andersen

    Problems with valgrind

    Andreas Andersen, Jan 18, 2005, in forum: C++
    Replies:
    2
    Views:
    320
    Gernot Frisch
    Jan 18, 2005
  3. Replies:
    1
    Views:
    458
    Christoph Bartoschek
    Apr 29, 2005
  4. Richard Heathfield

    Leak or no leak ??

    Richard Heathfield, Jul 10, 2006, in forum: C Programming
    Replies:
    4
    Views:
    337
    Richard Heathfield
    Jul 10, 2006
  5. Replies:
    1
    Views:
    347
    Lionel B
    May 29, 2008
Loading...

Share This Page