Discussion:
[Ikvm-developers] Support for sun.misc.Unsafe.arrayBaseOffset(Object[].class)
Vittorio Rigamonti
2017-04-10 09:02:26 UTC
Permalink
Hi ikvm-developers,

I'm working on [1] project and I'm using IKVM to run the java test suite
developed for the Java client [2] against the dotnet-client.
IKVM works very well and saved me lot of time, but I'm now facing an issue
[3] in running Java tests that use sun.misc.Unsafe class.
What seems to happen is that running in IKVM arrayBaseOffset returns an
unexpected value (not 2 and not 3) and causes an exception here [4]

I've read that java Unsafe is not fully supported, do you have plan to work
on this?
Can you suggest me a workaround for now?

I've seen something related in message [5]

Thank you!

Vittorio






[1] https://github.com/rigazilla/dotnet-client
[2] https://github.com/infinispan/infinispan/tree/master/client
[3] https://gist.github.com/rigazilla/4be552e2c1375bde21da890e2a58fe69
[4]
https://github.com/ben-manes/caffeine/blob/v2.4.0/caffeine/src/main/java/com/github/benmanes/caffeine/cache/MpscGrowableArrayQueue.java#L598
[4] https://sourceforge.net/p/ikvm/mailman/message/35520859/
Jeroen Frijters
2017-04-10 09:39:26 UTC
Permalink
Hi Vittorio,

There are no plans to enhance Unsafe. Like the OpenJDK developers, I don’t have much sympathy for the abusers of Unsafe. The code in [4] is clearly broken.

Regards,
Jeroen

From: Vittorio Rigamonti [mailto:***@redhat.com]
Sent: Monday, April 10, 2017 11:02
To: ikvm-***@lists.sourceforge.net
Subject: [Ikvm-developers] Support for sun.misc.Unsafe.arrayBaseOffset(Object[].class)

Hi ikvm-developers,
I'm working on [1] project and I'm using IKVM to run the java test suite developed for the Java client [2] against the dotnet-client.
IKVM works very well and saved me lot of time, but I'm now facing an issue [3] in running Java tests that use sun.misc.Unsafe class.
What seems to happen is that running in IKVM arrayBaseOffset returns an unexpected value (not 2 and not 3) and causes an exception here [4]
I've read that java Unsafe is not fully supported, do you have plan to work on this?
Can you suggest me a workaround for now?
I've seen something related in message [5]
Thank you!
Vittorio






[1] https://github.com/rigazilla/dotnet-client
[2] https://github.com/infinispan/infinispan/tree/master/client
[3] https://gist.github.com/rigazilla/4be552e2c1375bde21da890e2a58fe69
[4] https://github.com/ben-manes/caffeine/blob/v2.4.0/caffeine/src/main/java/com/github/benmanes/caffeine/cache/MpscGrowableArrayQueue.java#L598
[4] https://sourceforge.net/p/ikvm/mailman/message/35520859/

Loading...