Page 1 of 1

[StrangePan] [1.1.41] Crash: InventoryGuiSlot.cpp:220: No itemstack found

Posted: Wed Sep 29, 2021 2:05 pm
by Xorimuth
My game crashed whilst I was testing some new changes I'd made to my mod Spidertron Weapon Switcher (but I haven't recently changed any code around the spidertron switching which is where the crash was). Attached is the save and the current development version of the mod. Also uses EditorExtensions, flib and spidertron-extended.

I loaded the save, switched each spidertron to shotgun-mode, tested the shotgun range for each. I then went to editor mode and placed some more lab tiles.

I then got some flamethrower ammo from my inventory and went through each spidertron switching them to flamethrower-mode. It crashed as soon as I switched the 3rd, MK3, spidertron. I think I was holding flamethrower ammo in my hand at the time, I was in the MK3 spidertron, and the spidertron inventory wasn't open.

I can't replicate the crash based on the above info though and I've never seen it happen before. Presuming that it was caused by something my mod did, if you like you can follow the mod code from line 93 in control.lua where it made its last console log().
factorio-current new crash.log
(29.81 KiB) Downloaded 130 times
Vehicle weapon range test.zip
(1.93 MiB) Downloaded 115 times
SpidertronWeaponSwitcher_1.2.4.zip
(40.24 KiB) Downloaded 110 times

Re: [1.1.41] Crash: InventoryGuiSlot.cpp:220: No itemstack found

Posted: Tue Oct 12, 2021 6:47 pm
by StrangePan
Thanks for the bug report Xorimuth! The attached files and description help a lot.

I was able to reproduce the issue consistently with the following steps:
1. enter spidertron mk3
2. move mouse to equipment gui (weapons & ammo)
3. on the same frame a tooltip would pop up, press CTRL+TAB to switch modes (takes a few tries)

There's an timing issue with creating a tooltip on the same frame the player's vehicle is destroyed.

Re: [1.1.41] Crash: InventoryGuiSlot.cpp:220: No itemstack found

Posted: Wed Oct 13, 2021 12:25 am
by Xorimuth
StrangePan wrote:
Tue Oct 12, 2021 6:47 pm
Thanks for the bug report Xorimuth! The attached files and description help a lot.

I was able to reproduce the issue consistently with the following steps:
1. enter spidertron mk3
2. move mouse to equipment gui (weapons & ammo)
3. on the same frame a tooltip would pop up, press CTRL+TAB to switch modes (takes a few tries)

There's an timing issue with creating a tooltip on the same frame the player's vehicle is destroyed.
Impressive work, well done!

I suppose that it is (almost if not completely) impossible to trigger this bug in vanilla, hence why it hasn’t come up before now!

Re: [1.1.41] Crash: InventoryGuiSlot.cpp:220: No itemstack found

Posted: Wed Oct 13, 2021 1:07 am
by StrangePan
Xorimuth wrote:
Wed Oct 13, 2021 12:25 am
I suppose that it is (almost if not completely) impossible to trigger this bug in vanilla, hence why it hasn’t come up before now!
I was curious about that, so I rigged up a scenario in vanilla that's far more difficult to reproduce consistently, but still works:

1. place an artillery turret & load it up
2. place a vehicle (car, tank, or spidertron)
3. enter vehicle
4. target the vehicle with the artillery remote
5. move mouse to vehicle's weapon & ammo bar
6. try to trigger a tooltip the same frame the vehicle is destroyed by the incoming artillery shell

It's convoluted, and there may be easier ways to trigger this, but I was able to get the same crash in vanilla using this technique (and about 30 cars).

Re: [StrangePan] [1.1.41] Crash: InventoryGuiSlot.cpp:220: No itemstack found

Posted: Wed Oct 27, 2021 8:39 pm
by Xorimuth
The fix in 1.1.44 seems to work - thanks! :)

Re: [StrangePan] [1.1.41] Crash: InventoryGuiSlot.cpp:220: No itemstack found

Posted: Wed Oct 27, 2021 10:40 pm
by StrangePan
No problem, thanks for the report! I had fun with your mod too.