test_compression, test module for low-level compression APIs (for 2b5ba2a0a141) - Mailing list pgsql-hackers

From Michael Paquier
Subject test_compression, test module for low-level compression APIs (for 2b5ba2a0a141)
Date
Msg-id adw647wuGjh1oU6p@paquier.xyz
Whole thread Raw
Responses Re: test_compression, test module for low-level compression APIs (for 2b5ba2a0a141)
List pgsql-hackers
Hi all,
(Andrew in CC.)

While reading Andrew's commit 2b5ba2a0a141, I was a bit sad to not see
tests for these problems with pglz, applied with the fix down to v14.
Relying on fuzzing is not really cool, because these consume resources
and they may not even hit the correct target, and we want a maximum of
deterministic tests.

And then, I got reminded that one of my pet plugins does something
close to that (used that around 9.5 for some FPW compression
benchmarks):
https://github.com/michaelpq/pg_plugins/tree/main/compress_test

With this infrastructure already at hand, implementing the
problematic tests with corrupted varlenas was a matter of minutes,
leading me to the attached patch (bonus points for check_comprete and
rawsize).

I would like to apply that down to v14, like the previous commit that
has fixed these cases with pglz.  That should come in handy in case
more bugs pop in this area of the code, especially with more
compression methods in mind.

Any objections and/or comments about that?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: Small and unlikely overflow hazard in bms_next_member()
Next
From: Michael Paquier
Date:
Subject: Re: [PATCH] Reduce pg_class scans in GRANT/REVOKE ON ALL TABLES IN SCHEMA