From: | tgl(at)postgresql(dot)org (Tom Lane) |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Add code to InternalIpcMemoryCreate() to handle the case where |
Date: | 2010-05-01 22:47:00 |
Message-ID: | 20100501224700.A7D4D7541D2@cvs.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Log Message:
-----------
Add code to InternalIpcMemoryCreate() to handle the case where shmget()
returns EINVAL for an existing shared memory segment. Although it's not
terribly sensible, that behavior does meet the POSIX spec because EINVAL
is the appropriate error code when the existing segment is smaller than the
requested size, and the spec explicitly disclaims any particular ordering of
error checks. Moreover, it does in fact happen on OS X and probably other
BSD-derived kernels. (We were able to talk NetBSD into changing their code,
but purging that behavior from the wild completely seems unlikely to happen.)
We need to distinguish collision with a pre-existing segment from invalid size
request in order to behave sensibly, so it's worth some extra code here to get
it right. Per report from Gavin Kistner and subsequent investigation.
Back-patch to all supported versions, since any of them could get used
with a kernel having the debatable behavior.
Tags:
----
REL8_1_STABLE
Modified Files:
--------------
pgsql/src/backend/port:
sysv_shmem.c (r1.44.2.1 -> r1.44.2.2)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/port/sysv_shmem.c?r1=1.44.2.1&r2=1.44.2.2)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2010-05-01 22:47:08 | pgsql: Add code to InternalIpcMemoryCreate() to handle the case where |
Previous Message | Tom Lane | 2010-05-01 22:46:53 | pgsql: Add code to InternalIpcMemoryCreate() to handle the case where |