From: Randall Becker Date: Sat, 21 Dec 2024 15:05:44 GMT Subject: RE: [PATCH 0/4] reftable: fix out-of-memory errors on NonStop Message-ID: In-Reply-To: <20241221-b4-pks-reftable-oom-fix-without-readers-v1-0-12db83a3267c@pks.im> On December 21, 2024 6:50 AM, Patrick Steinhardt wrote: >this small patch series fixes out-of-memory errors on NonStop with the reftable >backend. These errors are caused by zero-sized allocations, which return `NULL` >pointers on NonStop. > >Thanks! > >Patrick > >--- >Patrick Steinhardt (4): > reftable/stack: don't perform auto-compaction with less than two tables > reftable/merged: fix zero-sized allocation when there are no readers > reftable/stack: fix zero-sized allocation when there are no readers > reftable/basics: return NULL on zero-sized allocations > > reftable/basics.c | 7 +++++++ > reftable/merged.c | 12 +++++++----- > reftable/stack.c | 47 ++++++++++++++++++++++++++--------------------- > 3 files changed, 40 insertions(+), 26 deletions(-) > > >--- >base-commit: ff795a5c5ed2e2d07c688c217a615d89e3f5733b >change-id: 20241220-b4-pks-reftable-oom-fix-without-readers-c7d8fda0694d From the malloc man page: "If size is 0, then malloc() returns either NULL, or a unique pointer value that can later be successfully passed to free()." Thank you for this series. I think the problem may not be limited only to NonStop based on the documented ambiguous behaviour of malloc. --Randall