Title: Netty 4 IndexOutOfBoundsException due to writer index exceeding buffer capacity · Issue #113 · lmdbjava/lmdbjava · GitHub
Open Graph Title: Netty 4 IndexOutOfBoundsException due to writer index exceeding buffer capacity · Issue #113 · lmdbjava/lmdbjava
X Title: Netty 4 IndexOutOfBoundsException due to writer index exceeding buffer capacity · Issue #113 · lmdbjava/lmdbjava
Description: Netty 4.1.30 and above (plus earlier versions intermittently) fail the following test: [INFO] Running org.lmdbjava.CursorParamTest [ERROR] Tests run: 5, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.78 s <<< FAILURE! - in org.lmdbj...
Open Graph Description: Netty 4.1.30 and above (plus earlier versions intermittently) fail the following test: [INFO] Running org.lmdbjava.CursorParamTest [ERROR] Tests run: 5, Failures: 0, Errors: 1, Skipped: 0, Time ela...
X Description: Netty 4.1.30 and above (plus earlier versions intermittently) fail the following test: [INFO] Running org.lmdbjava.CursorParamTest [ERROR] Tests run: 5, Failures: 0, Errors: 1, Skipped: 0, Time ela...
Opengraph URL: https://github.com/lmdbjava/lmdbjava/issues/113
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Netty 4 IndexOutOfBoundsException due to writer index exceeding buffer capacity","articleBody":"Netty 4.1.30 and above (plus earlier versions intermittently) fail the following test:\r\n\r\n```java\r\n[INFO] Running org.lmdbjava.CursorParamTest\r\n[ERROR] Tests run: 5, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.78 s \u003c\u003c\u003c FAILURE! - in org.lmdbjava.CursorParamTest\r\n[ERROR] execute[4: buffer adapter: org.lmdbjava.CursorParamTest$NettyBufferRunner@68b7bdcb](org.lmdbjava.CursorParamTest) Time elapsed: 0.015 s \u003c\u003c\u003c ERROR!\r\njava.lang.IndexOutOfBoundsException: readerIndex: 0, writerIndex: 8 (expected: 0 \u003c= readerIndex \u003c= writerIndex \u003c= capacity(4))\r\n\tat io.netty.buffer.AbstractByteBuf.checkIndexBounds(AbstractByteBuf.java:112)\r\n\tat io.netty.buffer.AbstractByteBuf.readerIndex(AbstractByteBuf.java:121)\r\n\tat org.lmdbjava.ByteBufProxy.out(ByteBufProxy.java:144)\r\n\tat org.lmdbjava.ByteBufProxy.out(ByteBufProxy.java:39)\r\n\tat org.lmdbjava.KeyVal.valOut(KeyVal.java:133)\r\n\tat org.lmdbjava.Cursor.get(Cursor.java:153)\r\n\tat org.lmdbjava.CursorParamTest$AbstractBufferRunner.execute(CursorParamTest.java:127)\r\n\tat org.lmdbjava.CursorParamTest.execute(CursorParamTest.java:90)\r\n```\r\n\r\nTwo issues were identified in `ButeBufProxy`:\r\n\r\n1. The unsafe setting of the `LENGTH_OFFSET` was setting the value as a `long`, whereas the actual field in the Java `PooledByteBuf` type is an `int`. \r\n2. The order of updating the `readerIndex` before the `writerIndex` was causing the bounds check on the `readerIndex` call to fail as the `writerIndex` had not yet been corrected.\r\n\r\nCorrection of the above causes tests to pass consistently with Netty 4.1.32 (currently the latest version).\r\n\r\ncc #90 #96 #111 ","author":{"url":"https://github.com/bp-alex","@type":"Person","name":"bp-alex"},"datePublished":"2018-12-18T00:42:36.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/113/lmdbjava/issues/113"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:afc54387-a76e-0f20-2bfe-59bc046f52eb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB0A:2EBC14:3553417:47E0605:69706E8C |
| html-safe-nonce | cbcf1066e3cb1faa76d44e929d01b2f6c42e011808a6f9aed28afc93e4110d8c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjBBOjJFQkMxNDozNTUzNDE3OjQ3RTA2MDU6Njk3MDZFOEMiLCJ2aXNpdG9yX2lkIjoiNTc4MDIyMjcyODgxMTM0MzUwMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ff29fc6864443e24e70a21735b61326b10ecfb0d69e81eaba98ed14723d82d06 |
| hovercard-subject-tag | issue:391949296 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/lmdbjava/lmdbjava/113/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4f4f255c8f3d89bd189739f7d02b759e6753a6aad0b095b31a96808e0b46c087/lmdbjava/lmdbjava/issues/113 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4f4f255c8f3d89bd189739f7d02b759e6753a6aad0b095b31a96808e0b46c087/lmdbjava/lmdbjava/issues/113 |
| og:image:alt | Netty 4.1.30 and above (plus earlier versions intermittently) fail the following test: [INFO] Running org.lmdbjava.CursorParamTest [ERROR] Tests run: 5, Failures: 0, Errors: 1, Skipped: 0, Time ela... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bp-alex |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9920a62ba22d06470388e2904804fb7e5ec51c9e35f81784e9191394c74b2bd2 |
| turbo-cache-control | no-preview |
| go-import | github.com/lmdbjava/lmdbjava git https://github.com/lmdbjava/lmdbjava.git |
| octolytics-dimension-user_id | 19765602 |
| octolytics-dimension-user_login | lmdbjava |
| octolytics-dimension-repository_id | 60480511 |
| octolytics-dimension-repository_nwo | lmdbjava/lmdbjava |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 60480511 |
| octolytics-dimension-repository_network_root_nwo | lmdbjava/lmdbjava |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7d6181066430cc06553c8396ca201e194ae33cb9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width