Skip to content

Dropped writes resulting in corrupted files #45

@bonsairobo

Description

@bonsairobo

In my project, I have recently started noticing deserialization errors resulting from truncated files. I had assumed that POSIX guarantees strong consistency to avoid this. But I decided to double check with a unit test. I discovered that async_fs fails this test quite often, while the equivalent test of std::fs has never failed.

Here is the test code so you may confirm my findings. I'm finding it's much easier to reproduce the test failure in a debug build (without --release).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions