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

Using Custom Comparator throws NullPointerException after GC #125

Closed
Labels
bugAn issue relates to behaviour that violates the intention of the library
@jheister

Description

@jheister

When aDbi is created using a custom comparator it only works whilst a full GC has not run. This can be show by adding aSystem.gc() between the construction of the map and theput invocation inorg.lmdbjava.DbiTest#customComparator.

On executingput it throws:
java.lang.NullPointerException: callable is null at jnr.ffi.provider.jffi.NativeClosureProxy.getCallable(NativeClosureProxy.java:57) at jnr.ffi.provider.jffi.NativeClosureProxy$$impl$$0.invoke(Unknown Source) at com.kenai.jffi.Foreign.invokeL5(Native Method) at com.kenai.jffi.Invoker.invokeL5(Invoker.java:438) at org.lmdbjava.Library$Lmdb$jnr$ffi$0.mdb_put(Unknown Source) at org.lmdbjava.Dbi.put(Dbi.java:421)

This happens sinceNativeClosureFactory.ClosureReference is aWeakReference and nothing else holds a reference to theComparatorCallback.

I've tested that convertingComparatorCallback ccb into a field fixes this, since it ensures the callback remains alive whilst theDbi object is accessible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn 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


      [8]ページ先頭

      ©2009-2025 Movatter.jp