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

Fix crash during a MSG_PARSE_AGAIN parse state w/ repairs #715

Merged
merged 1 commit into from
Oct 7, 2019

Conversation

smukil
Copy link
Contributor

@smukil smukil commented Oct 7, 2019

When read repairs are enabled, we attempt to keep a track of the last
parsed mbuf if the request is large enough to be split across multiple
buffers.

The code would previously update the latest_parsed_mbuf_idx field if the
current token length surpassed (mbuf)->last. This turns out to be incorrect
since we may parse with partial network reads as well.

The fix is to check if mbuf_full() before updating said index. Confirmed its
working with large requests across mbufs and partial network read requests.

When read repairs are enabled, we attempt to keep a track of the last
parsed mbuf if the request is large enough to be split across multiple
buffers.

The code would previously update the latest_parsed_mbuf_idx field if the
current token length surpassed (mbuf)->last. This turns out to be incorrect
since we may parse with partial network reads as well.

The fix is to check if mbuf_full() before updating said index. Confirmed its
working with large requests across mbufs and partial network read requests.
@smukil smukil added the bug label Oct 7, 2019
@smukil smukil self-assigned this Oct 7, 2019
@smukil smukil merged commit 0d10e35 into Netflix:dev Oct 7, 2019
@smukil smukil deleted the msg_parse_again_crash_fix branch October 17, 2019 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant