skadistats / clarity

Comically fast Dota 2, CSGO, CS2 and Deadlock replay parser written in Java.
BSD 3-Clause "New" or "Revised" License
664 stars 122 forks source link

Another crash parsing some CS2 demos #315

Closed thwonghin closed 4 months ago

thwonghin commented 4 months ago

https://www.hltv.org/matches/2372720/ninjas-in-pyjamas-vs-sashi-yalla-compass-2024

The parser crashes while parsing this demo.

So far I've applied a patch that fixes this issue. And then another exception raised (I've added some logs for debugging, so the line numbers were shifted a bit):

Exception in thread "main" java.io.IOException: invalid embedded packet size: got 124 remaining bits, but size is 224 bits
    at skadistats.clarity.processor.reader.InputSourceProcessor.processEmbedded(InputSourceProcessor.java:240)
    at skadistats.clarity.event.AbstractInvocationPoint.invoke(AbstractInvocationPoint.java:86)
    at skadistats.clarity.event.Event.raise(Event.java:41)
    at skadistats.clarity.processor.reader.InputSourceProcessor.processSource(InputSourceProcessor.java:172)
    at skadistats.clarity.event.AbstractInvocationPoint.invoke(AbstractInvocationPoint.java:86)
    at skadistats.clarity.event.Event.raise(Event.java:41)
    at skadistats.clarity.processor.runner.AbstractFileRunner.initAndRunWith(AbstractFileRunner.java:38)
    at skadistats.clarity.processor.runner.SimpleRunner.runWith(SimpleRunner.java:33)

Interestingly, if I log the size of these problematic messages, they all have 750000 bytes. My speculation is that the messages are getting tuncated or split.

spheenik commented 4 months ago

Sure seems like a bug in the CS client recording this. When you say "these problematic messages", do you have more replays where the same thing occurs? Can they all be pinned to a certain timespan where they were recorded?

thwonghin commented 4 months ago

If I let the parser continue to run without raising exception:

thwonghin commented 4 months ago

Confirmed the demos are broken, they crahsed at those ticks (but they worked if I clicked forawrd). Let me close this.