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

Parser fails on v4.0.0 instantly due to interface conversion error around bindPlayerWeaponsS2 #480

Closed
maddenbjames opened this issue Nov 21, 2023 · 8 comments

Comments

@maddenbjames
Copy link

Parser failed on multiple demos from yesterday with the new v4.0.0 version with this error
interface conversion: interface {} is *sendtables2.fieldState, not uint64
Seems to always be around the bindPlayerWeaponsS2.func3

Download this demo and use the first map on ancient
https://www.hltv.org/matches/2368317/rocket-vs-boss-esl-challenger-league-season-46-north-america
Run any function that seems to interact with players and it will fail.

Code:

	p.RegisterEventHandler(func(e events.Kill) {
		var hs string
		if e.IsHeadshot {
			hs = " (HS)"
		}
		var wallBang string
		if e.PenetratedObjects > 0 {
			wallBang = " (WB)"
		}
		fmt.Printf("%s <%v%s%s> %s\n", e.Killer, e.Weapon, hs, wallBang, e.Victim)
	})

I expect it to go through the demo and parse it like normal, but for some reason when updating to the most recent version of the parser, everything seems to be breaking.

v4.0.0

I initially thought that it could be a backwards compatibility issue, however it seems that this recent demo also has the same issue. Thanks!

@akiver
Copy link
Collaborator

akiver commented Nov 21, 2023

Hi, I tried both demos without issue - are you sure it's the correct demo?
The stack trace would be helpful too, thanks

@maddenbjames
Copy link
Author

maddenbjames commented Nov 22, 2023

Yeah, just retested with the same demo. It was the ancient m1 demo and I am still getting this error. Here is the stacktrace. Thanks!

2023/11/22 10:57:52 failed to parse demo: interface conversion: interface {} is *sendtables2.fieldState, not uint64
stacktrace:
goroutine 6 [running]:
runtime/debug.Stack()
        /usr/lib/go-1.18/src/runtime/debug/stack.go:24 +0x65
github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs.NewParserWithConfig.func1({0x791480, 0xc00101e080})
        /home/gonzo/go/pkg/mod/github.com/markus-wa/demoinfocs-golang/v4@v4.0.0/pkg/demoinfocs/parser.go:388 +0x30
github.com/markus-wa/godispatch.(*Dispatcher).dispatchWithRecover.func1()
        /home/gonzo/go/pkg/mod/github.com/markus-wa/godispatch@v1.4.1/dispatch.go:197 +0x42
panic({0x791480, 0xc00101e080})
        /usr/lib/go-1.18/src/runtime/panic.go:838 +0x207
github.com/markus-wa/godispatch.callConsumerCode.func1()
        /home/gonzo/go/pkg/mod/github.com/markus-wa/godispatch@v1.4.1/dispatch.go:122 +0x5f
panic({0x76bb00, 0xc000f05200})
        /usr/lib/go-1.18/src/runtime/panic.go:838 +0x207
github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs/sendtables.PropertyValue.S2UInt64(...)
        /home/gonzo/go/pkg/mod/github.com/markus-wa/demoinfocs-golang/v4@v4.0.0/pkg/demoinfocs/sendtables/propdecoder.go:152
github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs.(*parser).bindPlayerWeaponsS2.func3({{0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, 0x0}, {0x8b1990, 0x0}, ...})
        /home/gonzo/go/pkg/mod/github.com/markus-wa/demoinfocs-golang/v4@v4.0.0/pkg/demoinfocs/datatables.go:732 +0x93
github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs/sendtables2.(*Parser).OnPacketEntities(0xc0000a6190, 0xc000596270)
        /home/gonzo/go/pkg/mod/github.com/markus-wa/demoinfocs-golang/v4@v4.0.0/pkg/demoinfocs/sendtables2/entity.go:568 +0x8f9
reflect.Value.call({0x743720?, 0xc00000c5d0?, 0xc0002e7ad0?}, {0x84030e, 0x4}, {0xc000b93f08, 0x1, 0x0?})
        /usr/lib/go-1.18/src/reflect/value.go:556 +0x845
reflect.Value.Call({0x743720?, 0xc00000c5d0?, 0x0?}, {0xc000b93f08, 0x1, 0x1})
        /usr/lib/go-1.18/src/reflect/value.go:339 +0xbf
github.com/markus-wa/godispatch.callConsumerCode({0x743720?, 0xc00000c5d0?, 0x8230c0?}, {0xc000b93f08?, 0xc000a80000?, 0x436656?})
        /home/gonzo/go/pkg/mod/github.com/markus-wa/godispatch@v1.4.1/dispatch.go:125 +0x4a
github.com/markus-wa/godispatch.(*Dispatcher).Dispatch(0xc00009c300, {0x8230c0?, 0xc000596270})
        /home/gonzo/go/pkg/mod/github.com/markus-wa/godispatch@v1.4.1/dispatch.go:111 +0x293
github.com/markus-wa/godispatch.(*Dispatcher).dispatchWithRecover(0xc00009c300?, {0x8230c0?, 0xc000596270?})
        /home/gonzo/go/pkg/mod/github.com/markus-wa/godispatch@v1.4.1/dispatch.go:202 +0x5a
github.com/markus-wa/godispatch.(*Dispatcher).dispatchQueue(0xc00009c300, 0x0?)
        /home/gonzo/go/pkg/mod/github.com/markus-wa/godispatch@v1.4.1/dispatch.go:177 +0xb1
