[jep442 / foreign function] Crash when calling ioctl function

Guillaume Nodet gnodet at apache.org
Thu Aug 24 13:41:38 UTC 2023


Hi everybody

I've been trying to port the JLine library to JEP 442 and earlier previews
(nice work, I'm eagerly waiting for its GA release) every once in a while,
but I'm stuck on a call for which I can't find my way around.

The call is the ioctl function [1] which has untyped parameters, but
whatever I've been feeding it crashes the JVM.  I've been successfully
using this method with JNA [2] and a plain small JNI library [3], and after
having spent countless hours, I must admit I can't find what's happening....

Here's a very small reproducer:
  https://github.com/gnodet/jep442-ioctl

Any suggestions?

Cheers,
Guillaume Nodet

[1] http://man7.org/linux/man-pages/man4/tty_ioctl.4.html
[2]
https://github.com/jline/jline3/blob/master/terminal-jna/src/main/java/org/jline/terminal/impl/jna/linux/CLibrary.java#L34
[3]
https://github.com/fusesource/jansi/blob/master/src/main/native/jansi.c#L64-L76
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20230824/9d861ed8/attachment.htm>


More information about the panama-dev mailing list