Open Gh0u1L5 opened 6 years ago
The workarounds are quite straightforward: one of the module is using multi-thread when hook the methods; forcing it to do all the works in a single thread or waiting until all the threads finish can solve the problem. Apparently, Xposed will not load next module until the handleLoadPackage / handleInitPackageResources function of current module terminates -- I guess that is why this race condition haven't been noticed before. The second workaround is good enough for me. The only thing is, it doesn't feel right. I suspect that if we keep going without figuring the reason behind this issue, we will pay the price in the future.
Update: Okay I made a stupid mistake, I don't know why but the second workaround does not have any help. The only workaround is forcing all the hooks to be done in a single thread.
Hi, my friend reported an interesting crash that happens when he loads two modules hooking the same app. I suspect there are some race conditions which we doesn't handle correctly in runtime/class_linker.cc
Here's the log of the crashed modules: