Title: IndexOutOfBoundsException due to SimpleLeakAwareByteBuf · Issue #133 · lmdbjava/lmdbjava · GitHub
Open Graph Title: IndexOutOfBoundsException due to SimpleLeakAwareByteBuf · Issue #133 · lmdbjava/lmdbjava
X Title: IndexOutOfBoundsException due to SimpleLeakAwareByteBuf · Issue #133 · lmdbjava/lmdbjava
Description: Further to #113 the ByteBufProxy has been intermittently failing with messages such as java.lang.IndexOutOfBoundsException: readerIndex: 0, writerIndex: 4 (expected: 0 <= readerIndex <= writerIndex <= capacity(0)). The intermittent natur...
Open Graph Description: Further to #113 the ByteBufProxy has been intermittently failing with messages such as java.lang.IndexOutOfBoundsException: readerIndex: 0, writerIndex: 4 (expected: 0 <= readerIndex <= writerIndex...
X Description: Further to #113 the ByteBufProxy has been intermittently failing with messages such as java.lang.IndexOutOfBoundsException: readerIndex: 0, writerIndex: 4 (expected: 0 <= readerIndex <= write...
Opengraph URL: https://github.com/lmdbjava/lmdbjava/issues/133
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"IndexOutOfBoundsException due to SimpleLeakAwareByteBuf","articleBody":"Further to #113 the `ByteBufProxy` has been intermittently failing with messages such as `java.lang.IndexOutOfBoundsException: readerIndex: 0, writerIndex: 4 (expected: 0 \u003c= readerIndex \u003c= writerIndex \u003c= capacity(0))`. The intermittent nature of this failure has made it a long-standing bug that was previously thought fixed, but I have since found it can be reliably reproduced by making `CursorParamTest` iterate 1,000 times.\r\n\r\nBy way of background `ByteBufProxy` operates by using `Unsafe` to set the \"length\" field of `PooledUnsafeDirectByteBuf`. It is therefore dependent on all buffers being of that type, otherwise the address offset of the \"length\" field would be incorrect.\r\n\r\nFurther investigation revealed that occasionally a `SimpleLeakAwareByteBuf` was returned by `PooledByteBufAllocator.DEFAULT`. This subsequently caused the length to be incorrectly set in such instances and the bounds check to fail during `ByteBufProxy.out(...)` invocations.\r\n\r\nModifications have been made to specifically test the type of any created buffer in order to ensure it is a `PooledUnsafeDirectByteBuf` and fail after several retries without obtaining one. This should provide a reasonable approach given that buffers are cached and reused.\r\n\r\nIt is noted that user-provided buffers are not impacted by this requirement to use `PooledUnsafeDirectByteBuf` as their memory address and applicable slice range is obtained from standard Java accessors defined on the `ByteBuf` type.","author":{"url":"https://github.com/bp-alex","@type":"Person","name":"bp-alex"},"datePublished":"2019-06-01T04:38:02.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/133/lmdbjava/issues/133"}
| 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:1d89a920-2b8d-2e3e-8cad-6ca0ca158870 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CB30:13D6E:ED822D:13D5024:69705103 |
| html-safe-nonce | 0f1fac474bb0ba31e114f6b7bb6c881ae38c654145a1d5c1b7b5fbbf38b95913 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjMwOjEzRDZFOkVEODIyRDoxM0Q1MDI0OjY5NzA1MTAzIiwidmlzaXRvcl9pZCI6IjQwNDkwNzQ1OTQ4MzgxNjE5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | aa9572138da67624ed796fa9a095830c4c04e1b8cefb682013a4917731ba5883 |
| hovercard-subject-tag | issue:451043853 |
| 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/133/issue_layout |
| twitter:image | https://opengraph.githubassets.com/06c61202aaf09118e5fdf424c36f1434a6035120a4034c6cd75802fe3a8d89c3/lmdbjava/lmdbjava/issues/133 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/06c61202aaf09118e5fdf424c36f1434a6035120a4034c6cd75802fe3a8d89c3/lmdbjava/lmdbjava/issues/133 |
| og:image:alt | Further to #113 the ByteBufProxy has been intermittently failing with messages such as java.lang.IndexOutOfBoundsException: readerIndex: 0, writerIndex: 4 (expected: 0 <= readerIndex <= writerIndex... |
| 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 | f643964067a552f02067066d6a910b2f90a5721f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width