Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when ai is ordered to fly waypoints created by scripting, since Nightly 23.3.0-20231103 #6353

Open
Admiral-MS opened this issue Sep 14, 2024 · 2 comments · May be fixed by #6359
Open
Assignees
Labels
bug An issue from unintended consequences gameplay A feature or issue that can significantly impact gameplay

Comments

@Admiral-MS
Copy link

Waypoints created with the scripting function mn.createWaypoint() lead to a game crash when the Ai is ordered to fly the associated waypoint path. A simple test script and mission are attached, the game crashes a few seconds into the mission. The bug appears in Nightly 23.3.0-20231103 and still exists in the current 24.2.0-RC4, any build up to 20231102 works fine.

Debug error message:
Assert: "!aip->wp_list->get_waypoints().empty()"
File: aicode.cpp
Line: 4908
waypoint_testcase_crash_from_Nightly_20231103.zip

@wookieejedi wookieejedi added bug An issue from unintended consequences regression A bug introduced by a new feature that breaks something which used to work. labels Sep 14, 2024
@Goober5000 Goober5000 added scripting A feature or issue related to LUA scripting gameplay A feature or issue that can significantly impact gameplay and removed regression A bug introduced by a new feature that breaks something which used to work. scripting A feature or issue related to LUA scripting labels Sep 14, 2024
@Goober5000
Copy link
Contributor

Goober5000 commented Sep 14, 2024

This is an invalid pointer access due to a vector reallocation. The code will need to use an index rather than a pointer. It's the same problem as #5785, just with a different field in a different struct.

@Goober5000 Goober5000 self-assigned this Sep 14, 2024
@Goober5000
Copy link
Contributor

The fix is nearly ready to go, but will not be included in 24.2 due to its widespread scope.

Goober5000 added a commit to Goober5000/fs2open.github.com that referenced this issue Sep 18, 2024
Several locations in the code (notably `ai_info` and `waypoint_h`) previously stored pointers for waypoints and waypoint lists that need to be valid for more than one frame.  Since both waypoint lists and waypoint paths may change size, resulting in vector reallocation, the information should be stored as indexes instead.

Fixes scp-fs2open#6353.
@Goober5000 Goober5000 linked a pull request Sep 18, 2024 that will close this issue
Goober5000 added a commit to Goober5000/fs2open.github.com that referenced this issue Sep 18, 2024
Several locations in the code (notably `ai_info` and `waypoint_h`) previously stored pointers for waypoints and waypoint lists that need to be valid for more than one frame.  Since both waypoint lists and waypoint paths may change size, resulting in vector reallocation, the information should be stored as indexes instead.

Fixes scp-fs2open#6353.
Goober5000 added a commit to Goober5000/fs2open.github.com that referenced this issue Sep 18, 2024
Several locations in the code (notably `ai_info` and `waypoint_h`) previously stored pointers for waypoints and waypoint lists that need to be valid for more than one frame.  Since both waypoint lists and waypoint paths may change size, resulting in vector reallocation, the information should be stored as indexes instead.

Fixes scp-fs2open#6353.
Goober5000 added a commit to Goober5000/fs2open.github.com that referenced this issue Sep 18, 2024
Several locations in the code (notably `ai_info` and `waypoint_h`) previously stored pointers for waypoints and waypoint lists that need to be valid for more than one frame.  Since both waypoint lists and waypoint paths may change size, resulting in vector reallocation, the information should be stored as indexes instead.

Fixes scp-fs2open#6353.
Goober5000 added a commit to Goober5000/fs2open.github.com that referenced this issue Sep 18, 2024
Several locations in the code (notably `ai_info` and `waypoint_h`) previously stored pointers for waypoints and waypoint lists that need to be valid for more than one frame.  Since both waypoint lists and waypoint paths may change size, resulting in vector reallocation, the information should be stored as indexes instead.

Fixes scp-fs2open#6353.
Goober5000 added a commit to Goober5000/fs2open.github.com that referenced this issue Sep 18, 2024
Several locations in the code (notably `ai_info` and `waypoint_h`) previously stored pointers for waypoints and waypoint lists that need to be valid for more than one frame.  Since both waypoint lists and waypoint paths may change size, resulting in vector reallocation, the information should be stored as indexes instead.

Fixes scp-fs2open#6353.
Goober5000 added a commit to Goober5000/fs2open.github.com that referenced this issue Sep 19, 2024
Several locations in the code (notably `ai_info` and `waypoint_h`) previously stored pointers for waypoints and waypoint lists that need to be valid for more than one frame.  Since both waypoint lists and waypoint paths may change size, resulting in vector reallocation, the information should be stored as indexes instead.

Fixes scp-fs2open#6353.
Goober5000 added a commit to Goober5000/fs2open.github.com that referenced this issue Sep 19, 2024
Several locations in the code (notably `ai_info` and `waypoint_h`) previously stored pointers for waypoints and waypoint lists that need to be valid for more than one frame.  Since both waypoint lists and waypoint paths may change size, resulting in vector reallocation, the information should be stored as indexes instead.

Fixes scp-fs2open#6353.
Goober5000 added a commit to Goober5000/fs2open.github.com that referenced this issue Sep 19, 2024
Several locations in the code (notably `ai_info` and `waypoint_h`) previously stored pointers for waypoints and waypoint lists that need to be valid for more than one frame.  Since both waypoint lists and waypoint paths may change size, resulting in vector reallocation, the information should be stored as indexes instead.

Fixes scp-fs2open#6353.
Goober5000 added a commit to Goober5000/fs2open.github.com that referenced this issue Sep 19, 2024
Several locations in the code (notably `ai_info` and `waypoint_h`) previously stored pointers for waypoints and waypoint lists that need to be valid for more than one frame.  Since both waypoint lists and waypoint paths may change size, resulting in vector reallocation, the information should be stored as indexes instead.

Fixes scp-fs2open#6353.
Goober5000 added a commit to Goober5000/fs2open.github.com that referenced this issue Sep 21, 2024
Several locations in the code (notably `ai_info` and `waypoint_h`) previously stored pointers for waypoints and waypoint lists that need to be valid for more than one frame.  Since both waypoint lists and waypoint paths may change size, resulting in vector reallocation, the information should be stored as indexes instead.

Fixes scp-fs2open#6353.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue from unintended consequences gameplay A feature or issue that can significantly impact gameplay
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants