On 12/03/2013 02:18 PM, Stas Sergeev wrote:OK, sorry, after a year of rot of my patch in bugzilla, I've03.12.2013 21:00, Peter Hurley ÐÐÑÐÑ:Any unit test is specifically designed to break the code under test.How is this different from the unpatched kernel?
This unit test does in fact break a possible input: note specifically
that the writer is not changing the termios so has no control over
the timing of when the input is received.
Also note that the test is a simulation; the patch will break any
input stream under the following conditions:
1. The writer writes an EOF-terminated buffer
2. All the input is received _except_ the EOF; this is strictly
timing-related and not controllable.
3. The reader changes the termios from non-canon -> canon.
At that point the damage is done; the read_flags will indicate
2 EOFs and the 2nd EOF will be interpreted as end-of-file because
it will appear to begin on a new line.
In the unpatched kernel, if you happen on reader side
to enable icanon while n_tty received all but VEOF (is this possible at all?),
then the buffer will be flushed, and the remaining VEOF
will get you a nice EOF.
So, in the unpatched kernel you get EOF because the buffer
gets wiped.
???
Testcase output from 3.12 w/o patch:
Consider the total brute-force approach; a shadow read_flags thatWhat is to do with them?
distinguishes a real EOF receive from the fake EOF push initiated
by the patch.
That would work, but I'm looking for a solution moreI think "fake" EOFs do not need the entire bitmap.
space-efficient and simpler than a duplicate 256-byte buffer