Description
When persisting an envelope to disk, the SDK treats the write as successful as long as any bytes were written, rather than verifying the full envelope was written. If a write fails partway (for example, the disk is full / ENOSPC), the per-item write results are not checked, so a truncated envelope is left on disk and reported as a successful write — no error is returned and nothing is logged.
The resulting envelope is malformed (e.g. a blank/missing header line and a truncated minidump attachment) and is later rejected by ingest. Because the failure is swallowed, there is no signal pointing at the real cause (the failed write).
The affected logic is in envelope_write_to_path in src/sentry_envelope.c, which determines success from the total byte count written rather than from whether each write completed. The underlying file-write helpers also do not log when a write fails or is truncated.
This is platform-independent (the serializer is shared code), though it was observed on a Windows-family target.
When does the problem happen
Environment
- OS: Windows-family target (platform-independent code path)
- Compiler: MSVC
- CMake version and config:
SENTRY_BACKEND=breakpad
Steps To Reproduce
- Configure the SDK to persist crash envelopes to disk.
- Induce a write failure while an envelope is being written (e.g. fill the target volume so writes fail with
ENOSPC).
- Observe that a truncated/invalid envelope is written to disk, the write is reported as successful, and no error or warning is logged.
Log output
No error or warning is emitted on the partial-write path; the write is reported as successful. (A specific customer case, including the captured malformed envelope, is tracked in the attached Linear ticket.)
Description
When persisting an envelope to disk, the SDK treats the write as successful as long as any bytes were written, rather than verifying the full envelope was written. If a write fails partway (for example, the disk is full /
ENOSPC), the per-item write results are not checked, so a truncated envelope is left on disk and reported as a successful write — no error is returned and nothing is logged.The resulting envelope is malformed (e.g. a blank/missing header line and a truncated minidump attachment) and is later rejected by ingest. Because the failure is swallowed, there is no signal pointing at the real cause (the failed write).
The affected logic is in
envelope_write_to_pathinsrc/sentry_envelope.c, which determines success from the total byte count written rather than from whether each write completed. The underlying file-write helpers also do not log when a write fails or is truncated.This is platform-independent (the serializer is shared code), though it was observed on a Windows-family target.
When does the problem happen
Environment
SENTRY_BACKEND=breakpadSteps To Reproduce
ENOSPC).Log output
No error or warning is emitted on the partial-write path; the write is reported as successful. (A specific customer case, including the captured malformed envelope, is tracked in the attached Linear ticket.)