OpenHFT / Chronicle-Values

http://chronicle.software
Other
104 stars 37 forks source link

Out of Order Field Offsets for Generated Classes #19

Closed sthekepat closed 5 months ago

sthekepat commented 6 years ago

There seems to be sporadically out of order offsets generated between Two JVM instances. so if there A, B, C, D fields in the interface. First run in JVM will give A | B | C | D Second run in another JVM sometimes gives A | C | B | D So the field order is only Guaranteed in a given JVM ? I have tried using Group(#) annotation, it gives the following exception for large Values Interfaces: Caused by: java.lang.AssertionError: cannot read/write 128 bits at net.openhft.chronicle.values.IntegerFieldModel.integerBytesIoType(IntegerFieldModel.java:136) at net.openhft.chronicle.values.IntegerFieldModel.integerBytesMethodSuffix(IntegerFieldModel.java:127) at net.openhft.chronicle.values.IntegerFieldModel.read(IntegerFieldModel.java:123) at net.openhft.chronicle.values.IntegerFieldModel.genGet(IntegerFieldModel.java:297) at net.openhft.chronicle.values.IntegerFieldModel.genGet(IntegerFieldModel.java:286) at net.openhft.chronicle.values.IntegerBackedNativeMemberGenerator.generateGet(IntegerBackedNativeMemberGenerator.java:45) at net.openhft.chronicle.values.FieldModel.generateMethod(FieldModel.java:264) at net.openhft.chronicle.values.FieldModel.generateMembers(FieldModel.java:194) at net.openhft.chronicle.values.FieldModel.generateNativeMembers(FieldModel.java:185) at net.openhft.chronicle.values.Generators.lambda$generateNativeClass$0(Generators.java:42)

sthekepat commented 6 years ago

SecurityInfo1.txt SecurityInfo2.txt

sthekepat commented 6 years ago

Added two generated files by -Dchronicle.values.dumpCode=true The discrepancy starts at Line #1266 thru #1296 basically packing Boolean into the same byte.

peter-lawrey commented 3 years ago

Unfortunately the order of method names is not stable for the JVM (for fields it is) You can make it more stable by using inheritance however this isn't a scalable solution. We would need to have a means of specifying how the fields are ordered, possibly via an annotation.

tgd commented 5 months ago

Closing this out as no work is planned on this at the moment. Please comment on this issue if you would like it re-opened. If you would like to expedite the development of this please get in touch with us here for commercial support and reference this github issue: https://chronicle.software/contact-us/