Basically sun.misc.Unsafe returns the wrong value for arrayIndexScale which causes an exception in io.netty.util.internal.shaded.org.jctools.util.UnsafeRefAccess
static {
int scale = UnsafeAccess.UNSAFE.arrayIndexScale(Object[].class);
if (4 == scale) {
REF_ELEMENT_SHIFT = 2;
} else {
if (8 != scale) {
throw new IllegalStateException("Unknown pointer size");
}
REF_ELEMENT_SHIFT = 3;
}
REF_ARRAY_BASE = (long)UnsafeAccess.UNSAFE.arrayBaseOffset(Object[].class);
}
In Java the call "UnsafeAccess.UNSAFE.arrayIndexScale(Object[].class);" returns 4 for tests I have done but in .NET returns 1 hence the IllegalStateException.
There seems to be issues with using Netty with IKVM. This was already a problem in IKVM 8.1 but as development stopped it was never fixed I guess.
Another guy also hit this problem: https://sourceforge.net/p/ikvm/mailman/message/35520859/
Basically sun.misc.Unsafe returns the wrong value for arrayIndexScale which causes an exception in io.netty.util.internal.shaded.org.jctools.util.UnsafeRefAccess
In Java the call "UnsafeAccess.UNSAFE.arrayIndexScale(Object[].class);" returns 4 for tests I have done but in .NET returns 1 hence the IllegalStateException.