1

I just found a difficult bug in my program. The program was freely writing outside the bound of an array on the shared memory segment with no notice.

I am currently using Valgrind to check for memory leaks and memory corruption on dynamic memory and AddressSanitizer for memory corruption on stack memory.

But those tools are not finding memory corruptions on inter-process shared memory. Is there a good tool for this purpose ?

I think a tool which is performing code instrumentation like AddressSanitizer can detect at least out of bounds accesses. But AddressSanitizer is not doing this compile time instrumentation on shared memory. So I am looking for a tool able to operate on shared memory. Is there any ?

Note :

  • I am not searching for a way to detect problems with concurrent accesses, just at least out of bounds accesses when only one process is writing.

  • I am programing in C++ and I have control over the compilation process of the executable that is creating the SHM segment and the executables that are reading and writing on it.

Thanks

  • shared, as in, inter-process shared? ... Anyway, I would look for Mocking solutions to wrap accesses to the shared memory. – einpoklum - reinstate Monica Aug 15 '17 at 21:29
  • Yes inter-process shared. If there is an existing tool for this purpose I would use it, but I am not ready to create it ! – infiniteLoop Aug 16 '17 at 5:34
  • Don't answer in the comment, edit the question itself to clarify it... and - sorry, I've never looked for anything like that so I can't help. – einpoklum - reinstate Monica Aug 16 '17 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.