Re: [PATCH] test: add known_broken test for dumping large stored queries

Subject: Re: [PATCH] test: add known_broken test for dumping large stored queries

Date: Sun, 12 Apr 2020 17:39:16 -0300

To: notmuch@notmuchmail.org

Cc:

From: David Bremner


David Bremner <david@tethera.net> writes:

> 'qsx' reported a bug on #notmuch with notmuch-dump and large stored
> queries. This test will pass (on my machine) if the value of `repeat'
> is made smaller.

I believe the underlying problem is explained by this comment in zlib.h

   The number of uncompressed bytes written is limited to 8191, or
   one less than the buffer size given to gzbuffer().  The caller should assure
   that this limit is not exceeded.  If it is exceeded, then gzprintf() will
   return an error (0) with nothing written.

So calling gzbuffer can increase this limit, but you still have to guess
before writing for the first time.

One way of interpreting this is that we should avoid using gzprintf
where we cannot predict the output size.

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

Thread: