0

In our code base memory is allocated for one object in one process then it is passed to another process, other process is supposed to free the memory of that object. valgrind we are only able to attach one process at a time so it is showing as memory leak

Edit1: Other process is not forked process, both are started independently .

Edit2: both processes are able to access one common address space .

  • `--trace-children` option ? – BartekPL Nov 28 '18 at 07:02
  • Possible duplicate of [How do I tell valgrind to memcheck forked processes?](https://stackoverflow.com/questions/301576/how-do-i-tell-valgrind-to-memcheck-forked-processes) – BartekPL Nov 28 '18 at 07:02
  • "other process is supposed to free the memory of that object." It cannot. The two processes have totally separate address spaces. – n. m. could be an AI Nov 28 '18 at 07:06
  • @n.m First process is creating memory in space which other process can also access. – itsOkToAskStupidQus Nov 28 '18 at 07:18
  • If you allocate objects in shared memory, Valgrind will not be able to trace your allocations the way it traces malloc. It is really hard to tell what exactly you are doing. You may want to show some code. Show at least how you allocate and free objects, and what you do to share tgem between processes. – n. m. could be an AI Nov 28 '18 at 07:26

0 Answers0