|
From: | Paul Eggert |
Subject: | Re: wait_reading_process_ouput hangs in certain cases (w/ patches) |
Date: | Tue, 14 Nov 2017 07:24:31 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
On 11/14/2017 06:58 AM, Matthias Dahl wrote:
If during an active call to wait_... all recursive calls happen to read exactly 2**32 (or whatever bit depths EMACS_UINT is) bytes back, then we will miss it completely and stall.
First, this means that the companion idea of subtracting the two counters to yield a byte count is also buggy because the byte count will be wrong for this call. This would be a bug that could happen whenever a successful recursive call occurs, which apparently is quite common. So if we stick with the current approach, we definitely should be dropping the requirement that Eli was thinking of, which says that a positive number returned by wait_reading_process_output indicates the number of bytes read for this call.
Second, I don't leaving a known bug in the code, even if the bug is unlikely. Too often, these extreme cases occur anyway (e.g., due to a network attack). I'd prefer a slightly-more-complicated solution where the bug cannot occur. It can't be that hard to fix.
[Prev in Thread] | Current Thread | [Next in Thread] |