Subject: Re: 'shmget() failed' errors?
To: Steven M. Bellovin <smb@research.att.com>
From: Frederick Bruckman <fredb@immanent.net>
List: netbsd-users
Date: 08/16/2004 17:57:08
On Mon, 16 Aug 2004, Steven M. Bellovin wrote:

> In message <cfr2pv$qqn$2@colwyn.zhadum.de>, Matthias Scheler writes:
> >In article <20040816033314.D57341AE76@berkshire.research.att.com>,
> >	"Steven M. Bellovin" <smb@research.att.com> writes:
> >> I'm running 2.0 beta (including XFree86 4.4.0), and I sometimes get a
> >> string of error messages like this:
> >>
> >> XFree86-Bigfont extension: shmget() failed, size = 790528, errno = 12
> >[...]
> >> Do I need to change SHMMAXPGS?  I'm using the default value.
> >
> >What screen resolution (width, height and depth) do you use?
>
> I'm using 1400x1050x16, the resolution I've been using for 3 years.
> (This is a Thinkpad T21 with a 1400x1050 screen.)

I suspect you're simply running out of shared memory.

If you run any programs that use shared memory, and are inclined to
exit abnormally, you'll eventually run out, no matter how much you
have. Inspect the output of "ipcs -mop"; any segments with no process
attached are probably crud. (That's a "feature", that segments can
continue to exist unattached, to be attached later, but a feature
that's rarely utilized.)

I run this little shell function from time to time to clean out the
litterbox. (I'm sure there are nicer ways of doing it.)

shm_clean () {
  ipcs -mop | awk '$7 == 0 { print "ipcrm -m " $2; }' | sh || true
}

Frederick