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

In-Game: [YYC] Crash when using nested accessors in combination with with() #6128

Closed
JujuAdams opened this issue Jun 5, 2024 — with GM Bug Reporter · 4 comments
Closed
Assignees
Labels
project This issue has a sample project attached runner-bug In-game bugs with the "GameMaker Studio 2" runtimes
Milestone

Comments

@JujuAdams
Copy link

JujuAdams commented Jun 5, 2024

Description

This error has been confirmed in "IDE v2024.4.0.137 Runtime v2024.4.0.168" and "Beta IDE v2024.600.0.562 Beta Runtime v2024.600.0.580". It affects tested platforms Windows, macOS, iOS, and Android and likely affects others. This issue is a critical blocker for us.

Only when running in YYC, the game crashes claiming that an array access is out of bounds. The array in question is of length 4 and this array access should be legal. This error is only shown in a networked multiplayer game mode and the error may be related.

ERROR!!! :: ############################################################################################
ERROR in
action number 1
of Create Event
for object obj_RoomManager:


array_get :: Index [1] out of range [1]############################################################################################
gml_Script_RoomManagerGetScript (line 29)
gml_Script_RoomManagerInit (line 9)
gml_Object_obj_RoomManager_Create_0 (line 27)

If a workaround is implemented, gameplay will continue past this point. However, another similar error is shown after completing an event:

############################################################################################
ERROR in
action number 1
of  Step Event0
for object obj_page_ResultsSync:

array_get :: Index [1] out of range [1]############################################################################################
gml_Script_EventTemplateGetQualifyingScore (line 18)
gml_Script_EventPlaylistGetQualifyingScore (line 8)
gml_Script_ResultQualifies (line 11)
gml_Script_ResultsGetTableArray (line 78)
gml_Script_LeaguePointsCalculate (line 25)
gml_Script_EventCurrentCalculate (line 5)
gml_Script___SportShowPlaceHeadlineRPC (line 12)
gml_Script___Tick@anon@2000@__NetClassFunction@__NetClassFunction (line 88)
gml_Script___NetClassFunction (line 44)
gml_Script_NetFunctionExecuteAlways (line 49)
gml_Script_SportShowPlaceHeadline (line 5)
gml_Object_obj_page_ResultsSync_Step_0 (line 13)

If another workaround is implemented, gameplay can again proceed. However, yet another error occurs.

ERROR!!! :: ############################################################################################
ERROR in action number 1
of  Step Event0 for object obj_page_ResultsSync:
array_get :: Index [1] out of range [1]############################################################################################
gml_Script_CashInCurrentGetAll (line 8)
gml_Script_CashInPushEverything (line 110)
gml_Script_CashInPushEverythingForLocalPlayer (line 8)
gml_Script___SportShowPlaceHeadlineRPC (line 13)
gml_Script___Tick@anon@2000@__NetClassFunction@__NetClassFunction (line 88)
gml_Script___NetClassFunction (line 44)
gml_Script_NetFunctionExecuteAlways (line 49)
gml_Script_SportShowPlaceHeadline (line 5)
gml_Object_obj_page_ResultsSync_Step_0 (line 13)

This error appears to be caused by a nested accessor rather than a chained accessor which is significant as it may imply a different root problem.

I have not seen how far this goes and how many workarounds are required but it is not feasible for us to unpick every nested and chained accessor.

Steps To Reproduce

  1. Boot the game in VM for Windows, macOS, iOS, or Android
  2. Tap on Multiplayer -> Local Multiplayer -> Host a Game -> Next -> Sprint -> Play
  3. Wait for the Sprint event to begin. Play the event until the results table appears (if you are on desktop when alternately tap space + enter)
  4. Note the event progresses successfully and the player is able to continue gameplay
  5. Boot the game in YYC
  6. Repeat the navigation steps above
  7. Wait for the Sprint event to begin
  8. Note that the game crashes with an error message
  9. Check the debug log. Note that the relevant array is outputted into the debug log and has length 4
  10. Navigate to the line of code in the project. Note that a non-chained accessor read of the same information is successful
  11. Split the chained accessor at line 30 in RoomManagerGetScript()
  12. Follow steps 5 through 7 (in YYC). Note that the game does not show an error message at the same point
  13. Play the event. Note that the game shows a different error message
  14. Boot the game again in YYC
  15. Tap on Quick Play -> Sprint -> Play (i.e. avoid using networking)
  16. Wait for the event to load and tap on the "Next" button in the bottom right corner
  17. Play the event until the results table appears
  18. Note the event starts successfully and the player is able to continue gameplay

Which version of GameMaker are you reporting this issue for?

IDE v2024.600.0.562 Runtime v2024.600.0.580

Which operating system(s) are you seeing the problem on?

Windows 10.0.19045.0

Which platform(s) are you seeing the problem on?

Android, iOS, macOS, Windows

afcf200b-af04-4a34-9d73-9f027930fbe8

@gm-bug-reporter gm-bug-reporter bot added runner-bug In-game bugs with the "GameMaker Studio 2" runtimes project This issue has a sample project attached labels Jun 5, 2024
@rwkay rwkay self-assigned this Jun 6, 2024
@stuckie stuckie added this to the 2024.6 milestone Jun 6, 2024
@YYDan YYDan changed the title Crash exclusively in YYC when using nested and chained accessors, potentially related to networking In-Game: [YYC] Crash when using nested and chained accessors, potentially related to networking Jun 6, 2024
@rwkay
Copy link

rwkay commented Jun 6, 2024

Fixed in 2024.6 - in YYC variables are cached in local variables and these are potentially stale at the end of a with statement - the state of these are restored at the end of a with statement, unfortunately there was a bug that meant that it erroneously flagged an index error from this code that did not get reported until much later code was executed (the reported error was nowhere near the problem site)

@rwkay rwkay closed this as completed Jun 6, 2024
@JujuAdams
Copy link
Author

Confirmed fixed in Beta Runtime v2024.600.0.597

@mgeddesGM
Copy link

verified on Beta IDE v2024.600.0.579 Runtime v2024.600.0.605 for win and android

@Emc1923
Copy link

Emc1923 commented Jun 24, 2024

Verified in mac yyc as of Beta IDE v2024.600.0.579 Beta Runtime v2024.600.0.605.

@YYDan YYDan changed the title In-Game: [YYC] Crash when using nested and chained accessors, potentially related to networking In-Game: [YYC] Crash when using nested accessors in combination with with() Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project This issue has a sample project attached runner-bug In-game bugs with the "GameMaker Studio 2" runtimes
Projects
Status: Verified
Development

No branches or pull requests

5 participants