GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — IndexOutOfBoundsException due to SimpleLeakAwareByteBuf · Issue #133 · lmdbjava/lmdbjava

IndexOutOfBoundsException due to SimpleLeakAwareByteBuf #133

New issue
Copy link
New issue
Copy link
Closed
Closed
IndexOutOfBoundsException due to SimpleLeakAwareByteBuf#133
Copy link
Labels
bugAn issue relates to behaviour that violates the intention of the libraryAn issue relates to behaviour that violates the intention of the library

Description

@bp-alex
bp-alex
opened on Jun 1, 2019
Issue body actions

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 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.

By 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.

Further 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.

Modifications 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.

It 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.

Activity

  1. bp-alex
    closed this as completedin 1fe353don Jun 1, 2019
  2. bp-alex
    added
    bugAn issue relates to behaviour that violates the intention of the libraryAn issue relates to behaviour that violates the intention of the library
    on Jun 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn issue relates to behaviour that violates the intention of the libraryAn issue relates to behaviour that violates the intention of the library

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.