Mysterious crashes in rust algos

Mysterious crashes in rust algos
0

#1

Hi there! I created a Rust algo, and when I play it locally or in the playground, it doesn’t crash. It also doesn’t crash most of the time in matches. However, today I found out this weird crash. When I open up the replays in the playground (which are attached below), I noticed that in the second last frame, my health was dropped by 31. Has anyone face the same issue?

I’ve checked most of my code and I don’t think it should crash. Since we can’t access crash logs, what are some ways to debug this?

Thanks in advance!

https://terminal.c1games.com/watch/4169524
https://terminal.c1games.com/watch/4169483


#2

Hi @steven, Given you crashed the turn after the opponent removed one of their walls, I’m betting the crash is due to the same double-removal bug I’ve seen with my rust algos.

The short explanation is it’s a problem with the engine allowing a bad game state and the rust code raises an error when it decodes that bad game state:

That same thread has a code fix you can make to avoid the bad game state without crashing.


#3

Ah I see. Actually I just saw your question/post and added the fix. It seems like it’s not crashing now. Thanks!