Does this Error mean Memory Leak?

This is a discussion on Does this Error mean Memory Leak? within the C Programming forums, part of the General Programming Boards category; Hi everyone, Just a quick question which I couldn't find through googling. Does *** glibc detected *** ./a.out: malloc(): memory ...

  1. #1
    Registered User
    Join Date
    Oct 2012
    Posts
    71

    Does this Error mean Memory Leak?

    Hi everyone,

    Just a quick question which I couldn't find through googling. Does

    *** glibc detected *** ./a.out: malloc(): memory corruption: 0x00000000010a6360

    mean that memory location is no longer usable and that I have a memory leak??

    Also does running programs in valgrind protect against memory leaks? I refrain from using valgrind because sometimes my program works while using it but doesnt if I just use a normal terminal.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,452
    > *** glibc detected *** ./a.out: malloc(): memory corruption: 0x00000000010a6360
    > mean that memory location is no longer usable and that I have a memory leak??
    No, it means you trashed memory you don't own.

    > Also does running programs in valgrind protect against memory leaks?
    No, valgrind is a diagnostic tool to help you find things like buffer overruns and memory leaks.

    > I refrain from using valgrind because sometimes my program works while using it but doesnt if I just use a normal
    But does valgrind spit out a whole bunch of messages when it's "working" in valgrind, but not working normally?
    If you're seeing valgrind messages, you need to be fixing the code.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. memory leak
    By *nick in forum Windows Programming
    Replies: 8
    Last Post: 09-17-2012, 06:15 PM
  2. Possible memory leak?
    By 127.0.0.1 in forum C Programming
    Replies: 21
    Last Post: 05-02-2011, 04:53 PM
  3. memory leak
    By rahulsk1947 in forum C Programming
    Replies: 2
    Last Post: 11-11-2007, 12:27 PM
  4. Replies: 2
    Last Post: 09-28-2006, 01:06 PM
  5. Linking error with memory leak detection code. HELP!
    By Lister in forum C++ Programming
    Replies: 6
    Last Post: 08-21-2003, 03:54 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21