Re: `pg_ctl init` crashes when run concurrently; semget(2) suspected

From: "Burd, Greg" <greg(at)burd(dot)me>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Gavin Panella <gavinpanella(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: `pg_ctl init` crashes when run concurrently; semget(2) suspected
Date: 2025-08-15 17:12:58
Message-ID: D9F48182-834A-4FAC-A41A-98A14DE23C9A@burd.me
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> On Aug 12, 2025, at 4:07 PM, Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:
>
> On Mon, Aug 11, 2025 at 10:56 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

I believe that this is the code in macOS's "XNU" [1][2] which has similar
logic (unsurprisingly) to the FreeBSD code before the identified commit [3].

best.

-greg

[1] https://github.com/apple-oss-distributions/xnu/blob/e3723e1f17661b24996789d8afc084c0c3303b26/bsd/kern/sysv_sem.c#L860-L889
[2] "XNU is a hybrid kernel combining the Mach kernel developed at Carnegie Mellon University with components from FreeBSD and a C++ API for writing drivers called IOKit."
[3] https://github.com/freebsd/freebsd-src/commit/f00fb5457ebf5907055e420d803ac67fb098109e

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2025-08-15 17:21:01 Re: Making jsonb_agg() faster
Previous Message Andres Freund 2025-08-15 17:09:24 Re: index prefetching