Re: `pg_ctl init` crashes when run concurrently; semget(2) suspected - Mailing list pgsql-hackers

From Tom Lane
Subject Re: `pg_ctl init` crashes when run concurrently; semget(2) suspected
Date
Msg-id 3590952.1755029942@sss.pgh.pa.us
Whole thread Raw
In response to Re: `pg_ctl init` crashes when run concurrently; semget(2) suspected  (Thomas Munro <thomas.munro@gmail.com>)
Responses Re: `pg_ctl init` crashes when run concurrently; semget(2) suspected
List pgsql-hackers
Thomas Munro <thomas.munro@gmail.com> writes:
> On Mon, Aug 11, 2025 at 10:56 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> A bit more research later: OpenBSD behaves like NetBSD, while
>> FreeBSD behaves like Linux.  So that's pretty inconclusive about
>> what the aboriginal behavior was.  I also found that OpenIndiana
>> behaves like Linux.

> Out of curiosity, FreeBSD changed that in 2016:
> https://github.com/freebsd/freebsd-src/commit/f00fb5457ebf5907055e420d803ac67fb098109e

Hah, so that lends weight to the theory that this is an ancient
Berkeley mistake.  I wonder how hard it would be to convince
POSIX that they should be more specific about which errno is
expected here.

In the meantime, though, we'll have to deal with the existing
behavior for years to come.  So I'll go ahead with that patch.
I like having a loop limit there anyway --- I was never exactly
convinced that retrying indefinitely was a good idea.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: `pg_ctl init` crashes when run concurrently; semget(2) suspected
Next
From: Jacob Champion
Date:
Subject: Re: Annoying warning in SerializeClientConnectionInfo