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 BufferOverflowException during non-Unsafe PooledDirectByteBuf resize #9912

Merged
merged 5 commits into from Jan 11, 2020

Commits on Dec 30, 2019

  1. Fix BufferOverflowException during non-Unsafe PooledDirectByteBuf resize

    Motivation
    
    Recent optimization netty#9765 introduced a bug where the native indices of
    the internal reused duplicate nio buffer are not properly reset prior to
    using it to copy data during a reallocation operation. This can result
    in BufferOverflowExceptions thrown during ByteBuf capacity changes.
    
    The code path in question applies only to pooled direct buffers when
    Unsafe is disabled or not available.
    
    Modification
    
    Ensure ByteBuffer#clear() is always called on the reused internal nio
    buffer prior to returning it from PooledByteBuf#internalNioBuffer()
    (protected method); add unit test that exposes the bug.
    
    Result
    
    Fixes netty#9911
    njhill committed Dec 30, 2019
    Copy the full SHA
    e50fa05 View commit details
    Browse the repository at this point in the history

Commits on Jan 10, 2020

  1. Copy the full SHA
    4cb38d0 View commit details
    Browse the repository at this point in the history
  2. Remove final from test methods

    njhill committed Jan 10, 2020
    Copy the full SHA
    c4634e6 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    18ec054 View commit details
    Browse the repository at this point in the history
  4. Fix unit test buffer leak

    njhill committed Jan 10, 2020
    Copy the full SHA
    0d80a6a View commit details
    Browse the repository at this point in the history