
My first guess was a memory leak but I didn't spot anything which smells like that over numerous debug sessions. I'm generally dubious about that because I'm using shared_ptr's. Shallow copy can't be the problem either again 'cause I only insert shared_ptr's (from just-allocated dynamic memory) into my container.
It's not a memory leak, but memory corruption: it seems that you try to free some memory block twice.
On the other hand, the problem only occurs upon insertion of a SPECIFIC entry into my container. Strangely enough, if I delete that specific entry manually before the end of my program, everything goes fine! I even checked the count of that specific shared_ptr and it was 1, i.e., I'm not deleting anybody else's memory. I am really confused and left with no clue... Any suggestions?
Maybe you accidentally store a raw pointer to an object managed by shared_ptr. Or maybe your object internally allocates and frees some memory, which is also managed in some other place... I guess it's worth searching calls to "delete" and "free" in your code.