Some games exhibit freeze in game play because they implement something like: - upon an event (exception...) - use toolhelp to get a snapshot of self loaded modules, - call SymLoadModule() on each module, - furthermore, they keep their dbghelp session active, and redo the process above when a new event occurs.
This ends up with trying to reload at the very same base address each one of the already loaded modules.
Native implements a fast exit path when asking to load a module at the exact same base address of an already loaded one: it simply bails out (without checking anything else).
Builtin is way more slow (it resync:s ELF/Mach-o module list, load the new module before actually dropping at the end of the process).
This can result in second of relay.
This serie adds the tests for supporting above claim and fix it.
Credit to Paul Gofman for triaging this behavior.