Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Netty 4 IndexOutOfBoundsException due to writer index exceeding buffer capacity #113

Closed
@benalexau

Description

@benalexau

Netty 4.1.30 and above (plus earlier versions intermittently) fail the following test:

[INFO]Runningorg.lmdbjava.CursorParamTest[ERROR]Testsrun:5,Failures:0,Errors:1,Skipped:0,Timeelapsed:0.78s <<<FAILURE! -inorg.lmdbjava.CursorParamTest[ERROR]execute[4:bufferadapter:org.lmdbjava.CursorParamTest$NettyBufferRunner@68b7bdcb](org.lmdbjava.CursorParamTest)Timeelapsed:0.015s  <<<ERROR!java.lang.IndexOutOfBoundsException:readerIndex:0,writerIndex:8 (expected:0 <=readerIndex <=writerIndex <=capacity(4))atio.netty.buffer.AbstractByteBuf.checkIndexBounds(AbstractByteBuf.java:112)atio.netty.buffer.AbstractByteBuf.readerIndex(AbstractByteBuf.java:121)atorg.lmdbjava.ByteBufProxy.out(ByteBufProxy.java:144)atorg.lmdbjava.ByteBufProxy.out(ByteBufProxy.java:39)atorg.lmdbjava.KeyVal.valOut(KeyVal.java:133)atorg.lmdbjava.Cursor.get(Cursor.java:153)atorg.lmdbjava.CursorParamTest$AbstractBufferRunner.execute(CursorParamTest.java:127)atorg.lmdbjava.CursorParamTest.execute(CursorParamTest.java:90)

Two issues were identified inButeBufProxy:

  1. The unsafe setting of theLENGTH_OFFSET was setting the value as along, whereas the actual field in the JavaPooledByteBuf type is anint.
  2. The order of updating thereaderIndex before thewriterIndex was causing the bounds check on thereaderIndex call to fail as thewriterIndex had not yet been corrected.

Correction of the above causes tests to pass consistently with Netty 4.1.32 (currently the latest version).

cc#90#96#111

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp