Skip to content

Ensure termination of syslog writer#857

Merged
japaric merged 2 commits intomainfrom
fix-hang
Aug 23, 2024
Merged

Ensure termination of syslog writer#857
japaric merged 2 commits intomainfrom
fix-hang

Conversation

@squell
Copy link
Copy Markdown
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
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