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

avm1: Do not unwrap parent when removing objects pending removal #19462

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

kjarosh
Copy link
Member

@kjarosh kjarosh commented Feb 7, 2025

Turns out that sometimes objects pending removal do not have a parent.

I wasn't able to reproduce it, but it happens as we can see in error reports.

Semantically this should be fine, as we mainly operate on the parent here, but it's hard to be sure considering it's not reproducible. It's better than panicking for sure.

@kjarosh kjarosh added A-avm1 Area: AVM1 (ActionScript 1 & 2) T-fix Type: Bug fix (in something that's supposed to work already) labels Feb 7, 2025
Copy link
Collaborator

@evilpie evilpie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Crashing doesn't help anyone when we can't even reproduce it.

@torokati44
Copy link
Member

Is it possible that parent and child are set as "pending removal" at once, and the parent just happened to get removed first, in the same loop? 🤔 Just a blind guess...

@torokati44 torokati44 enabled auto-merge (rebase) February 12, 2025 17:14
Turns out that sometimes objects pending removal do not have a parent.

I wasn't able to reproduce it, but it happens as we can see in error
reports.

Semantically this should be fine, as we mainly operate on the parent
here, but it's hard to be sure considering it's not reproducible.
It's better than panicking for sure.
@torokati44 torokati44 merged commit 77583f0 into ruffle-rs:master Feb 12, 2025
22 checks passed
@kjarosh
Copy link
Member Author

kjarosh commented Feb 12, 2025

Is it possible that parent and child are set as "pending removal" at once, and the parent just happened to get removed first, in the same loop? 🤔 Just a blind guess...

That's one of the scenarios I considered, but I failed to reproduce it :/

@kjarosh kjarosh deleted the avm1-removal-parent branch February 12, 2025 19:40
@kjarosh
Copy link
Member Author

kjarosh commented Feb 14, 2025

To be honest, I think there's a general problem of synchronization between render list, depth list, and parent relationships. That's what other issues suggest.

Hancock33 added a commit to Hancock33/batocera.piboy that referenced this pull request Feb 16, 2025
----------------------------------------------------
pcsx2.mk v2.3.154 # Version: Commits on Feb 12, 2025
----------------------------------------------------
- [Tools: Add additional options for dumping in GS runner.](PCSX2/pcsx2#12229)

,

-----------------------------------------------------------------------------------
play.mk e46557675bf6f0936475168e3fadd49abe9742a4 # Version: Commits on Feb 12, 2025
-----------------------------------------------------------------------------------
Use proper preprocessor macro.,

---------------------------------------------------------------
ruffle.mk nightly-2025-02-13 # Version: Commits on Feb 13, 2025
---------------------------------------------------------------
## What's Changed

* chore: Bump a subset of indirect Rust dependencies by @torokati44 in ruffle-rs/ruffle#19500

* avm1: Don't use a static `AvmString` for AVM1 array's length property by @moulins in ruffle-rs/ruffle#19480

* avm1: Do not unwrap parent when removing objects pending removal by @kjarosh in ruffle-rs/ruffle#19462

* avm1: avoid creating a temporary `Vec` in `Array.prototype.splice` by @moulins in ruffle-rs/ruffle#19504

**Full Changelog**: ruffle-rs/ruffle@nightly-2025-02-12...nightly-2025-02-13,

--------------------------------------------------------------------------------------
shadps4.mk 6e1264215179e24c4e8c58b00df8a9f78da7a2f6 # Version: Commits on Feb 13, 2025
--------------------------------------------------------------------------------------
shader_recompiler: Lower non-compute shared memory into spare VGPRs. (#2403),

---------------------------------------------------------------------------------------------
solarus-engine.mk 676a87f5640c2acdcd3d86ff45fe295129b6b48c # Version: Commits on Feb 13, 2025
---------------------------------------------------------------------------------------------
Merge branch 'hhromic/cicd' into 'dev'

---------------------------------------------------------------------------------------
thextech.mk 5a6d83efe49ec8740d52d54eea8cbd489bc811e4 # Version: Commits on Feb 13, 2025
---------------------------------------------------------------------------------------
Add sound thread to do non-blocking SFX (#903)

* Add sound thread to do non-blocking SFX

* Update changelog.txt

* Don't include sound_thread.cpp when disabled

* sound.h: Fixed the PlaySfx_Blocking prototype

---------

Co-authored-by: Wohlstand <admin@wohlnet.ru>,

------------------------------------------------------------------------------------------
devilutionx.mk 420b569d4901c1438d891cee2080950016d13f16 # Version: Commits on Feb 13, 2025
------------------------------------------------------------------------------------------
Update cache version of Linux CI build scripts,

----------------------------------------------------------------------------------------
retroarch.mk a6ea47df15970dfe753f2a56ecfecbd652615f69 # Version: Commits on Feb 13, 2025
----------------------------------------------------------------------------------------
Fetch translations from Crowdin,

-----------------------------------------------------------------------------------------
sonic3-air.mk c54f56b537dc231a4c2c9fffd2e9aa7235aab7c4 # Version: Commits on Feb 12, 2025
-----------------------------------------------------------------------------------------
When script compilation fails in dev mode, ask whether to retry compilation right away,

------------------------------------------------------------------------------------------
xash3d-fwgs.mk 0dd5a6041047b8d9834d9eaf2b596b26014f6cc9 # Version: Commits on Feb 12, 2025
------------------------------------------------------------------------------------------
3rdparty: gl4es: update submodule,

--------------------------------------------------------------------------------------------
libretro-play.mk e46557675bf6f0936475168e3fadd49abe9742a4 # Version: Commits on Feb 12, 2025
--------------------------------------------------------------------------------------------
Use proper preprocessor macro.,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-avm1 Area: AVM1 (ActionScript 1 & 2) newsworthy T-fix Type: Bug fix (in something that's supposed to work already)
Projects
None yet
4 participants