Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SelfDescribingTriviallyCopyable fails on Mac with Java17 or newer #891

Open
RobAustin opened this issue May 2, 2024 · 0 comments
Open
Assignees

Comments

@RobAustin
Copy link
Contributor

RobAustin commented May 2, 2024

please run this 85f64e8#diff-f479a75a7707f41047c9cf94c7997da78adbba91f057f4f305708ca7e997eee6 from this branch TriviallyCopyable

On Mac with Java17 or newer and it will produce this error Disjoined fields starting with partyID

for example

robaustin@Robs-Mac-mini Chronicle-Wire % java -version
openjdk version "21.0.2" 2024-01-16
OpenJDK Runtime Environment (build 21.0.2+13-58)
OpenJDK 64-Bit Server VM (build 21.0.2+13-58, mixed mode, sharing)
robaustin@Robs-Mac-mini Chronicle-Wire % 

run

mvn clean install -Dtest=net.openhft.chronicle.wire.marshallable.NewOrderSingleSerializationTest
bytes.toHexString() = 
[main] WARN net.openhft.chronicle.wire.marshallable.NewOrderSingle - Disjoined fields starting with partyID
[main] WARN net.openhft.chronicle.wire.marshallable.NewOrderSingle - Disjoined fields starting with partyID
[main] WARN net.openhft.chronicle.wire.marshallable.NewOrderSingle - Disjoined fields starting with partyID
[main] WARN net.openhft.chronicle.wire.marshallable.NewOrderSingle - Disjoined fields starting with partyID
[main] WARN net.openhft.chronicle.wire.marshallable.NewOrderSingle - Disjoined fields starting with partyID
[main] WARN net.openhft.chronicle.wire.marshallable.NewOrderSingle - Disjoined fields starting with partyID
[main] WARN net.openhft.chronicle.wire.marshallable.NewOrderSingle - Disjoined fields starting with partyID
[main] WARN net.openhft.chronicle.wire.marshallable.NewOrderSingle - Disjoined fields starting with partyID
[main] WARN net.openhft.chronicle.wire.marshallable.NewOrderSingle - Disjoined fields starting with partyID
[main] WARN net.openhft.chronicle.wire.WireMarshaller$BytesFieldAccess - Failed to read 'partyID' with 'IdentifiersWhoTheCounterpartyIs' taking default
net.openhft.chronicle.bytes.util.DecoratedBufferOverflowException: writeCheckOffset failed. Offset: 7 + adding 1> writeLimit: 7
	at net.openhft.chronicle.bytes.AbstractBytes.newBOERange(AbstractBytes.java:1010)
	at net.openhft.chronicle.bytes.AbstractBytes.writeCheckOffset0(AbstractBytes.java:1003)
	at net.openhft.chronicle.bytes.AbstractBytes.writeCheckOffset(AbstractBytes.java:993)
	at net.openhft.chronicle.bytes.AbstractBytes.writeOffsetPositionMoved(AbstractBytes.java:1193)
	at net.openhft.chronicle.bytes.AbstractBytes.writeOffsetPositionMoved(AbstractBytes.java:1186)
	at net.openhft.chronicle.bytes.AbstractBytes.writeByte(AbstractBytes.java:1125)
	at net.openhft.chronicle.bytes.AbstractBytes.writeByte(AbstractBytes.java:55)
	at net.openhft.chronicle.bytes.StreamingDataOutput.writeUnsignedByte(StreamingDataOutput.java:468)
	at net.openhft.chronicle.bytes.internal.BytesInternal.read8bitAndAppend(BytesInternal.java:2563)
	at net.openhft.chronicle.bytes.internal.BytesInternal.parse8bit(BytesInternal.java:2500)
	at net.openhft.chronicle.bytes.ByteStringParser.parse8bit(ByteStringParser.java:221)
	at net.openhft.chronicle.wire.TextWire$TextValueIn.textTo0(TextWire.java:1456)
	at net.openhft.chronicle.wire.TextWire$TextValueIn.textTo(TextWire.java:1359)
	at net.openhft.chronicle.wire.WireMarshaller$BytesFieldAccess.setValue(WireMarshaller.java:1629)
	at net.openhft.chronicle.wire.WireMarshaller$FieldAccess.readValue(WireMarshaller.java:1251)
	at net.openhft.chronicle.wire.WireMarshaller.readMarshallableDTOOrder(WireMarshaller.java:515)
	at net.openhft.chronicle.wire.WireMarshaller.readMarshallable(WireMarshaller.java:488)
	at net.openhft.chronicle.wire.Marshallable.readMarshallable(Marshallable.java:227)
	at net.openhft.chronicle.wire.SerializationStrategies$1.readUsing(SerializationStrategies.java:67)
	at net.openhft.chronicle.wire.TextWire$TextValueIn.marshallable(TextWire.java:2540)
	at net.openhft.chronicle.wire.Wires.objectMap(Wires.java:1052)
	at net.openhft.chronicle.wire.Wires.object2(Wires.java:1214)
	at net.openhft.chronicle.wire.Wires.object1(Wires.java:1157)
	at net.openhft.chronicle.wire.Wires.object0(Wires.java:1119)
	at net.openhft.chronicle.wire.ValueIn.object(ValueIn.java:1220)
	at net.openhft.chronicle.wire.WireType$1.fromString(WireType.java:94)
	at net.openhft.chronicle.wire.Marshallable.fromString(Marshallable.java:104)
	at net.openhft.chronicle.wire.marshallable.NewOrderSingleSerializationTest.test(NewOrderSingleSerializationTest.java:56)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
	at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55)
newOrderSingle.$length() = 320

org.junit.ComparisonFailure: 
<Click to see difference>


	at org.junit.Assert.assertEquals(Assert.java:117)
	at org.junit.Assert.assertEquals(Assert.java:146)
	at net.openhft.chronicle.wire.marshallable.NewOrderSingleSerializationTest.check(NewOrderSingleSerializationTest.java:97)
	at net.openhft.chronicle.wire.marshallable.NewOrderSingleSerializationTest$NewOrderSingleListenerMethodReader.readOneGenerated(NewOrderSingleSerializationTest$NewOrderSingleListenerMethodReader.java:60)
	at net.openhft.chronicle.wire.AbstractGeneratedMethodReader.readOne0(AbstractGeneratedMethodReader.java:213)
	at net.openhft.chronicle.wire.AbstractGeneratedMethodReader.readOne(AbstractGeneratedMethodReader.java:320)
	at net.openhft.chronicle.wire.marshallable.NewOrderSingleSerializationTest.test(NewOrderSingleSerializationTest.java:89)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
	at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55)

and not all the data will get serialised

image

NOTE it works if run in 11 Java on Mac

% java -version
openjdk version "11.0.21" 2023-10-17 LTS
OpenJDK Runtime Environment Corretto-11.0.21.9.1 (build 11.0.21+9-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.21.9.1 (build 11.0.21+9-LTS, mixed mode)

and produces this, which is correct.

!NewOrderSingle {
  eventTime: 0,
  clOrdID: myTrade,
  reason: "",
  expireDate: "20261010",
  partyID: IdentifiersWhoTheCounterpartyIs,
  symbol: XAU/USD,
  ordType: MARKET,
  execInst: NONE,
  timeInForce: GOOD_TILL_CANCEL,
  side: BUY,
  orderQty: 234,
  price: 123.0,
  transactTime: 0
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants