Recently, I've been seeing a wide variety of memory-related crashes at work (C++ applications on Ubuntu 14.04). Our applications use a properietary third party library to interface with real time data and are heavily multi-threaded. The errors spat out by glibc have been "double free or corruption" and "detected corrupted double-linked list" under various circumstances. The cores recovered from these show crashes occurring both in the third party code (more frequently) and in our own code (less frequently). The unifying characteristic is that every crash corresponds with a new/malloc or a delete/free.
Unfortunately, there is very little room for a debugger in this environment. The applications are highly speed sensitive and the input data and operating circumstances can only be approximated when seeking to reproduce a crash because everything in the environment is real time.
That being said, my question is this: what utilities exist that might illuminate exactly which parts of what process are touching memory they shouldn't be? Since crashes can't be reproduced reliably, my only option procedurally is to capture data and then examine it after a crash has occurred. To that end, I found OProfile and Sysprof, but I'm not sure if either are appropriate tools for the task.
I apologize for the vagueness of the question and am grateful in advance for any guidance on this issue.
valgrindfor a while.valgrindfor this; I'll do my due Googling, but do you have a favored reference for this type of query?