Re <https://bugs.gnu.org/29297> dated 2017-11-14:
> the grep command with wrong write error, and the return value was 2. May I > ask where the problem is? And this is a probabilistic problem Grep reports 'write error' if the 'write' system call fails. If 'grep' was incorrect, it's because the 'write' system call was incorrect. So, as near as I can see this is not a 'grep' bug and I am closing the bug report.