Skip to content

Conversation

cmaloney
Copy link
Contributor

@cmaloney cmaloney commented Sep 10, 2025

In _io__Buffered_flush_impl the macro CHECK_CLOSED is used to check the buffered* is in a good state to be flushed. That differs slightly from buffered_closed.

In some cases, that difference would result in close() (_io__Buffered_close_impl) thinking the file needed to be flushed and closed while flush() thought the file was already closed.

This could happen during GC and would result in an unraisable exception.

In `_io__Buffered_flush_impl` the macro `CHECK_CLOSED` is used to check
the `buffered*` is in a good state to be flushed. That differs slightly
from `buffered_closed`.

In some cases, that difference would result in `close()` thinking the
file needed to be flushed and closed while `flush()` thought the file
was already closed.

This could happen during GC and would result in an unraisable exception.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant