We have a complex program that is working well on heavy duty input (any input actually) with no multithreading implemented.
We've implemented multithreading with a threadpool, and given these input parameters I get these results:
(Note: Where I say no errors, it means I've tested with valgrind -v
and when I say no memory leaks, it means I've tested it with valgrind --leak-check=full -v
).
- small_file: Runs successfully with more than 1 workers (threads), no valgrind errors, no memory leaks
- medium_file: With 1 worker it runs successfully, no errors/memory leaks. With > 1 workers, I get: a. usually heap-corruption error, b. double-free. When running with
valgrind -v
with > 1 workers the program completes successfully. Also, no errors are printed from valgrind, that isERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)
.
Now that I don't get any errors from valgrind to start with, what can I do to find the memory corruption problem in this complex and big application?
DevelopmentEnvironment:
Ubuntu, 64bit, gcc version: 4.7.2 and 4.8.1 (different computers, newer version of Ubuntu).