From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,43d4870b050a4edd,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1993-08-19 18:42:50 PST Path: gmd.de!newsserver.jvnc.net!howland.reston.ans.net!wupost!cs.utexas.edu!uunet!decwrl!pa.dec.com!decwrl.dec.com!joel From: joel@decwrl.dec.com (Joel McCormack) Newsgroups: comp.unix.osf.osf1 Subject: Re: Shared Memory remains when using local:0 for X under DEC OSF/1 Date: 20 Aug 1993 01:37:22 GMT Organization: DEC Western Research Laboratory Sender: joel@pandora.pa.dec.com (Joel McCormack) Distribution: world Message-ID: <2519si$dsj@usenet.pa.dec.com> Reply-To: joel@decwrl.dec.com NNTP-Posting-Host: pandora.pa.dec.com The old MIPS local:0 shared memory code did not leave segments lying around. The OSF code does. Upon further investigation, Sam Hsu discovered the following code in the shared memory transport: sds.shm_perm.mode = 0; /* for security */ shmctl(chan->smid, IPC_SET, &sds); /* I don't understand what this is doing * shmctl(chan->smid, IPC_RMID, 0); */ The commented-out code wasn't commented out on Ultrix, and ``removed'' the shared memory segment. But like files that have been removed, the shared memory doesn't really go away until all references go away. With this code commented out, it segment stays, because the shared memory semantics say that you have to leave the segment lying around, just in case some program might want to link to it later. We hope that reuncommenting the code (and putting in an explanatory comment above it, so that this problem never reoccurs) will fix the problem on OSF, and we'll try to contact the appropriate release people to get this fix out as soon as possible. In the meantime, here's a quick and dirty script that will get rid of a lot of your defunct shared memory segments: set a="" foreach n (`ipcs -m | sed '1,/MODE/d' | awk '{ print $2 }'`) set a="$a -m $n" end if ( "$a" != "" ) then ipcrm $a endif -- - Joel McCormack (decwrl!joel, joel@decwrl.dec.com)