-
Notifications
You must be signed in to change notification settings - Fork 565
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
Private loading not working on Android 9 #3543
Comments
It seems the privload loads modules for clients, not for target executable. Will this modification affect thread init? |
Warning: everything below is based on my limited understanding (@derekbruening and others can correct me).
It's the same as would happen as when Linux loads shared objects, i.e.
What happens depends on your client. If init doesn't get called and nothing in your client relies on it then things should be fine.
I don't think thread initialisation in client shared objects is affected by whether init is called. The threads library should take care of that. |
That sounds right. I would just elaborate by saying: If a privately-loaded library's initialization function is failing, it is probably due to some problem or limitation with the isolation (separation of private libraries from application libraries) provided by DR, and something in that library is not going to work properly. If your client's use of that library does not depend on whatever is broken, then it may work fine in practice for you. However, I would not recommend disabling the calling of every init function: only the one that is failing. Ideally you would debug the problem and find a solution. That's not always easy, as we have seen on Windows where libraries are doing complex things that interact with You never said what the symptoms were of calling the init function that caused you to disable it in the first place, nor what library we're talking about, nor what client, nor what DR version. If this is supposed to be a bug in our issue tracker all of that needs to be supplied. If this is a general question, please use the users list https://groups.google.com/forum/#!forum/DynamoRIO-Users rather than the issue tracker, as the latter is for specific detailed bugs, and the former will reach the other users who may find the information beneficial. |
@derekbruening @AssadHashmi |
I see, thank you for the information and the effort to make it work. |
Another user hit this with the outward visible symptom a fatal SIGILL: https://groups.google.com/forum/#!topic/DynamoRIO-Users/diIYsP0TK_8 |
More detailed explanation of why the first entry in
(Note that if a DR client is linked with |
UPD: DR can load UPD2: Also, to relocate the linker DR needs to support |
One more idea is to to load the bionic linker by just putting it into memory, and then finding the |
Somewhat similar example - #5134. |
Right, it did remind me of Android, with hardcoded dependencies between the loader and libc (and libpthread), though a relatively simple case of calling an extra function with a specific name if it exists. |
The Bionic library for Android 9 have changes from Android 6 that fails dynamorio.
Below is a small trick to get it working, but not a perfectly way.
In order to running dynamorio on android9-arm64, we change
privload_call_lib_func
Firstly, we thought programs with
init
orinit_array
would behave abnormal, but a few testcases shows that It's working perfectly. Then we thought the module load callback would behave abnormal, but it also works.The question is, what's really happening when call init functions from dynamorio privload? What would failed if we don't call init functions from dynamorio privload?
PS. Testing with libinscount.so with patch below.
Testing program:
bad_case.cpp:
main.c:
The text was updated successfully, but these errors were encountered: