*** glibc detected *** munmap_chunk(): invalid pointer:

This is a wiki page. Be bold and improve it!

If you have any questions about the content on this page, don't hesitate to open a new ticket and we'll do our best to assist you.

At run time:

*** glibc detected ***  munmap_chunk(): invalid pointer.

together with a backtrace and a memory map.

Reason:


char* pwd = getenv("PWD");
// ...
delete pwd;

You can use delete only on pointers created with the 'new' keyword.