|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0002652||FSSCP||gameplay||public||2012-05-16 12:33||2012-07-01 21:21|
|Product Version||3.6.14 RC5|
|Target Version||3.6.14||Fixed in Version|
|Summary||0002652: Bombs on destroyed subsystem causes crash.|
|Description||I've now reliably encountered this on RC6 as well as Trunk.|
If a bomb is targetting a subsystem on a ship, and that ship/subsystem is destroyed before the bomb impacts it, it will sometimes try to target that same subsystem, but on a different ship.
So, for example, a bomb is fired. It is targetting turret07 on Ship A. Ship A or it's turret07 is destroyed before the bomb makes impact. The bomb starts looking for a new target and chooses Ship B, but then tries to target turret 07 on Ship B. The problem is that Ship B doesn't have turret 07.
|Steps To Reproduce||Play a mission with lots of bomb action? It's somewhat random because such specific events need to occur.|
I'm trying to find a retail mission where it happens most often.
|Additional Information||I once traced through the code with Valathil and Goober when this first happened. That's what showed that the bomb was targetting a subsystem that doesn't exist on a new ship.|
It was originally with custom bombs, so I used the flag "no subsystem homing" which solved the crash.
Just recently I encountered it with retail bombs.
|Tags||No tags attached.|
What is the correct behaviour in this case?
Should the bomb go dumbfire when its target is destroyed? Should the bomb self destruct? or Should the bomb attempt to lock another target?
My guess is that it really just needs some error checking. If subsystem is not found on the current target, find a new subsystem.
That coupled with if the current target is destroyed, be sure to clear all current targeting data including the subsystem.
|I think I have found the cause. What type homing weapon is this, heat or aspect? IIRC retail bombs are all aspect seekers.|
|Yeah, they are aspect seeking.|
|Please try with the attached patch. It should make all homing weapons drop their subsystem if the target object changes.|
|I've uploaded a small modpack. The mission included crashes 80% of the time for me with the same error. I also included the capship torpedos because I haven't tested enough to confirm any bombs other than those torpedos and the Helios trigger the crash (even though it seems quite likely).|
I did get an assertion to trigger, hopefully its the same one that you were getting.
Assert: ship_obj->type == OBJ_SHIP
ntdll.dll! ZwWaitForSingleObject + 21 bytes
kernel32.dll! WaitForSingleObjectEx + 67 bytes
kernel32.dll! WaitForSingleObject + 18 bytes
fs2_open_3_6_13d_INF_SSE2.exe! SCP_DumpStack + 354 bytes
fs2_open_3_6_13d_INF_SSE2.exe! WinAssert + 208 bytes
fs2_open_3_6_13d_INF_SSE2.exe! find_submodel_instance_point + 66 bytes
fs2_open_3_6_13d_INF_SSE2.exe! find_submodel_instance_world_point + 47 bytes
fs2_open_3_6_13d_INF_SSE2.exe! get_subsystem_pos + 162 bytes
fs2_open_3_6_13d_INF_SSE2.exe! get_subsystem_world_pos + 47 bytes
fs2_open_3_6_13d_INF_SSE2.exe! weapon_home + 1812 bytes
fs2_open_3_6_13d_INF_SSE2.exe! weapon_process_post + 1527 bytes
fs2_open_3_6_13d_INF_SSE2.exe! obj_move_all_post + 108 bytes
fs2_open_3_6_13d_INF_SSE2.exe! obj_move_all + 367 bytes
fs2_open_3_6_13d_INF_SSE2.exe! game_simulation_frame + 1116 bytes
fs2_open_3_6_13d_INF_SSE2.exe! game_frame + 468 bytes
fs2_open_3_6_13d_INF_SSE2.exe! game_do_frame + 242 bytes
fs2_open_3_6_13d_INF_SSE2.exe! game_do_state + 403 bytes
fs2_open_3_6_13d_INF_SSE2.exe! gameseq_process_events + 237 bytes
fs2_open_3_6_13d_INF_SSE2.exe! game_main + 782 bytes
fs2_open_3_6_13d_INF_SSE2.exe! WinMain + 330 bytes
fs2_open_3_6_13d_INF_SSE2.exe! __tmainCRTStartup + 322 bytes
fs2_open_3_6_13d_INF_SSE2.exe! WinMainCRTStartup + 15 bytes
kernel32.dll! BaseThreadInitThunk + 18 bytes
ntdll.dll! RtlInitializeExceptionChain + 99 bytes
ntdll.dll! RtlInitializeExceptionChain + 54 bytes
What follows are my notes:
Assertion caused by a Howell missile launched by an Osiris trying to get the position of turret05 of Helios launched by a ship that no longer exists. Neither capital ship has exploded. The Howell was jammed?
The Osiris that launched the Howell has the weapons subsystem of the Intrepid targeted. Has no last targeted subsystem. The Intrepid only has turret05a in its subsystem list.
That's it, yup.
The Howell was launched by an Osiris? Odd, I don't think any of the Osiris have Howell in their loadout...
Howells are launched by the Orion and Aratrums are launched by the Typhon.
Regardless, the mission has no jamming or events of any kind really. Just the capships and bombers showing up and fighting with arrival cues.
|Hmm, so the plot thickens.|
After debugging the assert I think I found the cause of the problem. Apparently the homing object of the weapon gets corrupted of the homing subsystem is destroyed. Somehow it gets set to another object which may or may not be a ship, if it isn't then the assert pops up but if it isn't then the weapon will home onto the turrets position on another ship.
This can be fixed by adding a homing object signature check before homing onto it to prevent bad things from happening.
With that change in place I haven't encountered any crashes and a weapon that looses the subsystem should continue on the current trajectory but I was unable to observe that.
|My testing confirms the patch works.|
Okay, the patch isn't what needs to be done. It adds a functionality which is redundant with what is already there, which is supposed to already work.
The actual cause of the problem, the code that "corrupts the homing object", isn't addressed in this patch. That code needs to be found in order for the problem to be truly solved.
|Fix committed to trunk@8869.|
|Valathil's research revealed that the cause of the bug was a turret changing its target to another ship without also changing its targeted subsystem.|
|Fix committed to fs2_open_3_6_14@8953.|
fs2open: trunk r8866
Timestamp: 2012-06-10 22:40:05
|fix some aspects of homing (pun not intended), including hopefully Mantis 0002652|
|mod - /trunk/fs2_open/code/weapon/weapons.cpp|
fs2open: trunk r8869
Timestamp: 2012-06-10 23:22:48
|Valathil's fix for Mantis 0002652|
|mod - /trunk/fs2_open/code/ai/aiturret.cpp|
fs2open: fs2_open_3_6_14 r8952
Timestamp: 2012-07-01 21:21:44
|Backport: Trunk r8456/8866/8867/8868; Made subsystems contain an objnum reference to their parent ship.
fix some aspects of homing (pun not intended), including hopefully Mantis 0002652
remove the vestiges of free_flight_time, which never worked
remove the unnecessary null sets
|mod - /branches/fs2_open_3_6_14/code/ship/ship.cpp|
|mod - /branches/fs2_open_3_6_14/code/ship/ship.h|
|mod - /branches/fs2_open_3_6_14/code/weapon/weapon.h|
|mod - /branches/fs2_open_3_6_14/code/weapon/weapons.cpp|
fs2open: fs2_open_3_6_14 r8953
Timestamp: 2012-07-01 21:22:20
|Backport: Trunk r8869; Valathil's fix for Mantis 0002652|
|mod - /branches/fs2_open_3_6_14/code/ai/aiturret.cpp|
|2012-05-16 12:33||MjnMixael||New Issue|
|2012-05-19 23:38||iss_mneur||Note Added: 0013568|
|2012-05-19 23:38||iss_mneur||Status||new => feedback|
|2012-05-20 08:12||MjnMixael||Note Added: 0013574|
|2012-05-20 08:12||MjnMixael||Status||feedback => new|
|2012-05-20 16:25||iss_mneur||Note Added: 0013580|
|2012-05-20 16:25||iss_mneur||Assigned To||=> iss_mneur|
|2012-05-20 16:25||iss_mneur||Status||new => feedback|
|2012-05-20 16:25||iss_mneur||Target Version||=> 3.6.14|
|2012-05-20 16:29||MjnMixael||Note Added: 0013581|
|2012-05-20 16:29||MjnMixael||Status||feedback => assigned|
|2012-05-20 16:39||iss_mneur||File Added: mantis_2652.patch|
|2012-05-20 16:41||iss_mneur||Note Added: 0013582|
|2012-05-20 16:41||iss_mneur||Status||assigned => feedback|
|2012-05-21 00:05||MjnMixael||File Added: BombTestCrash.7z|
|2012-05-21 00:06||MjnMixael||Note Added: 0013588|
|2012-05-21 00:06||MjnMixael||Status||feedback => assigned|
|2012-05-21 03:04||iss_mneur||Note Added: 0013591|
|2012-05-21 03:04||iss_mneur||Status||assigned => feedback|
|2012-05-21 08:43||MjnMixael||Note Added: 0013597|
|2012-05-21 08:43||MjnMixael||Status||feedback => assigned|
|2012-05-21 09:19||iss_mneur||Note Added: 0013598|
|2012-06-08 06:21||m_m||Note Added: 0013637|
|2012-06-08 06:21||m_m||File Added: mantis2652.patch|
|2012-06-08 10:00||MjnMixael||Note Added: 0013638|
|2012-06-09 14:10||Goober5000||Note Added: 0013649|
|2012-06-10 22:39||Goober5000||Changeset attached||=> fs2open trunk r8866|
|2012-06-10 23:22||Goober5000||Changeset attached||=> fs2open trunk r8869|
|2012-06-10 23:22||Goober5000||Note Added: 0013654|
|2012-06-10 23:22||Goober5000||Status||assigned => resolved|
|2012-06-10 23:22||Goober5000||Resolution||open => fixed|
|2012-06-10 23:23||Goober5000||Assigned To||iss_mneur => Valathil|
|2012-06-10 23:24||Goober5000||Note Added: 0013655|
|2012-07-01 21:21||Zacam||Changeset attached||=> fs2open fs2_open_3_6_14 r8952|
|2012-07-01 21:21||Zacam||Changeset attached||=> fs2open fs2_open_3_6_14 r8953|
|2012-07-01 21:21||Zacam||Note Added: 0013765|