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

ExecutionHook race condition #20

Open
art0007i opened this issue Dec 25, 2024 · 5 comments
Open

ExecutionHook race condition #20

art0007i opened this issue Dec 25, 2024 · 5 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@art0007i
Copy link
Contributor

currently the ExecutionHook is being called from inside FrooxEngine.EngineInitializer.InitializeFrooxEngine. this function creates a few initialization tasks and runs them alongside our execution hook using Task.WhenAll

tasks it's being ran alongside of:

  • Initializing connector fields for PlatformInterface
  • Initializing asset classes
  • Initializing workers

this can apparently cause some weird issues such as this badhaloninja/DeselectOwnGizmos#2

@art0007i
Copy link
Contributor Author

note that on neos the startup was completely synchronous, so it wasn't an issue back then, and it was never adjusted for resonite where the startup process has been made async

@XDelta XDelta added bug Something isn't working help wanted Extra attention is needed labels Dec 25, 2024
@XDelta
Copy link
Member

XDelta commented Dec 25, 2024

Know of any replication with just RML or without MonkeyLoader? From the linked issue, it isn't clear if it was caused by that being loaded or changing other functionality. Still can be something to improve here just hard to test for and validate the cause.

@art0007i
Copy link
Contributor Author

ye i can test it later but I assume it's true

fixing it might be a bit annoying though.

I think maybe instead of the execution hook loading mods directly it would patch that init func to run after it (it's what monkeyloader does to fix that)

@art0007i
Copy link
Contributor Author

miss clicked close and i cant reopen oops

@art0007i
Copy link
Contributor Author

ROTHORN - 2024.12.18.477 - 2024-12-25 20_20_05.log

bugged mod's code (very simple and probably shouldn't be gamebreaking)

public override void OnEngineInit()
{
    var x = AccessTools.Field(typeof(DevCreateNewForm), "root").GetValue(null);
    Debug(x == null);
    Debug(x);
    Debug(x == null);
}

@XDelta XDelta reopened this Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants