bufread::generic::Decoder: don't reinitialize on reader EOF#148
Closed
eeeeeta wants to merge 3 commits intoNullus157:prīmumfrom
Closed
bufread::generic::Decoder: don't reinitialize on reader EOF#148eeeeeta wants to merge 3 commits intoNullus157:prīmumfrom
eeeeeta wants to merge 3 commits intoNullus157:prīmumfrom
Conversation
0c6b4aa to
c8bfeaf
Compare
Member
|
To understand the issue I added an additional test assertion that I believe covers what this is meant to fix: bd6f0ae. If that looks like what you saw you can cherry-pick it to your branch. |
If `multiple_members` is enabled, the `bufread::generic::Decoder` will attempt to reinitialise the decoder inside `State::Flushing`, even if the reason it entered that state was due to the reader returning an EOF. This will result in an attempt to read past EOF, which is highly undesirable to say the least. To fix this, force `multiple_members` to `false` when we get an EOF condition from the reader.
c8bfeaf to
90f95e4
Compare
Contributor
Author
|
@Nemo157 Yeah, that test looks good! Cherry-picked (and fixed the stupid compilation error :p) |
Nemo157
reviewed
May 14, 2022
90f95e4 to
e724673
Compare
Member
|
I fixed my tests formatting and just applied the same change to all the implementations. bors r+ |
bors Bot
added a commit
that referenced
this pull request
May 15, 2022
148: bufread::generic::Decoder: don't reinitialize on reader EOF r=Nemo157 a=eeeeeta If `multiple_members` is enabled, the `bufread::generic::Decoder` will attempt to reinitialise the decoder inside `State::Flushing`, even if the reason it entered that state was due to the reader returning an EOF. This will result in an attempt to read past EOF, which is highly undesirable to say the least. To fix this, force `multiple_members` to `false` when we get an EOF condition from the reader. Co-authored-by: eta <github@eta.st> Co-authored-by: Wim Looman <git@nemo157.com>
Codecov Report
@@ Coverage Diff @@
## prīmum #148 +/- ##
==========================================
+ Coverage 78.00% 78.52% +0.52%
==========================================
Files 92 93 +1
Lines 2950 3041 +91
==========================================
+ Hits 2301 2388 +87
- Misses 649 653 +4
Continue to review full report at Codecov.
|
Contributor
Contributor
Author
Member
|
Published 0.3.14 |
fabricedesre
pushed a commit
to capyloon/arti
that referenced
this pull request
Jun 3, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If
multiple_membersis enabled, thebufread::generic::Decoderwillattempt to reinitialise the decoder inside
State::Flushing, even ifthe reason it entered that state was due to the reader returning an EOF.
This will result in an attempt to read past EOF, which is highly
undesirable to say the least.
To fix this, force
multiple_memberstofalsewhen we get an EOFcondition from the reader.