OpenHFT / Posix

Other
3 stars 5 forks source link

JNRPosixAPI#fallocate method on Alpine Linx 3.19+ fails with UnsatisfiedLinkError #31

Open splunk-chowiel opened 7 months ago

splunk-chowiel commented 7 months ago

On Alpine 3.19+ running on aarch64 AWS EC2 Graviton instances, the C lib api, fallocate64, is no longer available. The Posix layer should invoke fallocate in this case.

Proposed fix in the JNRPosixAPI class would be to introduce a system property that allows fallocate to always be invoked:

    @Override
    public int fallocate(int fd, int mode, long offset, long length) {
        if (Boolean.parseBoolean(System.getProperty("net.openhft.posix.internal.jnr.JNRPosixAPI.fallocate_no_shim"))) {
            return jnr.fallocate(fd, mode, offset, length);
        }
        return UnsafeMemory.IS32BIT ? jnr.fallocate(fd, mode, offset, length) : jnr.fallocate64(fd, mode, offset, length);
    }
tgd commented 7 months ago

Hi @splunk-chowiel many thanks for flagging this. We do review these issues but cannot assign them the same high priority as our commercial support channels. If this is something you would like to expedite please do get in touch here: https://chronicle.software/contact-us/

cc @rogersimmons

splunk-chowiel commented 7 months ago

@tgd Thanks. I can do that. I can also submit a PR with the above change if that works.

tgd commented 7 months ago

Hi @splunk-chowiel - thanks for offering to put the PR in place - before you go go ahead with that please take a look at our contributor agreement and return it to us - https://chronicle.software/contributor-agreement/. This way we can ensure the IP rights of any contributions made.

Regarding commercial support the web form https://chronicle.software/contact-us/ or sales@chronicle.software are a good point of contact - if there are issues with those approaches please let me know here and I can expedite.

rogersimmons commented 4 months ago

https://github.com/OpenHFT/Posix/pull/34