Thread: munmap_chunk(): invalid pointer

  1. #1
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    segmentation fault

    munmap_chunk(): invalid pointer

    Looking for some clues as to what this might mean.

    ps. is there a way to turn the backtrace OFF?
    Last edited by MK27; 09-05-2008 at 03:00 PM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Farncombe, Surrey, England
    munmap is where "free" ends up, so munmap_chunk is part of "free" (or delete if you use C++). So my guess would be that you are trying to free something that isn't a valid pointer [or some other allocation overwrote the end of its memory and clobbered the next bit of memory that is the part that describes the memory you are trying to free].

    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    ps. is there a way to turn the backtrace OFF?
    You mean because it takes up so much history in your terminal and you can't see what happened before the backtrace?

    Not that I know of. However, I'd imagine the backtrace is dumped to stderr. So if your program doesn't use stderr, you could redirect it to /dev/null (or the equivalent for your operating system).

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell

    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ:

    My website:
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Ban pointers or references on classes?
    By Elysia in forum C++ Programming
    Replies: 89
    Last Post: 10-30-2007, 03:20 AM
  2. Direct3D problem
    By cboard_member in forum Game Programming
    Replies: 10
    Last Post: 04-09-2006, 03:36 AM
  3. scope of a pointer?
    By Syneris in forum C++ Programming
    Replies: 6
    Last Post: 12-29-2005, 09:40 PM
  4. Question About Pointer To Pointer
    By BlitzPackage in forum C++ Programming
    Replies: 2
    Last Post: 09-19-2005, 10:19 PM
  5. Can an invalid pointer clobber the new operator?
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 09-14-2001, 03:42 AM