Skip to content

Heavy concurrency during hook creation causes erratic runtime behaviour #16

@goaaats

Description

@goaaats

Hi! We recently did a big refactor on our project that introduced parallel component/plugin loads, leading to a lot of hooks being created at the same time. This, on fast machines, seemingly leads to erratic runtime behaviour from reloaded-created hooks, such as:

  • Access violations when hooked function is called
  • Detour isn't being called
  • Original function call doesn't respect detoured arguments, is instead being called with original arguments (this one was particularly annoying to identify)

Sadly, none of our devs are running into this, as it seemingly only happens to users on very fast machines, making it very hard to collect more details about the issue. We already placed a lock around Reloaded hook .ctors in order to have them succeed.

Switching to our MinHook-based backend that we have to troubleshoot issues like this, but don't use in production, resolves the issue. Disposing the misbehaving Reloaded hook, then recreating it at idle when no other hooks are being created, resolves the issue.

Is this a known problem/limitation? Is there anything we could do/log that could help with troubleshooting this?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions