Re: Missed condition-variable wakeups on FreeBSD - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: Missed condition-variable wakeups on FreeBSD
Date
Msg-id CA+hUKGJdbn0e_eJsfm1-PucUgpFrrKWczDvvw8PjV6UQjOURyg@mail.gmail.com
Whole thread Raw
In response to Missed condition-variable wakeups on FreeBSD  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sun, Feb 27, 2022 at 8:07 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I don't know much about how gdb interacts with kernel calls on
> FreeBSD, but I speculate that the poll(2) call returns with EINTR
> after gdb releases the process, and then things resume fine,

Yeah, at least FreeBSD and macOS interrupt system calls when you send
SIGSTOP + SIGCONT directly, or when gdb and lldb do something similar
via ptrace.  The same applies on Linux, except that Linux restarts the
system call automatically (even though the man page has this in the
list of system calls that never restart) so you don't usually notice
(though you can see it with strace).  It's not really clear to me what
should happen given the language around restarts is all about signal
handlers, and stop + cont are system magic, not signal handlers.
Anyway...

> suggesting that we lost an interrupt somewhere.

So it's happening on an i386 kernel, with WAIT_USE_POLL (not
WAIT_USE_KQUEUE), but only under the build farm script (not when you
ran it manually in loop)....  hmmm.



pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Proposal: Support custom authentication methods using hooks
Next
From: Thomas Munro
Date:
Subject: Re: Checkpointer sync queue fills up / loops around pg_usleep() are bad