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

CS2 corrupt input #409

Closed
Run1e opened this issue Sep 1, 2023 · 10 comments
Closed

CS2 corrupt input #409

Run1e opened this issue Sep 1, 2023 · 10 comments

Comments

@Run1e
Copy link

Run1e commented Sep 1, 2023

Describe the bug
This demo causes a parser error:

panic: snappy: corrupt input [recovered]
        panic: snappy: corrupt input

goroutine 1 [running]:
github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs.recoverFromUnexpectedEOF({0x81a3e0, 0xc0000482e0})
        C:/Users/runie/go/pkg/mod/github.com/markus-wa/demoinfocs-golang/v4@v4.0.0-beta.0/pkg/demoinfocs/parsing.go:171 +0x274
github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs.(*parser).ParseToEnd.func1()
        C:/Users/runie/go/pkg/mod/github.com/markus-wa/demoinfocs-golang/v4@v4.0.0-beta.0/pkg/demoinfocs/parsing.go:124 +0x9f
panic({0x81a3e0?, 0xc0000482e0?})
        C:/Program Files/Go/src/runtime/panic.go:920 +0x290
github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs.(*parser).parseFrameS2(0xc000069a00)
        C:/Users/runie/go/pkg/mod/github.com/markus-wa/demoinfocs-golang/v4@v4.0.0-beta.0/pkg/demoinfocs/parsing.go:349 +0x905
github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs.(*parser).ParseToEnd(0xc000069a00)
        C:/Users/runie/go/pkg/mod/github.com/markus-wa/demoinfocs-golang/v4@v4.0.0-beta.0/pkg/demoinfocs/parsing.go:147 +0x210

Not familiar enough with the library to tell if this is a bugged demo or not.

To Reproduce
Replay: http://replay183.valve.net/730/003636925493187444888_0599554593.dem.bz2

Library version
v4.0.0-beta.0

@IOExceptional
Copy link

From what I've observed, the demos appear to have a single DEM_FullPacket which can't be decompressed. However, sometimes snappy succeeds, it then fails to unmarshal the packet as the buffer isn't what protobuf is expecting

@markus-wa
Copy link
Owner

interesting.

does the demo work in the in-game demo viewer (playdemo)?

@IOExceptional
Copy link

I'll check a few shortly 👍🏼

@IOExceptional
Copy link

TL;DRL: Yes they work

Long version;
When clicking the next round button, in the console it prints out what tick you're going to, from and what fullpacket is being used to initialise the game.

On the demos where 1 fullpacket is broken, that particular line says;
[Demo] Demo skipping to tick 30362 from current 26407, full packet tick -1
instead of
[Demo] Demo skipping to tick 30362 from current 26407, full packet tick 26890 which is the broken fullpacket

So the game is aware of the broken packet

@IOExceptional
Copy link

image

@IOExceptional
Copy link

Same thing happens on the demo @Run1e linked above on round 20
image

@IOExceptional
Copy link

IOExceptional commented Sep 11, 2023

However, sometimes snappy succeeds, it then fails to unmarshal the packet as the buffer isn't what protobuf is expecting

This doesn't show anything in the console at all and demo playback happens seamlessly on one of the demos with this, looks like this fullpacket was mid-round, vs. the non-decompressable packets being pushed at the start/end of a round

@IOExceptional
Copy link

Just for proper context, this is what it should look like with a correct fullpacket

image

@Run1e
Copy link
Author

Run1e commented Sep 11, 2023

From my data about 10% of demos seem to be affected by this

Btw good detective work @IOExceptional 🙏

akiver added a commit to akiver/demoinfocs-golang that referenced this issue Sep 12, 2023
akiver added a commit to akiver/demoinfocs-golang that referenced this issue Sep 12, 2023
akiver added a commit to akiver/demoinfocs-golang that referenced this issue Sep 12, 2023
@Run1e
Copy link
Author

Run1e commented Sep 12, 2023

Solved by #416

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

No branches or pull requests

3 participants