j2objcgradle / gson

A Java serialization/deserialization library to convert Java Objects into JSON and back
Apache License 2.0
1 stars 0 forks source link

Unsafe issue on iPhone 5 (and earlier) #2

Open kpgalligan opened 7 years ago

kpgalligan commented 7 years ago

BigDecimal uses unsafe for some things internally, and we run into the same issue as with rxjava.

https://github.com/google/j2objc/issues/803

I think this is due to moving to openjdk, but we'll see. Need to escalate to j2objc master if this is fully in that court.

** Result for com.google.gson.JavaSerializationTest ** Failures 1 testNumberIsSerializable(com.google.gson.JavaSerializationTest): Cannot perform atomic access on unaligned address 0x81673b64 message: Cannot perform atomic access on unaligned address 0x81673b64 description: testNumberIsSerializable(com.google.gson.JavaSerializationTest) trace: java.lang.AssertionError: Cannot perform atomic access on unaligned address 0x81673b64 at 0x003e9764 java.lang.Error.() + 36 at 0x003cbeb4 java.lang.AssertionError.() + 36 at 0x003cbf47 java.lang.AssertionError.() + 71 at 0x006b57de sun.misc.Unsafe.putLongVolatile() + 126 at 0x006b5749 sun.misc.Unsafe.putLongVolatile() + 105 at 0x0044dc7b java.math.BigDecimal$UnsafeHolder.setIntCompactVolatile() + 203 at 0x0044dba7 java.math.BigDecimal.readObject() + 183 at 0x00cda155 java.lang.reflect.Method.invoke:object:() + 69 at 0x00cd9bff java.lang.reflect.Method.invoke() + 639 at 0x003a1341 java.io.ObjectInputStream.readObjectForClass() + 433 at 0x003a084b java.io.ObjectInputStream.readHierarchy() + 1227 at 0x003a41f8 java.io.ObjectInputStream.readNewObject() + 792 at 0x0039f0e2 java.io.ObjectInputStream.readNonPrimitiveContent() + 338 at 0x003a4b61 java.io.ObjectInputStream.readObject() + 289 at 0x003a49f4 java.io.ObjectInputStream.readObject() + 36 at 0x003a49bd java.io.ObjectInputStream.readObject() + 29 at 0x004f0614 java.util.ArrayList.readObject() + 308 at 0x00cda155 java.lang.reflect.Method.invoke:object:() + 69 at 0x00cd9bff java.lang.reflect.Method.invoke() + 639 at 0x003a1341 java.io.ObjectInputStream.readObjectForClass() + 433 at 0x003a084b java.io.ObjectInputStream.readHierarchy() + 1227 at 0x003a41f8 java.io.ObjectInputStream.readNewObject() + 792 at 0x0039f0e2 java.io.ObjectInputStream.readNonPrimitiveContent() + 338 at 0x003a4b61 java.io.ObjectInputStream.readObject() + 289 at 0x003a49f4 java.io.ObjectInputStream.readObject() + 36 at 0x003a49bd java.io.ObjectInputStream.readObject() + 29 at 0x001dfeb2 com.google.gson.JavaSerializationTest.serializedCopy() + 178