Skip to content

0.22.1: a handle is retired before its value is closed; a generation is read and advanced atomically - #48

Merged
Sunrisepeak merged 1 commit into
mainfrom
fix/retire-before-close
Nov 12, 2026
Merged

Sunrisepeak merged 1 commit into
mainfrom
fix/retire-before-close

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

The construction openkal-linux#53 reports is this implementation's too: kal_net_close, kal_net_close_listener and kal_datagram_close closed the socket and then retired the handle, so a file or a connection another context was given the value for between the two packed it with the old generation and was left with a stale handle.

  • The three releases retire and then close, as a file's, a directory's and a program's do.
  • A generation is read and advanced through the atomic operations (okw::atomic), on both compilers.
  • tests/a_released_handle_is_stale_before_its_value_is_free.cpp: one context accepts and closes connections, one connects and closes, one opens, reads and closes a file for three seconds; every read returns the file.

A stream enquiry for a handle that names nothing already answers the null handle here, which is no stream; nothing changes there.

@Sunrisepeak
Sunrisepeak merged commit 8b5db95 into main Nov 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant