[foreign-jextract] Different behavior between C and Java program

Filip Krakowski krakowski at hhu.de
Sat Feb 27 10:56:09 UTC 2021


I stumbled upon a weird behavior I haven't seen before. I use jextract 
to generate bindings for ucx (https://github.com/openucx/ucx) and 
implement an object oriented wrapper for it. While running some examples 
on our machines, I noticed that ucx doesn't seem to detect our 
InfiniBand hardware when called from Java. On the other hand, a C 
program using the same functions in the same order is working as 
expected. I opened an issue at the ucx repository showing the source 
files, my setup and what I did to get these results 

I pinpointed this issue to a call to sscanf which doesn't parse the 
input correctly when called from Java 
Since I am not entirely sure that this is caused by ucx, I would like to 
ask if anyone did experience something similar in the past and knows how 
to troubleshoot this problem. I can't really think of a reason why the 
code suddenly behaves differently when called from Java.

Best regards

More information about the panama-dev mailing list