test_compression, test module for low-level compression APIs (for 2b5ba2a0a141)
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Cc: Andrew Dunstan <andrew@dunslane.net>
Date: 2026-04-13T00:37:55Z
Lists: pgsql-hackers
Attachments
- 0001-test_compression-Test-module-for-compression-methods.patch (text/plain) patch 0001
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
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add tests for low-level PGLZ [de]compression routines
- e138b78cdc96 14.23 landed
- 6b59bd710be1 15.18 landed
- caee654e05e8 16.14 landed
- c78947badc70 17.10 landed
- 42473d90098d 18.4 landed
- 67d318e70402 19 (unreleased) landed
-
Fix heap-buffer-overflow in pglz_decompress() on corrupt input.
- 2b5ba2a0a141 19 (unreleased) cited