Skip to content

Conversation

sashass1315
Copy link
Contributor

Problem: In write_json_gzip_file, after GzEncoder::finish() we did not flush the inner BufWriter. Errors on the final buffered write can be silently ignored in Drop, causing undetected partial writes or I/O failures.

Why: BufWriter does not report errors on Drop. Without an explicit flush(), final write errors are lost. Additionally, we mapped finish() errors to WriteJson (serde) instead of I/O.

Fix: Capture the inner writer from finish() and call flush() on it. Map both finish() and flush() errors via FsPathError::write to provide correct path-contextual I/O errors.

Context: This gzip-to-disk path is only used by evm::executors::corpus when corpus_gzip is enabled. Other gzip usage (anvil state dump) targets Vec and doesn’t require flush(). Non-gzip JSON writers already call flush() explicitly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant