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

Filip Krakowski krakowski at hhu.de
Sat Feb 27 11:34:44 UTC 2021


thanks for the fast response! You are right, I didn't even think in this 
Our servers are configured with a German locale where ',' is used as the 
decimal separator.

Changing the locale to English solved the problem. Thanks again! :)

Best regards

On 2/27/21 12:13 PM, Thomas Stüfe wrote:
> From looking at your debug output, I guess it's a locale issue. The 
> '.' is not recognized as a decimal point, so unit[0]='.' and unit[1]='0'.
> Cheers, Thomas
> On Sat, Feb 27, 2021 at 11:57 AM Filip Krakowski <krakowski at hhu.de 
> <mailto:krakowski at hhu.de>> wrote:
>     Hi,
>     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
>     (https://github.com/openucx/ucx/issues/6406).
>     I pinpointed this issue to a call to sscanf which doesn't parse the
>     input correctly when called from Java
>     (https://github.com/openucx/ucx/issues/6406#issuecomment-787050535).
>     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
>     Filip

More information about the panama-dev mailing list