Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: SEMVMX problem with postgresql



On Sun, Mar 08, 2009 at 04:57:12PM +0000, Mindaugas Rasiukevicius wrote:
> Patrick Welche <prlw1%cam.ac.uk@localhost> wrote:
> > I saw an unresolved posting about this on port-xen:
> > 
> >  FATAL:  semctl(65538, 16, SETVAL, 536) failed: Result too large or too
> > small HINT:  You possibly need to raise your kernel's SEMVMX value to be at
> > least 536.  Look into the PostgreSQL documentation for details.
> 
> By the way, why semid argument of this semctl() is so high? Perhaps it would
> be worth ktrace to be sure what is exactly passed. Also, what ipcs(1) shows?
> 
> A while ago (well, 10 months ago), this validation check was added, see rev
> 1.83 of sysv_sem.c source. From the quick glance, it looks OK to me, however.

The working postgres 8.4devel installation has

Shared Memory:
T        ID     KEY        MODE       OWNER    GROUP  CREATOR   CGROUP NATTCH   
SEGSZ  CPID  LPID    ATIME    DTIME    CTIME
m    131073    5432001 --rw------- postgres postgres postgres postgres      4 
35864576   773   773 16:15:43 16:15:43 16:15:43

Semaphores:
T        ID     KEY        MODE       OWNER    GROUP  CREATOR   CGROUP NSEMS    
OTIME    CTIME
s     65536    5432001 --rw------- postgres postgres postgres postgres    17 
16:15:43 16:15:43
s     65537    5432002 --rw------- postgres postgres postgres postgres    17 
16:15:43 16:15:43
s     65538    5432003 --rw------- postgres postgres postgres postgres    17 
16:15:43 16:15:43

So, it seems to pick high IDs too.

Hmm...

  1254      1 postgres CALL  semget(0x52e2c1,0x11,0x780)
  1254      1 postgres RET   semget 196608/0x30000
  1254      1 postgres CALL  ____semctl50(0x30000,0x10,8,0xbfbfdff4)
  1254      1 postgres RET   ____semctl50 -1 errno 34 Result too large or too 
small

and this is left behind:

T        ID     KEY        MODE       OWNER    GROUP  CREATOR   CGROUP NSEMS    
OTIME    CTIME
s    196608    5432001 --rw------- postgres postgres postgres postgres    17 
no-entry 16:21:57

(0x52e2c1 = 5432001, 0x30000 = 196608)

On the working one:

 10858      1 postgres CALL  semget(0x52e2c1,0x11,0x780)
 10858      1 postgres RET   semget 131072/0x20000
 10858      1 postgres CALL  ____semctl50(0x20000,0x10,8,0xbfbfe34c)
 10858      1 postgres RET   ____semctl50 0
 10858      1 postgres CALL  semop(0x20000,0xbfbfe36a,1)
 10858      1 postgres RET   semop 0
 10858      1 postgres CALL  ____semctl50(0x20000,0,8,0xbfbfe34c)
 10858      1 postgres RET   ____semctl50 0
...

Not much to choose from. Now to read sys/kern/sysv_sem.c ...

Cheers,

Patrick


Home | Main Index | Thread Index | Old Index