Skip to content

Lz4NativeCompressor fails uncleanly if native is not available #263

@JanecekPetr

Description

@JanecekPetr

On Windows the native implementations of (de)compressors are not available. They usually fail cleanly with an okay message, however Lz4NativeCompressor instead fails with

java.lang.IllegalArgumentException: The provided allocation size is negative: -1
        at java.base/jdk.internal.foreign.Utils.checkNonNegativeArgument(Utils.java:221)
        at java.base/jdk.internal.foreign.Utils.checkAllocationSizeAndAlign(Utils.java:206)
        at java.base/jdk.internal.foreign.ArenaImpl.allocateNoInit(ArenaImpl.java:54)
        at java.base/jdk.internal.foreign.ArenaImpl.allocate(ArenaImpl.java:60)
        at java.base/java.lang.foreign.SegmentAllocator.allocate(SegmentAllocator.java:645)
        at io.airlift.compress.v3.lz4.Lz4NativeCompressor.<init>(Lz4NativeCompressor.java:25)

There's a field which should only be assigned after the is-native-enabled check passes in the constructor.

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