Re: [PATCH 1/2] test/raw: add some messages likely to be multiples of buffer size

Subject: Re: [PATCH 1/2] test/raw: add some messages likely to be multiples of buffer size

Date: Sun, 05 May 2019 07:49:16 -0300

To: Tomi Ollila, Rob Browning, notmuch@notmuchmail.org

Cc:

From: David Bremner


Tomi Ollila <tomi.ollila@iki.fi> writes:

> On Sun, May 05 2019, Tomi Ollila wrote:
>
>> On Sat, May 04 2019, David Bremner wrote:
>>
>>>  
>>> +test_python <<EOF
>>> +from email.message import EmailMessage
>>> +for pow in range(12,21):
>>
>> .......................^ space. i.e. (12, 21)
>>
>> from 4KiB to 1MiB. uh, perhaps I should have kept my fingers crossed.
>> (that said, my range would have been 10, 17 (1024 - 65536))
>
> except that...
>
> if fread(3) (and friends) used 1024 byte buffer, for 4096 byte message
> it would read full buffer 4 times (and not yet noticing EOF), and then
> next fread() would return 0 (and now flag EOF)...

I originally started from a 1024 byte message, but it was a bit messy to
mark some sizes as broken and others not. Perhaps that's not a good
reason in retrospect, since the the fact that >= 4096 is broken is
specific to some libc (and kernel?). This means that if
someome has a libc where the buffer size is bigger then 4096, this test
might return non-zero.  My take away from that is that I should probably
squash these two commits into one.

d

_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch

Thread: