emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: scratch/sigchld-fd 8f0ce42 1/2: Fix deadlock when receiving SIGCHLD


From: Andreas Schwab
Subject: Re: scratch/sigchld-fd 8f0ce42 1/2: Fix deadlock when receiving SIGCHLD during 'pselect'.
Date: Wed, 20 Jan 2021 17:44:59 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.90 (gnu/linux)

On Jan 20 2021, Eli Zaretskii wrote:

>> From: Andreas Schwab <schwab@linux-m68k.org>
>> Cc: emacs-devel@gnu.org,  phst@google.com,  p.stephani2@gmail.com
>> Date: Wed, 20 Jan 2021 16:48:43 +0100
>> 
>> On Jan 20 2021, Eli Zaretskii wrote:
>> 
>> > So maybe this is the problem we should solve: make the SIGCHLD handler
>> > reset the bit of the process's output from the fd_set passed to
>> > pselect.
>> 
>> You cannot do that.  That creates races all over the place.
>
> What kind of races, and where in our code? please elaborate.

The signal can occur anytime.  When it interrupts the setup of the
pselect call, chaos will ensure.  The only way to avoid that is to block
the signal around the call.

Doing anything non-trivial in a signal handler is bound to problems.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]