kern/77353: [patch] grow SysV IPC kernel limits

Gunther Schadow gunther at
Sat Oct 11 16:00:11 UTC 2008

The following reply was made to PR kern/77353; it has been noted by GNATS.

From: Gunther Schadow <gunther at>
To: bug-followup at, rmh at
Subject: Re: kern/77353: [patch] grow SysV IPC kernel limits
Date: Sat, 11 Oct 2008 11:43:45 -0400

 I have tried the patch on uname = 7.0-RELEASE-p5.
 It allows me to start PostgreSQL with 16 GB shared_buffer on a 32 GB system.
 There is no longer an error nor a segmentation violation.
 However, I cannot get ipcs to work it fails with this error when tryting
 to generate the shm list:
      ipcs: sysctlbyname: kern.ipc.shmsegs: Cannot allocate memory
 yet, I can still do:
      sysctl -a kern.ipc.shmsegs
 it just never shows anything (but neither does so in unpatched 6.2 or 
 7.0 release, so I assume that's normal). Had no time to check, but 
 would think that perhaps sysctlbyname also needs to be recompiled and
 for that one would have to redo all of libc.
 On the good side, PostgreSQL does not seem to rely on this ipcs type
 listing feature.
 Here is an easy program that tests the shm allocation *and* use:
 #include <machine/param.h>
 #include <sys/types.h>
 #include <sys/ipc.h>
 #include <sys/shm.h>
 #include <stdio.h>
 #include <stdlib.h>
 int main(int argc, char *argv[]) {
      size_t size = strtoul(argv[1],NULL,10);
      key_t key = atol(argv[2]);
      int shm;
      char *mem;
      int i;
      printf("Start: %lu, %lu\n", size, key);
      shm = shmget(key, size, IPC_CREAT|SHM_R|SHM_W);
      printf("Result: %d\n", shm);
      mem = shmat(shm, 0, 0);
      printf("Attached: %p\n", mem);
      for(i=0; i<size; i++)
         mem[i] = 0;
      shmctl(shm, IPC_RMID, NULL);
      return 0;

More information about the freebsd-bugs mailing list