[Top][All Lists]

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

Re: wait_reading_process_ouput hangs in certain cases (w/ patches)

From: Eli Zaretskii
Subject: Re: wait_reading_process_ouput hangs in certain cases (w/ patches)
Date: Wed, 25 Oct 2017 17:53:41 +0300

> From: Matthias Dahl <address@hidden>
> Date: Tue, 24 Oct 2017 20:52:20 +0200
> recursively calling accept-process-output with the first call waiting
> for the output of a specific process, can hang Emacs (as-in: it is
> waiting forever but can be canceled of course) even though it should
> not be the case since data was read.
> This is actually not all that uncommon. One example of this is a hang
> seen with Magit opening its COMMIT_MSG buffer, reported here [1]. I've
> myself run into this problem continuously which is why I started to
> debug it in the first place.
> The hang with Magit happens in flyspell.el which waits for output from
> its spellchecker process through accept-process-output and specifies
> that specific process as wait_proc. Now depending on timing (race),
> wait_reading_process_output can call the pending timers... which in
> turn can call accept-process-output again. This almost always leads
> to the spellchecker output being read back in full, so there is no
> more data left to be read. Thus the original accept-process-output,
> which called wait_reading_process_output, will wait for the data to
> become available forever since it has no way to know that those have
> already been read.

I'm not sure I understand the situation where this happens; can you
elaborate?  Are you saying that a Lisp program calls
accept-process-output and waits for a specific process to produce some
output, and meanwhile some timer runs a function that calls
accept-process-output with its 1st argument nil?  What timers do that?
I think this would be a bug in such timers.

Or are you saying that a Lisp program calls accept-process-output with
its 1st arg nil, and while it waits, a timer calls
accept-process-output for a specific process?

Or do you mean something else?


reply via email to

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