[comp.unix.ultrix] Weird Stuff with Shared Memory

doug@wiley.uucp (Doug Rudoff) (06/16/90)

I am having a very hard time with a program that uses shared memory.
Basically, when I try to copy something out of shared memory, all I
get are zeroes. By copy I mean using either an assignment (like
x=ptr->except), a memcpy(), and even evaluations like
"if (!ptr->exception)". If I run the program in a debugger (I've used dbx
and gdb with the same result) and looked at the shared memory, all the
right data is there. But all the copies, assignments and evaluations
act as if there's only zero's in the memory. EXCEPT (this is the weird
part) when I step through the program one line at a time, all the data
from shared memory is copied properly! (When the program is run
without the debugger it doesn't work).

The other process using the shared memory uses it with no problem.

I've tried various kludges to get around this, assigning other
pointers into shared memory, and writing the portion of shared memory
I'm interested in into a file. All I get are zeroes.

Does anyone have any ideas about what is going on here?

(I'm using a DECstation 3100 with Ultrix 3.1)


Doug Rudoff

Mobile Data International   Bothell, WA
(206) 487-5937

rudoff@mdi.com
uunet!mdisea!rudoff
(Note that this is not the machine I post from)