mochi-hpc / mochi-abt-io

Argobots-aware bindings to POSIX I/O functions
Other
3 stars 0 forks source link

potential access after free by abt_io_log() calls #23

Closed carns closed 1 year ago

carns commented 1 year ago

Some of the I/O servicing functions end with code patterns like this:

    ABT_eventual_set(state->eventual, NULL, 0);
    abt_io_log(state->aid, "open", 0, 0, start, ABT_get_wtime());

This can cause a race condition depending on the use case and configuration. The state pointer could be freed by another thread immediately after the eventual is set. If this happens fast enough, then the pointer could be invalid on the following line.

We probably just need to invert these calls in affected functions.