UFO:Alien Invasion

Technical support => Bugs in stable version (2.5) => Topic started by: apo on May 07, 2017, 02:36:58 pm

Title: Segmentation fault Item::getReactionFireWeaponType (this=0x0)
Post by: apo on May 07, 2017, 02:36:58 pm
Hi,

we had to recompile ufoai a few days ago because of the bug in ufo2map which we had discussed in a separate thread. Now the following happens: If I start a skirmish, I can already see the map but before all team members appear ufoai crashes with a segmentation fault. This is Debian bug https://bugs.debian.org/861979.

gdb shows a null pointer and some memory that can't be accessed. Any ideas why the game is suddenly crashing at this position? My debug.log is attached.



Title: Re: Segmentation fault Item::getReactionFireWeaponType (this=0x0)
Post by: geever on May 07, 2017, 06:36:39 pm
Thanks for reporting!

I managed to reproduce the problem in Campaign mode by removing the weapon from the first soldiers hand. The issue happens when the UI tries to check the reaction fire mode for the soldier who has no weapon in hand. Apparently we patched the code in 2013 already, but it wasn't good enough.

I got it fixed in 9cad041f0931b1f49e0c70f32e351a7227f0d2ff in branch ufoai_2.5. I'm going to check if the master branch is affected.

Thanks again!
-geever
Title: Re: Segmentation fault Item::getReactionFireWeaponType (this=0x0)
Post by: geever on May 07, 2017, 06:56:09 pm
Master didn't crash for me, but the code was affected, so I applied the patch there too (1258171073b5049c5699c80bbfad52362b4f3b80) - just in case.

-geever
Title: Re: Segmentation fault Item::getReactionFireWeaponType (this=0x0)
Post by: apo on May 07, 2017, 07:36:22 pm
Thank you for the quick fix!