Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure termination of syslog writer #857

Merged
merged 2 commits into from
Aug 23, 2024
Merged

Ensure termination of syslog writer #857

merged 2 commits into from
Aug 23, 2024

Conversation

squell
Copy link
Member

@squell squell commented Aug 23, 2024

Closing #856

This particular code has been struck by lightning a couple of times now and is pretty hard to reason about using formal reasoning (e.g. a loop invariant like self.cursor < LIMIT would seen to have to hold, but it doesn't really). This PR doesn't improve that situation (i.e. the formal reasoning), but it does ensure termination.

As a minor side-fix, the code could also panic on line 54 if we hit the middle of a UTF8 character in exactly the wrong position, that is fixed as well.

I'll work on an implementation of this writer in a more declarative style.

@squell squell linked an issue Aug 23, 2024 that may be closed by this pull request
@japaric japaric merged commit 2f4baf9 into main Aug 23, 2024
12 checks passed
@japaric japaric deleted the fix-hang branch August 23, 2024 14:57
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.

Sudo can block/hang sometimes
2 participants