-
Notifications
You must be signed in to change notification settings - Fork 571
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 and APP CRASH running Java apps on Android #1912
Comments
It seems like the dcontext targeting happens in a signal handler for an app sigsegv which does not occur natively. The SIGSEGV is r4 being null:
That shows up when running DrM:
|
The app crash is significant enough I split it out as #1918 for clarity. The dcontext escape is due to sigaction handling skipping syscall execution and not realizing its own post-syscall handler thus won't be called. After fixing both, we hit a mangling bug which I also split out: #1919 The bugs so far:
Now I can match the native behavior of directly launching app_process32, which is to die after a while:
The unhandled syscall is SYS_rt_sigtimedwait. Moving on to launching the full app via wrap script and tapping on the screen, we hit an assert:
Using release DR, though, calculator comes up and seems to work -- at least, simple addition gets the right answer :) |
The crashes are fixed. I'm moving the asserts out into a separate issue and closing this one. 554c523 i#1912 Java Android: avoid fault processing ELF headers |
I tried the latest dynamorio and drmemory releases. Both failed to start calculator App. Command: Exception:
|
"drrun -t drmemory" is Dr. Memory, identical to using the Dr. Memory release package. Can you confirm that plain DynamoRIO (i.e., "bin32/drrun" without any tool) fails to start calculator on your device? What version of Android is this? |
If I run plain DynamoRio with below command, I got a segmentation fault without further information. |
As shown above, that command line succeeds (matches native), on my Nexus 6 running 6.0. The wrap, which brings up the full app, also succeeds. Since I cannot reproduce what you're seeing, please try to debug it using debug build and log files (xref https://github.com/DynamoRIO/dynamorio/wiki/Debugging). |
Luckily, after I upgraded my Nexus 5 with Android 6.0.1, it seems I get closer to the success. But there was still a tiny problem.
The command I used was not changed. |
@derekbruening
I believe the reason should be the child process failed to start. But interesting thing is if I use the pure command line to start calculator, I can see the process started successfully as expected. So, could you please share the way in which you succeeded to start Calculator with wrap? I hope to move on but have been paused for some time. Thank you. |
After fixing config dir issues in DynamoRIO/drmemory#1857, we are able to try to run Java apps. I tried both Chrome and calculator and both failed early in similar ways.
In DR release we see a DR crash:
That's the TRY_EXCEPT, so why wasn't the fault handled? It is handled in debug build as shown below. Why not in release build?
Debug, this time via direct run instead of the wrapper through zygote:
More details on the ELF fault:
From #1860, we try each looking for dynamic, and crashing seems to be expected if we aren't there yet. Though it seems that maybe the at_map should just be removed from the check to avoid the crash, as the later fixup on Android has at_map=0.
The other curiosities are just the app passing a non-page-aligned size to munmap.
The "tried to execute from dr memory" seems to be due to an escaped dcontext:
The text was updated successfully, but these errors were encountered: