From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Gavin Panella <gavinpanella(at)gmail(dot)com> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: `pg_ctl init` crashes when run concurrently; semget(2) suspected |
Date: | 2025-08-10 21:54:03 |
Message-ID: | 2685565.1754862843@sss.pgh.pa.us |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
I wrote:
> This is from current macOS, but equivalent text appears on Linux and
> in the POSIX spec. So it's just luck that nobody has reported the
> same problem elsewhere --- unless maybe there is some macOS-specific
> behavior making it more likely that different installs would try the
> same key.
Hmm, no, there is a platform dependency here. I made the attached
test program to see what happens when there's a key collision,
and on Linux I get
semget(SEMAS_PER_SET) failed: File exists
semget(SEMAS_PER_SET + 1) failed: File exists
but macOS and NetBSD give
semget(SEMAS_PER_SET) failed: File exists
semget(SEMAS_PER_SET + 1) failed: Invalid argument
I didn't try other BSDen; this might be a NetBSD-ism that Apple
inherited, or maybe it's common among the BSDen. I don't see any
text in POSIX specifying which errno is to be returned in this case,
so we can't really argue that the behavior is wrong.
regards, tom lane
Attachment | Content-Type | Size |
---|---|---|
sematest.c | text/x-c | 1.7 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2025-08-10 22:56:00 | Re: `pg_ctl init` crashes when run concurrently; semget(2) suspected |
Previous Message | Tom Lane | 2025-08-10 21:23:00 | Re: `pg_ctl init` crashes when run concurrently; semget(2) suspected |