From: Andres Freund <andres@anarazel.de>
To: ricardoungureanu@gmail.com
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16827: macOS interrupted syscall leads to a crash
Date: Fri, 15 Jan 2021 13:05:48 -0800
Message-ID: <20210115210548.zfbnulfeanmffmet@alap3.anarazel.de> (raw)
In-Reply-To: <16827-7606aeb21d38c228@postgresql.org>
References: <16827-7606aeb21d38c228@postgresql.org>
Hi,
On 2021-01-15 14:00:03 +0000, PG Bug reporting form wrote:
> I am using macOS 11.0 and trying to import a large dump into postgresql.
> Under some circumstances, it crashes while importing.
> I inspected the logs and found out a system call is interrupted (" LOG:
> could not open file "pg_wal": Interrupted system call"). Apple has added a
> new feature in macOS 11.0 to audit security events. I noticed that the
> kernel, while waiting on a condition variable, if it receives an interrupt,
> will just pass EINTR (error code 4) back to the usermode program. Your
> function XLogFileInit does not treat such cases (just ENOENT is checked) and
> decides to exit with an abort(). I have attached below the crash file
> generated.
Hm. It's fairly nasty to return EINTR from open() (except if open()ing a
FIFO or such) - it should normally only happen when blocked. But I'm not
sure it's *actually* violating any standards / promises made.
> Apple has added a new feature in macOS 11.0 to audit security
> events. I noticed that the kernel, while waiting on a condition
> variable, if it receives an interrupt, will just pass EINTR (error
> code 4) back to the usermode program.
Does that also happen for close()? Because that can't reasonably be
handled by userspace (userspace cannot retry because the fd could now
point to something else in a threaded environment).
Greetings,
Andres Freund
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: andres@anarazel.de, ricardoungureanu@gmail.com
Subject: Re: BUG #16827: macOS interrupted syscall leads to a crash
In-Reply-To: <20210115210548.zfbnulfeanmffmet@alap3.anarazel.de>
References: <16827-7606aeb21d38c228@postgresql.org> <20210115210548.zfbnulfeanmffmet@alap3.anarazel.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox