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

Better fix for app hanging by printing a bunch of new lines #142

Merged
merged 3 commits into from
May 12, 2017

Conversation

ob
Copy link
Member

@ob ob commented May 11, 2017

A more careful examination illustrated that the problem wasn't with a test that loops indefinitely. It turns out that we weren't error checking the UTF-8 decoding of the buffer and if the data happened to be cut in the middle of a UTF-8 char, you'd get an error decoding it and the loop would never finish.

This isn't the Right Fix(tm), but it's better than what's in there... the right fix would be to read the data in chunks without interpreting anything until we get to the \n, then convert the full line to an NSstring and move the remaining data to another buffer.

We're pushing this out though because it's a quick workaround for a serious bug.

ob added 3 commits May 1, 2017 13:38
We've seen from logs that sometimes the "Infinite Loop" condition is hit.
The current theory is that it's either an invalid UTF-8 string or we're splitting
a UTF-8 string in the middle. This fix would both illuminate what's going on
and prevent the issue in the first place.
@ob ob requested review from oliverhu and vargon May 11, 2017 22:18
@oliverhu oliverhu merged commit 281fa3e into master May 12, 2017
@oliverhu oliverhu deleted the fix-app-hang-nl branch July 11, 2017 23:54
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.

2 participants