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: Fri, 10 Nov 2017 17:25:58 +0200

> From: Matthias Dahl <address@hidden>
> Cc: address@hidden
> Date: Fri, 10 Nov 2017 15:45:30 +0100
> 
> Attached you will find the revised patches which now properly
> set the number of bytes read.

Thanks.

> Sorry for the delay, but real life intervened.

I know what you mean...

> Turns out, things were _a lot_ easier than I thought since the
> C standard actually does have well-defined rules for computation
> on unsigned types, so that no overflow happens.

Right, for unsigned types there's no undefined behavior when it
overflows.

> > I had my
> > share of writing code based on what I read in the function commentary
> > and some general common sense and familiarity with the internals, only
> > to find out later that they were incomplete or even prone to wrong
> > interpretation.  I'd like to minimize such occurrences as much as I
> > can.
> 
> I guess I was overly idealistic. Sorry for that.

No need to be sorry.

Interestingly enough, we just had another case of this; if you missed
that, I suggest to read the discussion of bug#27647, starting here:

  https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27647#116

This is a textbook example of how "tricky" code that "reuses" a
variable for a very different purpose can trip even veteran hackers,
and cause bugs that take many moons (first reported in July, fixed in
November) to diagnose and fix -- if we are lucky, as in this case.

> Nevertheless, it would be nice to improve the situation and make sure
> that future changes to the codebase also take the commentaries into
> account... and put those themselves to the same high standard as the
> implementation itself. Just my two cents...

Agreed.  I try to add and update any commentary I find missing or
outdated, and encourage everyone else to do the same.

> I hope we now have something that can be applied to the master
> branch. If anything comes up in terms of bugs or problems that might
> be related, please poke me if I miss it on the list and I will (try
> to) fix it.

Thanks, the patches LGTM.  I will wait for a few days, to give others
time to comment, and if no objections come up, will push then.



reply via email to

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