-
-
Notifications
You must be signed in to change notification settings - Fork 828
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
core: Fix endless loop in process_swf5_references
#9885
Conversation
Welcome and thank you for contributing! This looks good to me. Would you be able to create a regression test for this? |
Sure! I've not programmed in ActionScript before, but I'll see if I can put together a regression test. |
If you need help or would like someone else to try, just ask! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see a test added for this, otherwise LGTM
I've added a regression test and verified that it fails when run on the commit right before mine. As a note, I don't have adobe animate so I didn't have a way to verify that the FLA file is valid / non-giberish. I mostly just modified the original SWF file that caused the bug to only include the bare minimum and then used JPEXS to export the FLA project. |
After some experiments in JPEXS, here is an even more minimal SWF: Also, the FLA you exported from JPEXS doesn't produce an SWF that reproduces the issue. I don't think it's actually possible to create a FLA that reproduces the problem in this way, because the Flash authoring software does not produce frames that place and immediately remove an object. And the error does not occur in Ruffle if the object is not placed at all, or is placed and removed on different frames. Does the original game produce the error this way? I imagine that it must be removing the object some other way, not with a RemoveObject tag. |
Hmm, I'm not really sure as I've not used ActionScript before. The code I pasted in the first comment of this chain (including the zip) contains what I believe is the offending code. It does seem, however, that the original author of this game used paused frames to represent different rooms in each level, so I'm not sure. Also, I see that the PR was approved. What are the next steps? Let me know if I need to update anything else! |
I pushed a minimal test case reproing the issue; the crux is code executing inside a button's children after the button has been removed. Placing+removing on the same frame isn't important. There's still some issues here (tracing |
This commit fixes an issue where ruffle locks up while trying to resolve an item with non-MovieClip parents.
A simpliied test case to test the #9885, where a hang occurred when a button is removed while executing code in a v5 SWF.
This commit fixes an issue where ruffle locks up while trying to resolve an item with non-MovieClip parents.
While testing out the game
Mystery of Time and Space (MOTAS)
, I encountered a bug where any room with a clock caused ruffle to completely hang when loading a different room. After de-compiling the SWF with JPEXS, I noticed that by removing the following code it would no longer hang:After loading the game in
lldb
, I saw that it infintely looped onprocess_swf5_references
due to the wall clock not having anyMovieClip
parents up its chain, which I assume is caused by the following code which gets executed when changing rooms:After adding this change, the game no longer hangs.
Testing
The files and command I used for testing are as follows:
ruffle_desktop mysteryoftimeandspace.swf -P chat=chat -P sublevel=mystery2.swf -P menu=false
Once you have the game running, do the following:
Click on
Continue
Click on the left-most door
Click on the opening of the left-most door