-
Notifications
You must be signed in to change notification settings - Fork 973
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
Crash on iPhone5/4s simulator caused by recursive function call #31
Comments
Update: Crash on iPad 2 Simulator which is 32 bits. And works fine on other 64 bits simulator. |
It seems like when using fishhook to rebind symbols in all images on 32-bits simulator finally bind connect function to So when new_connect is being called, it doesn't return the correct result to the upper layer. This may lead to infinite looping problem. I fixed this problem by using Only puzzle remains now, does the I don't quite believe in fortune or coincidence. But really thanks feeding some info on this lib's usage. 👍 |
The solution here may be to support for mach-o's two-level namespaces. When rebinding a symbol, fishhook should first check to see if that symbol refers to a specific library. If there is a specific library, fishhook should not rebind symbols of the same name that are bound to other libraries. |
I don't know if helps the problem you're hitting, but I put up a pull request (#34) to support two-level namespaces. If there are multiple functions named |
I don't know that either. But after this pull request is merged, we will ship to the latest version of fishhook. But currently, we iterate all the images loaded by dyld and use regex to get the specific images by name. Ultimately use rebind_symbol_images method to solve this problem temporarily. |
Recently, we are using fishhook to change some low-level function in
linux/socket
, but we met a quite strange bug. Use fishhook to rebindconnect
symbol to our new one leads to recursive call and ultimately crash on iPhone5/4s simulator specifically.The code works totally fine on iPhone5s/6/6s and etc simulator and iPhone4s/iPhone5 device.
Here is some info about my current MacBook and version of fishhook
You can find the ViewController.m file here which contains all the code in this project.
Plus, I don't know the reason for the problem. And I'm not the code are 100 percent safe on a real iOS device. Here are the thing and some idea I have tried to figure out this problem.
connect
symbol. fishhook changes implementation of eachconnect
methodThanks for your reading.
The text was updated successfully, but these errors were encountered: