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

Fix panics from self-referential amf3 objects #67

Merged
merged 3 commits into from
Sep 17, 2024

Conversation

CUB3D
Copy link
Collaborator

@CUB3D CUB3D commented Sep 14, 2024

This fixes some instances of the "failed to get object" panic in ruffle by no longer trying to handle value cycles

Now all object values are tagged with an ObjectId and the new Value::Amf3ObjectReference's refer back to this so consumers can choose how to handle cycles (e.g. in Ruffles case, via the GC)

Also moves raw-amf/byteobject tests into their own dir as they aren't part of the minerva tests and changed them from .sol -> .amf because they aren't lso files. Adds a test for amf3 cycles and improves the lso-to-json tool to support bulk-test json recreation and generating raw-amf tests

This fixes the following (requires a Ruffle patch as well):
ruffle-rs/ruffle#17902 - loads
ruffle-rs/ruffle#17782 - doesn't panic on load, avm2 error due to null object
ruffle-rs/ruffle#17709 - loads
ruffle-rs/ruffle#17336 - no swf to test, but probably a dupe of ruffle-rs/ruffle#17782
ruffle-rs/ruffle#14329 - doesn't panic on load, avm2 error due to null object
ruffle-rs/ruffle#13748 - loads
ruffle-rs/ruffle#10174 - doesn't panic on load, avm2 error due to null object
ruffle-rs/ruffle#10520 - loads

This fixes some instances of the "failed to get object" panic in ruffle by no longer trying to handle value cycles
Now all object values are tagged with an ObjectId and the new Value::Amf3ObjectReference's refer back to this so consumers can choose how to handle cycles (e.g. in Ruffles case, via the GC)

Also moves raw-amf/byteobject tests into their own dir, adds a test for amf3 cycles and improves the lso-to-json tool to support bulk-test json recreation and generating raw-amf tests
@torokati44
Copy link
Member

torokati44 commented Sep 15, 2024

Wowza, 87 changed files?! Something must have gone haywire... Though it seems, it's mostly "line terminator at end of file" stuff...? Still, I don't think those belong in this PR, even if intentional.

@CUB3D CUB3D mentioned this pull request Sep 16, 2024
@CUB3D
Copy link
Collaborator Author

CUB3D commented Sep 16, 2024

Wowza, 87 changed files?! Something must have gone haywire... Though it seems, it's mostly "line terminator at end of file" stuff...? Still, I don't think those belong in this PR, even if intentional.

So some of those are intentional, as the enum format has changed so the files needed regenerating. But yes I was missing the newlines on the unchanged ones, fixed now.

@torokati44 torokati44 merged commit 49ba7e5 into master Sep 17, 2024
1 check passed
@torokati44 torokati44 deleted the fix_failed_to_get_object branch September 17, 2024 23:46
@torokati44
Copy link
Member

Thank you! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants