Find the answer to your Linux question:
Results 1 to 2 of 2
Afternoon all So I'll try to be brief and to the point here: I've got a couple of C / C++ apps that communicate with one another via shared memory. ...
  1. #1
    Just Joined!
    Join Date
    Oct 2009
    Posts
    22

    Shared Memory - Should they show the same address?

    Afternoon all

    So I'll try to be brief and to the point here: I've got a couple of C / C++ apps that communicate with one another via shared memory. These worked completely fine until.. well, about twenty minutes ago when I finished making some network card changes and suddenly, I've got a weird problem going on. At one point, Parent app waits for Child app to set a boolean indicating it's finished initialization. This worked fine the last time I ran this app up (a few days ago). But right now, the shared flag never seems to get triggered (I've added a printf("Waiting...\n"); in Parent app until the flag is set). All the code leading up to it being set in Child app seem to be running smoothly, so I tried spitting out the addresses of the shared memory locations. The addresses mapped by Parent app and Child app are different; this seemed odd, so I went back and wrote a simple miniature app that just opened a shared structure on my own box, and I get the same thing - different addresses - but the miniature apps work just fine.

    Is it normal for a shared memory space to be mapped to two different addresses across two processes?

    If so, does anyone have any idea what might be the issue at hand with my Parent / Child app scenario? The Child creates the shared memory, the Parent has a wait before it opens it, and if it doesn't exist should fail (opening with PROT_READ | PROT_WRITE)... it doesn't fail so it's evidently there.

    All of this worked until literally just a few hours ago and I made some changes to my network cards, and I can't even imagine how that could have changed whether or not shared memory mapping worked...

    Anyone that can even vaguely point me in the right direction may end up being my new hero..

  2. #2
    Just Joined!
    Join Date
    Oct 2009
    Posts
    22
    Falllllllllse alarm. Problem solved and it had nothing to do with shared memory.. or networking.. something was wrong with a specialized card that the app ran with, all is solved now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...