Skip to content

Fix three bugs in CompositeByteBuf#8773

Merged
normanmaurer merged 1 commit intonetty:4.1from
njhill:comp-buf-fix
Jan 24, 2019
Merged

Fix three bugs in CompositeByteBuf#8773
normanmaurer merged 1 commit intonetty:4.1from
njhill:comp-buf-fix

Conversation

@njhill
Copy link
Copy Markdown
Member

@njhill njhill commented Jan 23, 2019

Motivation

In #8758, @doom369 reported an infinite loop bug in CompositeByteBuf which was introduced in #8437.

This is the same small fix for that, along with fixes for two other bugs (also introduced in #8437 😞) found while re-inspecting the changes and adding unit tests.

Modifications

  • Replace recursive call to toComponentIndex with toComponentIndex0 as intended
  • Add missed lastAccessed racy cache invalidation in capacity(int) method
  • Fix incorrect determination of initial offset in non-zero cIndex case of updateComponentOffsets method
  • New unit tests for previously uncovered methods

Results

Fewer bugs.

Motivation

In netty#8758, @doom369 reported an infinite loop bug in CompositeByteBuf
which was introduced in netty#8437.

This is the same small fix for that, along with fixes for two other bugs
found while re-inspecting the changes and adding unit tests.

Modification

- Replace recursive call to toComponentIndex with toComponentIndex0 as
intended
- Add missed "lastAccessed" racy cache invalidation in capacity(int)
method
- Fix incorrect determination of initial offset in non-zero cIndex case
of updateComponentOffsets method
- New unit tests for previously uncovered methods

Results

Fewer bugs.
@netty-bot
Copy link
Copy Markdown

Can one of the admins verify this patch?

@normanmaurer
Copy link
Copy Markdown
Member

@netty-bot test this please

@normanmaurer normanmaurer added this to the 4.1.34.Final milestone Jan 24, 2019
@normanmaurer normanmaurer self-assigned this Jan 24, 2019
@normanmaurer normanmaurer merged commit 1d5b7be into netty:4.1 Jan 24, 2019
normanmaurer pushed a commit that referenced this pull request Jan 24, 2019
Motivation

In #8758, @doom369 reported an infinite loop bug in CompositeByteBuf
which was introduced in #8437.

This is the same small fix for that, along with fixes for two other bugs
found while re-inspecting the changes and adding unit tests.

Modification

- Replace recursive call to toComponentIndex with toComponentIndex0 as
intended
- Add missed "lastAccessed" racy cache invalidation in capacity(int)
method
- Fix incorrect determination of initial offset in non-zero cIndex case
of updateComponentOffsets method
- New unit tests for previously uncovered methods

Results

Fewer bugs.
@njhill njhill deleted the comp-buf-fix branch January 24, 2019 16:13
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.

3 participants