Skip to content

S12.23: PassthroughBuffer error path completeness #444

Description

@DavidCozens

Parent epic: #31

Scope

Pin the residual error path on SolidSyslogPassthroughBuffer left over from S12.07's audit of IGNORE_TEST placeholders. PMQB's equivalent block was deleted in #443 once every referent was either pinned by a real test or explicitly ruled out of scope; the PassthroughBuffer block at Tests/SolidSyslogPassthroughBufferTest.cpp:102 is the smaller sibling — same shape, no syscalls.

In scope — production

  • _Create(NULL sender) → release the acquired pool slot, return the shared SolidSyslogNullBuffer fallback, emit a new POSIXMESSAGEQUEUEBUFFER_ERROR_NULL_SENDER-equivalent error code (PASSTHROUGHBUFFER_ERROR_NULL_SENDER). Currently the NULL sender is stored unchecked and the first subsequent Write dispatches SolidSyslogSender_Send(NULL, ...) → crash.

In scope — tests only (production already safe)

  • Destroy(NULL) — routes via PassthroughBuffer_IndexFromHandlePOOL_SIZEIndexIsValid=falseUNKNOWN_DESTROY warning by the same fallthrough that PMQB exercises. Pin it with a literal NULL test.
  • Use-after-Destroy via NullBuffer vtable patch — already pinned by UseAfterDestroyIsCrashSafeViaNullBufferVtable. Just delete the IGNORE_TEST placeholder once the slot-release/NULL-sender slice lands.

Out of scope (deliberate)

  • Write(NULL buffer, ...) — routes through SolidSyslogBuffer_Write in Core/Source/SolidSyslogBuffer.c, which intentionally doesn't guard. Buffer-NULL is a SolidSyslog_Log-entry concern (already on E12's "Outstanding — NULL guards on public entry points" list), not a PassthroughBuffer concern.

Error code growth

PASSTHROUGHBUFFER_ERROR_POOL_EXHAUSTED      (existing)
PASSTHROUGHBUFFER_ERROR_UNKNOWN_DESTROY     (existing)
PASSTHROUGHBUFFER_ERROR_NULL_SENDER         (new)
PASSTHROUGHBUFFER_ERROR_MAX

Plus a message string in Core/Source/SolidSyslogPassthroughBufferMessages.c.

Slice walk

  1. NULL-sender + slot release. Test: _Create(NULL) returns a fallback handle distinct from any pool slot, NULL_SENDER ERROR emitted, slot released (next _Create reuses it). Production: guard at _Create entry, free the slot if Initialise was already entered, return SolidSyslogNullBuffer_Get().
  2. Destroy(NULL) pin. Test only — production already safe by fallthrough.
  3. Delete IGNORE_TEST(SolidSyslogPassthroughBuffer, HappyPathOnly) at Tests/SolidSyslogPassthroughBufferTest.cpp:102. All referents pinned or explicitly out of scope.

Reference

Spawned by S12.07 (#118) — PR #443's audit identified the last IGNORE_TEST in the codebase. The two stories' patterns mirror each other; the PMQB experience suggests this is roughly half-day-ish work given there are no syscalls and no fake to build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    storyStory issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions