emacs-devel
[Top][All Lists]
Advanced

[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: Sun, 19 Nov 2017 17:42:50 +0200

> Cc: address@hidden
> From: Paul Eggert <address@hidden>
> Date: Sat, 18 Nov 2017 23:07:37 -0800
> 
> * Fix the bug with carryover that I mentioned in 
> <https://lists.gnu.org/r/emacs-devel/2017-11/msg00283.html>.

Not sure what bug is that, and how would you propose to fix it.

> * Document in the Elisp manual that filters and timers are supposed to do 
> "proper management and synchronization", and be clear about how this 
> constrains 
> filters and timers. (This is probably the hardest part of the fix....)

I will handle this part.

> * Change the type of infd_num_bytes_read from EMACS_UINT to uintmax_t. This 
> will 
> provide an extra margin of safety on some platforms. infd_num_bytes_read has 
> nothing to do with Emacs integers, and wider counts are safer.
> 
> * Document in its comment that infd_num_bytes_read is actually the count 
> modulo 
> UINTMAX_MAX + 1.
> 
> * When assigning to got_some_output, ceiling it at INT_MAX to avoid overflow 
> problems. Something like the following, say:
> 
>     got_some_output = min (INT_MAX, (wait_proc->infd_num_bytes_read
>                                      - initial_wait_proc_num_bytes_read));

If we are using uintmax_t, why limit this by INT_MAX?  Overflow of
unsigned values should never be a problem, AFAIK.



reply via email to

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