c - Having hard time tracking memory corruption - when running with Valgrind runs correctly with no errors -


we have complex program working on heavy duty input (any input actually) no multithreading implemented.
we've implemented multithreading threadpool, , given these input parameters these results:
(note: no errors, means i've tested valgrind -v , when no memory leaks, means i've tested valgrind --leak-check=full -v).

  1. small_file: runs more 1 workers (threads), no valgrind errors, no memory leaks
  2. medium_file: 1 worker runs successfully, no errors/memory leaks. > 1 workers, get: a. heap-corruption error, b. double-free. when running valgrind -v > 1 workers program completes successfully. also, no errors printed valgrind, error summary: 0 errors 0 contexts (suppressed: 2 2).

now don't errors valgrind start with, can find memory corruption problem in complex , big application?

developmentenvironment:
ubuntu, 64bit, gcc version: 4.7.2 , 4.8.1 (different computers, newer version of ubuntu).

with > 1 workers, get: a. heap-corruption error, b.double-free. when running valgrind -v > 1 workers program completes successfully

based on above symptoms, looks me there sort of synchronization problem happening in program. looks program sharing heap memory address between threads , hence whenever there data race facing problem.

you have mentioned when running valgrind -v, program completing successfully. indicates program has synchronization problem , dependant on sequence/timing. these 1 of difficult bug find out.we should remember dynamic tools not give warning until program goes , execute wrong. mean there problem in program, sequence of execution(as there timing related problem) determined whether tools capture failure or not.

having said that, think there not sort cut way find such bugs in big programs.however suspect there data racing scenario leading memory corruption/double free. may want use helgrind check/find data racing/threading problem might leading memory corruption.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -