Random crashes when selecting inventory items

Started by Grundislav, Tue 04/02/2025 23:52:28

Previous topic - Next topic

Grundislav

Hi,

I've had a couple of beta testers for Rosewater report random crashes, without any clear indication of scripts or lines where the errors are being caused. As far as I can tell, the only common factor is that the crash happens when they "select" an inventory item using the custom UI. I've been sent a CrashInfo.dmp file, but I can't make sense of it.

Any insight would be appreciated!

https://www.dropbox.com/scl/fi/98oeeul8v04ipijun1ce3/CrashInfo.3.6.0.58.dmp?rlkey=eulqmxl5s6x2djzi29padqa1l&dl=0


Crimson Wizard

#1
I cannot read much of the info from this crash dump without the original game.exe, apparently. Is there a way I could get one?

Other than that, the dump mentions a "invalid memory access" error.
Judging by the context, a common case is when you use dynamic sprites assigned to a game object, delete that sprite but forget to replace the graphic assignment. The older engines could crash trying to draw that non-existing sprite on screen. That's just one possibility that I may mention.

Crimson Wizard

@Grundislav I checked this out with the game exe, and situation is following.

What I can see is that the crash occurs when the game is trying to get sprite 23994, which is presumably set as a active inventory's cursor graphic.
If I am correct, it looks like the topmost normal sprite in game is 23974, which means that 23994 is a dynamic sprite. But for some reason, the location of crash is pointing to an attempt to load the sprite of this number from game assets, which should not happen. I can't tell if that's a mistake in engine logic that I cannot see, or the crash dump not pointing to a correct place in source code.

In any case, this must be related to a dynamic sprite that was deleted but not removed from the inventory item.

Do these users who reported the bug have any save made just before the crash? If they do, I could use it to see what happens exactly under the debugger.

Crimson Wizard

#3
For the reference: it turned out that 3.6.0 engine has a bug where assigning any non-existant sprite number to a game object (such as a cursor) causes engine to corrupt the sprite cache, after which it may crash at any random point (even if the cursor is fixed afterwards).
(idk how the invalid number got there in the first place, but that's another issue)

Given this is affecting a game in beta stage, when it's too late to update to the next 3.6.1 version, I might release a new small patch for 3.6.0 with the safety fix.

SMF spam blocked by CleanTalk