created by github.com/markus-wa/godispatch.(*Dispatcher).AddQueues
        /home/gonzo/go/pkg/mod/github.com/markus-wa/godispatch@v1.4.1/dispatch.go:162 +0x18e
panic: failed to parse demo: interface conversion: interface {} is *sendtables2.fieldState, not uint64
stacktrace:
goroutine 6 [running]:
runtime/debug.Stack()
        /usr/lib/go-1.18/src/runtime/debug/stack.go:24 +0x65
github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs.NewParserWithConfig.func1({0x791480, 0xc00101e080})
        /home/gonzo/go/pkg/mod/github.com/markus-wa/demoinfocs-golang/v4@v4.0.0/pkg/demoinfocs/parser.go:388 +0x30
github.com/markus-wa/godispatch.(*Dispatcher).dispatchWithRecover.func1()
        /home/gonzo/go/pkg/mod/github.com/markus-wa/godispatch@v1.4.1/dispatch.go:197 +0x42
panic({0x791480, 0xc00101e080})
        /usr/lib/go-1.18/src/runtime/panic.go:838 +0x207
github.com/markus-wa/godispatch.callConsumerCode.func1()
        /home/gonzo/go/pkg/mod/github.com/markus-wa/godispatch@v1.4.1/dispatch.go:122 +0x5f
panic({0x76bb00, 0xc000f05200})
        /usr/lib/go-1.18/src/runtime/panic.go:838 +0x207
github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs/sendtables.PropertyValue.S2UInt64(...)
        /home/gonzo/go/pkg/mod/github.com/markus-wa/demoinfocs-golang/v4@v4.0.0/pkg/demoinfocs/sendtables/propdecoder.go:152
github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs.(*parser).bindPlayerWeaponsS2.func3({{0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, 0x0}, {0x8b1990, 0x0}, ...})
        /home/gonzo/go/pkg/mod/github.com/markus-wa/demoinfocs-golang/v4@v4.0.0/pkg/demoinfocs/datatables.go:732 +0x93
github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs/sendtables2.(*Parser).OnPacketEntities(0xc0000a6190, 0xc000596270)
        /home/gonzo/go/pkg/mod/github.com/markus-wa/demoinfocs-golang/v4@v4.0.0/pkg/demoinfocs/sendtables2/entity.go:568 +0x8f9
reflect.Value.call({0x743720?, 0xc00000c5d0?, 0xc0002e7ad0?}, {0x84030e, 0x4}, {0xc000b93f08, 0x1, 0x0?})
        /usr/lib/go-1.18/src/reflect/value.go:556 +0x845
reflect.Value.Call({0x743720?, 0xc00000c5d0?, 0x0?}, {0xc000b93f08, 0x1, 0x1})
        /usr/lib/go-1.18/src/reflect/value.go:339 +0xbf
github.com/markus-wa/godispatch.callConsumerCode({0x743720?, 0xc00000c5d0?, 0x8230c0?}, {0xc000b93f08?, 0xc000a80000?, 0x436656?})
        /home/gonzo/go/pkg/mod/github.com/markus-wa/godispatch@v1.4.1/dispatch.go:125 +0x4a
github.com/markus-wa/godispatch.(*Dispatcher).Dispatch(0xc00009c300, {0x8230c0?, 0xc000596270})
        /home/gonzo/go/pkg/mod/github.com/markus-wa/godispatch@v1.4.1/dispatch.go:111 +0x293
github.com/markus-wa/godispatch.(*Dispatcher).dispatchWithRecover(0xc00009c300?, {0x8230c0?, 0xc000596270?})
        /home/gonzo/go/pkg/mod/github.com/markus-wa/godispatch@v1.4.1/dispatch.go:202 +0x5a
github.com/markus-wa/godispatch.(*Dispatcher).dispatchQueue(0xc00009c300, 0x0?)
        /home/gonzo/go/pkg/mod/github.com/markus-wa/godispatch@v1.4.1/dispatch.go:177 +0xb1
created by github.com/markus-wa/godispatch.(*Dispatcher).AddQueues
        /home/gonzo/go/pkg/mod/github.com/markus-wa/godispatch@v1.4.1/dispatch.go:162 +0x18e

goroutine 1 [running]:
log.Panic({0xc00008df40?, 0x738c40?, 0x855f68?})
        /usr/lib/go-1.18/src/log/log.go:385 +0x65
main.main()
        /home/gonzo/Refrag/2d-demo-parser/cmd/main.go:38 +0x1f2

@micvbang
Copy link
Contributor

I have the same experience as @akiver - not seeing this issue on noesis.gg.
What machine are you running this on? OS and processor architecture?

@maddenbjames
Copy link
Author

maddenbjames commented Nov 22, 2023

Running this on WSL on Windows 11.

On WSL im running Ubuntu 22.04

@markus-wa
Copy link
Owner

@maddenbjames would you be able to create a zip with the full code code including go.mod & go.sum that you are using?

@maddenbjames
Copy link
Author

Yeah, here is the attached file.

Its too big to upload here so here is the download
Google Drive: https://drive.google.com/file/d/1MndKeZneUirM_RVROW8NSw4vJS60tdNY/view?usp=sharing

@maddenbjames
Copy link
Author

Hmm - I run the exact same code on my macbook and it seems to work. Maybe a weird issue related to WSL Ubuntu?

@maddenbjames
Copy link
Author

I figured it out, sorry for the trouble. Turns out that I had an outdated gopls version via VS Code and it was messing with a lot of go related stuff. Seems to be working as expected.

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

4 participants