rovo89 / android_art

Android ART with modifications for the Xposed framework.
Other
371 stars 211 forks source link

ART crash when attaching Debugger #1

Closed netmaxt3r closed 9 years ago

netmaxt3r commented 9 years ago

Steps reproduce.

  1. Enable developer settings & usb debugging
  2. choose any app to debug in 'select debug app'
  3. enable wait for debugger
  4. start app on the phone ( app will wait for debugger to attach)
  5. set up ddms/monitor to select app waiting for debugging
  6. attach any jdwp to ddms default debug port
  7. debugger attaches
  8. app crashes

env device - sony z 2 tablet ( castor ) rom - cm12 UNOFFICIAL jdwp client - android studio

native crash log

02-14 17:13:06.075  10006-10016/? I/art﹕ Debugger is active
02-14 17:13:06.185  10006-10006/? I/System.out﹕ Debugger has connected
02-14 17:13:06.185  10006-10006/? I/System.out﹕ waiting for debugger to settle...
02-14 17:13:06.385  10006-10006/? I/System.out﹕ waiting for debugger to settle...
02-14 17:13:06.385  10006-10016/? A/libc﹕ Fatal signal 11 (SIGSEGV), code 1, fault addr 0xffffffec in tid 10016 (JDWP)
02-14 17:13:06.485      279-279/? I/DEBUG﹕ *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-14 17:13:06.485      279-279/? I/DEBUG﹕ Build fingerprint: 'Sony/SGP521/SGP521:4.4.4/23.0.1.A.0.167/WP_3Rw:user/release-keys'
02-14 17:13:06.485      279-279/? I/DEBUG﹕ Revision: '0'
02-14 17:13:06.485      279-279/? I/DEBUG﹕ ABI: 'arm'
02-14 17:13:06.485      279-279/? I/DEBUG﹕ pid: 10006, tid: 10016, name: JDWP  >>> net.maxters.droid.airmon <<<
02-14 17:13:06.485      279-279/? I/DEBUG﹕ signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xffffffec
02-14 17:13:06.515      279-279/? I/DEBUG﹕ r0 00000001  r1 00022000  r2 0000088d  r3 00000000
02-14 17:13:06.515      279-279/? I/DEBUG﹕ r4 b50fca54  r5 00000002  r6 00400000  r7 0000088c
02-14 17:13:06.515      279-279/? I/DEBUG﹕ r8 b46283b4  r9 7114bfd8  sl af25d078  fp 0000001b
02-14 17:13:06.515      279-279/? I/DEBUG﹕ ip 00000000  sp b46281d8  lr b502afed  pc b502af28  cpsr 20070030
02-14 17:13:06.515      279-279/? I/DEBUG﹕ backtrace:
02-14 17:13:06.515      279-279/? I/DEBUG﹕ #00 pc 00219f28  /system/lib/libart.so (art::StackVisitor::GetVReg(art::mirror::ArtMethod*, unsigned short, art::VRegKind, unsigned int*) const+35)
02-14 17:13:06.515      279-279/? I/DEBUG﹕ #01 pc 0021a375  /system/lib/libart.so (art::StackVisitor::GetThisObject() const+136)
02-14 17:13:06.515      279-279/? I/DEBUG﹕ #02 pc 001568b7  /system/lib/libart.so (art::instrumentation::InstrumentationInstallStack(art::Thread*, void*)::InstallStackVisitor::VisitFrame()+94)
02-14 17:13:06.515      279-279/? I/DEBUG﹕ #03 pc 0021b985  /system/lib/libart.so (art::StackVisitor::WalkStack(bool)+248)
02-14 17:13:06.515      279-279/? I/DEBUG﹕ #04 pc 00154285  /system/lib/libart.so (art::instrumentation::InstrumentationInstallStack(art::Thread*, void*)+84)
02-14 17:13:06.515      279-279/? I/DEBUG﹕ #05 pc 00228c8d  /system/lib/libart.so (art::ThreadList::ForEach(void (*)(art::Thread*, void*), void*)+20)
02-14 17:13:06.515      279-279/? I/DEBUG﹕ #06 pc 00156fe7  /system/lib/libart.so (art::instrumentation::Instrumentation::Deoptimize(art::mirror::ArtMethod*)+146)
02-14 17:13:06.515      279-279/? I/DEBUG﹕ #07 pc 000e854d  /system/lib/libart.so (art::Dbg::ProcessDeoptimizationRequest(art::DeoptimizationRequest const&)+384)
02-14 17:13:06.515      279-279/? I/DEBUG﹕ #08 pc 000ec89d  /system/lib/libart.so (art::Dbg::ManageDeoptimization()+424)
02-14 17:13:06.515      279-279/? I/DEBUG﹕ #09 pc 0017f747  /system/lib/libart.so (art::JDWP::JdwpState::RegisterEvent(art::JDWP::JdwpEvent*)+302)
02-14 17:13:06.515      279-279/? I/DEBUG﹕ #10 pc 0018830b  /system/lib/libart.so (art::JDWP::ER_Set(art::JDWP::JdwpState*, art::JDWP::Request&, art::JDWP::ExpandBuf*)+286)
02-14 17:13:06.515      279-279/? I/DEBUG﹕ #11 pc 00186e61  /system/lib/libart.so (art::JDWP::JdwpState::ProcessRequest(art::JDWP::Request&, art::JDWP::ExpandBuf*)+444)
02-14 17:13:06.515      279-279/? I/DEBUG﹕ #12 pc 00188f81  /system/lib/libart.so (art::JDWP::JdwpState::HandlePacket()+48)
02-14 17:13:06.515      279-279/? I/DEBUG﹕ #13 pc 0027fa5b  /system/lib/libart.so (art::JDWP::JdwpAdbState::ProcessIncoming()+1010)
02-14 17:13:06.515      279-279/? I/DEBUG﹕ #14 pc 0018979b  /system/lib/libart.so (art::JDWP::JdwpState::Run()+346)
02-14 17:13:06.515      279-279/? I/DEBUG﹕ #15 pc 0018ad13  /system/lib/libart.so (art::JDWP::StartJdwpThread(void*)+10)
02-14 17:13:06.515      279-279/? I/DEBUG﹕ #16 pc 0001392f  /system/lib/libc.so (__pthread_start(void*)+30)
02-14 17:13:06.515      279-279/? I/DEBUG﹕ #17 pc 00011a0f  /system/lib/libc.so (__start_thread+6)
02-14 17:13:06.805      279-279/? I/DEBUG﹕ Tombstone written to: /data/tombstones/tombstone_05

activity manager crash

 android.os.DeadObjectException
            at android.os.BinderProxy.transactNative(Native Method)
            at android.os.BinderProxy.transact(Binder.java:496)
            at android.app.ApplicationThreadProxy.schedulePauseActivity(ApplicationThreadNative.java:701)
            at com.android.server.am.ActivityStack.startPausingLocked(ActivityStack.java:856)
            at com.android.server.am.ActivityStack.finishActivityLocked(ActivityStack.java:2838)
            at com.android.server.am.ActivityStack.finishTopRunningActivityLocked(ActivityStack.java:2695)
            at com.android.server.am.ActivityStackSupervisor.finishTopRunningActivityLocked(ActivityStackSupervisor.java:2466)
            at com.android.server.am.ActivityManagerService.handleAppCrashLocked(ActivityManagerService.java:11690)
            at com.android.server.am.ActivityManagerService.makeAppCrashingLocked(ActivityManagerService.java:11562)
            at com.android.server.am.ActivityManagerService.crashApplication(ActivityManagerService.java:12266)
            at com.android.server.am.ActivityManagerService.handleApplicationCrashInner(ActivityManagerService.java:11782)
            at com.android.server.am.NativeCrashListener$NativeCrashReporter.run(NativeCrashListener.java:86)
rovo89 commented 9 years ago

I tried the same with Eclipse and also started app directly in debug mode. Both worked fine for me.

There was an issue with this during my attempts on KitKat, but it's no longer occuring for me on Lollipop. I could try to include my change and compile a version for you to test, but that won't be today.

netmaxt3r commented 9 years ago

yeah eclipse attaches fine , android studio is having issues, let me check any workaround for this thanks

netmaxt3r commented 9 years ago

debugger attaches fine on intellij as well seems to be a android studio/local env issue , needs more investigation. closing

Trojaner commented 9 years ago

This happened to me too when I tried to debug my app (which wasn't a xposed module): (Lollipop - Resurrection Remix based on CM12 - Xperia SP - IntelliJ IDEA) http://hastebin.com/lexororoki.coffee I was able debug with xposed for a while, but suddenly it didn't work anymore.

I suggest to re-open this issue

netmaxt3r commented 9 years ago

in the initial report I was debugging xposed module was causing this issue , today in the office when I attached debugger to project without any xposed api the process crashed , immediately swaping app_process without xposed and debugger was fine. needs more investigation

c3ph3us commented 9 years ago

at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:117) 3.0 alpha2

Trojaner commented 9 years ago

@c3ph3us Well, it's the method initializing the ZygoteInit class, but its not the cause of the error...the error happens at libart.so

Can you maybe post the full stacktrace?

fda77 commented 9 years ago

Seems it happens for all debugged apps if a by Xposed hooked method should be executed: A/art(22663): art/runtime/mirror/art_method.cc:201] Failed to find Dex offset for PC offset 0xfffffc68(PC 0x723bc4b9, entry_point=0x723bc851) in (hooked method here) A/libc(22663): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x3a in tid 22889 (Thread-985)

ghost64 commented 9 years ago

I had the same issue but it seemed to be fixed it by ticking "Disabled resource hooks" within the Xposed Installer and rebooting. I was able to debug for several hours without issue after doing this

SciLor commented 9 years ago

I also deactivated the resource hooks, but without success :( Any updates here?

Trojaner commented 9 years ago

I dont have any problems since using Alpha 2, but it could also be a deactived module which fixed it, so try updating to Alpha 2 and/or deactivating some modules...

SciLor commented 9 years ago

Alpha 2 didn't fixed it. I had to deactivate all Modules. I will try to find out what Modul causes it.

SciLor commented 9 years ago

Solution: Deactivate your Module, that you want to debug. Then it is working fine!

lukefor commented 9 years ago

From what I can see, any overlap between app API usage and xposed hooks = crash on debug

For example the module UnbelovedHosts was crashing debugging of an empty LibGDX project, which presumably has some networking involved.

Trojaner commented 9 years ago

Still not fixed: http://hastebin.com/imedatavuq.mel

It crashes the app when I attach the debugger and click something.

rovo89 commented 9 years ago

Sorry, but I haven't released a new version yet that includes this fix. If you tried an unofficial build by someone else, please contact that person first.

pylerSM commented 9 years ago

Is there any unofficial build with recent fixes for Lollipop? I doubt there is. Maybe somebody can build it...

C3C0 commented 9 years ago

@pylerSM yes, there's one for LP 5.1 posted by dk_zero-cool. He compiled it from my fork so it contains all the recent fixes.

rovo89 commented 9 years ago

Did you have the chance to test this on version 65 or later?

UMFsimke commented 8 years ago

Guys I'm having same problem when I attach debugger on my app on Nexus 5, Android 6.0, Android Studio 1.3.2

Here is full stack trace. 12-19 19:34:49.388 28736-28742/com.seeforge.SEEForge I/art﹕ Debugger is active 12-19 19:34:53.925 201-805/? D/audio_hw_primary﹕ out_set_parameters: enter: usecase(1: low-latency-playback) kvpairs: routing=2 --------- beginning of system 12-19 19:34:53.926 781-15545/? I/ActivityManager﹕ START u0 {cmp=com.seeforge.SEEForge/.ui.screens.SubmitNewActivity (has extras)} from uid 10254 on display 0 12-19 19:34:53.940 201-804/? D/audio_hw_primary﹕ select_devices: out_snd_device(2: speaker) in_snd_device(0: none) 12-19 19:34:53.940 201-804/? D/msm8974_platform﹕ platform_send_audio_calibration: sending audio calibration for snd_device(2) acdb_id(15) 12-19 19:34:53.940 201-804/? D/audio_hw_primary﹕ enable_snd_device: snd_device(2: speaker) 12-19 19:34:53.943 201-804/? D/audio_hw_primary﹕ enable_audio_route: apply and update mixer path: low-latency-playback 12-19 19:34:54.075 28736-28736/com.seeforge.SEEForge E/RecyclerView﹕ No adapter attached; skipping layout 12-19 19:34:54.080 1276-1276/? I/Keyboard.Facilitator﹕ onFinishInput() 12-19 19:34:54.085 28736-28736/com.seeforge.SEEForge E/RecyclerView﹕ No adapter attached; skipping layout 12-19 19:34:54.107 781-815/? I/ActivityManager﹕ Displayed com.seeforge.SEEForge/.ui.screens.SubmitNewActivity: +176ms --------- beginning of crash 12-19 19:34:54.135 28736-28895/com.seeforge.SEEForge A/libc﹕ Fatal signal 11 (SIGSEGV), code 2, fault addr 0x76a86ddc in tid 28895 (AsyncTask #3) 12-19 19:34:54.238 197-197/? A/DEBUG﹕ * * * * * * * * * * * * * * * * 12-19 19:34:54.238 197-197/? A/DEBUG﹕ Build fingerprint: 'google/hammerhead/hammerhead:6.0/MRA58K/2256973:user/release-keys' 12-19 19:34:54.238 197-197/? A/DEBUG﹕ Revision: '0' 12-19 19:34:54.239 197-197/? A/DEBUG﹕ ABI: 'arm' 12-19 19:34:54.239 197-197/? A/DEBUG﹕ pid: 28736, tid: 28895, name: AsyncTask #3 >>> com.seeforge.SEEForge <<< 12-19 19:34:54.239 197-197/? A/DEBUG﹕ signal 11 (SIGSEGV), code 2 (SEGVACCERR), fault addr 0x76a86ddc 12-19 19:34:54.261 197-197/? A/DEBUG﹕ r0 70f86424 r1 016c026f r2 70f863b4 r3 b4d5fe60 12-19 19:34:54.261 197-197/? A/DEBUG﹕ r4 9a4ff4ac r5 016c026e r6 b4d731f0 r7 00000000 12-19 19:34:54.261 197-197/? A/DEBUG﹕ r8 7104e8d0 r9 135723a0 sl af0a23f8 fp 9cbc9500 12-19 19:34:54.261 197-197/? A/DEBUG﹕ ip 70fe52f0 sp 9a4ff3b0 lr 70fb2660 pc b4a39952 cpsr 000e0030 12-19 19:34:54.274 197-197/? A/DEBUG﹕ backtrace: 12-19 19:34:54.275 197-197/? A/DEBUG﹕ #00 pc 001e2952 /system/lib/libart.so (art::instrumentation::Instrumentation::PopInstrumentationStackFrame(art::Thread, unsigned int_, unsigned long long, unsigned long long)+397) 12-19 19:34:54.275 197-197/? A/DEBUG﹕ #01 pc 003faf17 /system/lib/libart.so (artInstrumentationMethodExitFromCode+62) 12-19 19:34:54.275 197-197/? A/DEBUG﹕ #02 pc 000eab59 /system/lib/libart.so (art_quick_instrumentation_entry+104) 12-19 19:34:54.275 197-197/? A/DEBUG﹕ #03 pc 01649f07 /data/app/com.seeforge.SEEForge-1/oat/arm/base.odex (offset 0xa64000) (com.seeforge.SEEForge.api.AsyncResult com.seeforge.SEEForge.api.async.GetFileAsyncTask.doInBackground(java.lang.Object[])+1130) 12-19 19:34:54.275 197-197/? A/DEBUG﹕ #04 pc 000eab25 /system/lib/libart.so (art_quick_instrumentation_entry+52) 12-19 19:34:54.953 781-29582/? W/ActivityManager﹕ Force finishing activity com.seeforge.SEEForge/.ui.screens.SubmitNewActivity 12-19 19:34:54.953 197-197/? A/DEBUG﹕ Tombstone written to: /data/tombstones/tombstone_01 12-19 19:34:54.953 197-197/? E/DEBUG﹕ AM write failed: Broken pipe 12-19 19:34:54.953 781-812/? I/BootReceiver﹕ Copying /data/tombstones/tombstone_01 to DropBox (SYSTEM_TOMBSTONE) 12-19 19:34:54.961 781-29582/? W/ActivityManager﹕ Force finishing activity com.seeforge.SEEForge/.ui.screens.ReportNewActivity 12-19 19:34:54.990 781-7535/? D/GraphicsStats﹕ Buffer count: 4 12-19 19:34:54.990 781-1401/? I/WindowState﹕ WIN DEATH: Window{256f08 u0 com.seeforge.SEEForge/com.seeforge.SEEForge.ui.screens.ReportNewActivity} 12-19 19:34:54.993 781-1349/? I/WindowState﹕ WIN DEATH: Window{bc2cf31 u0 com.seeforge.SEEForge/com.seeforge.SEEForge.ui.screens.MainScreenActivity} 12-19 19:34:54.994 781-949/? I/WindowState﹕ WIN DEATH: Window{21c1f4e u0 com.seeforge.SEEForge/com.seeforge.SEEForge.ui.screens.SubmitNewActivity} 12-19 19:34:55.013 781-7453/? I/OpenGLRenderer﹕ Initialized EGL, version 1.4 12-19 19:34:55.052 213-213/? I/Zygote﹕ Process 28736 exited due to signal (11) 12-19 19:34:55.066 781-1055/? I/ActivityManager﹕ Process com.seeforge.SEEForge (pid 28736) has died 12-19 19:34:55.069 781-1055/? W/ActivityManager﹕ Scheduling restart of crashed service com.seeforge.SEEForge/.services.DownloadRequestsQueue in 1000ms 12-19 19:34:55.080 781-1055/? I/ActivityManager﹕ Start proc 29586:com.seeforge.SEEForge/u0a254 for activity com.seeforge.SEEForge/.ui.screens.MainScreenActivity 12-19 19:34:55.084 29586-29586/? I/art﹕ Late-enabling -Xcheck:jni 12-19 19:34:55.103 29586-29592/? I/art﹕ Debugger is no longer active 12-19 19:34:55.121 29586-29586/? W/System﹕ ClassLoader referenced unknown path: /data/app/com.seeforge.SEEForge-1/lib/arm 12-19 19:34:55.205 29586-29586/? I/GAv4﹕ Google Analytics 7.5.71 is starting up. To enable debug logging on a device run: adb shell setprop log.tag.GAv4 DEBUG adb logcat -s GAv4 12-19 19:34:55.221 29586-29586/? W/GAv4﹕ AnalyticsReceiver is not registered or is disabled. Register the receiver for reliable dispatching on non-Google Play devices. See http://goo.gl/8Rd3yj for instructions. 12-19 19:34:55.228 29586-29586/? W/GAv4﹕ CampaignTrackingReceiver is not registered, not exported or is disabled. Installation campaign tracking is not possible. See http://goo.gl/8Rd3yj for instructions. 12-19 19:34:55.233 29586-29586/? I/GAv4﹕ Logger is deprecated. To enable debug logging, please run: adb shell setprop log.tag.GAv4 DEBUG 12-19 19:34:55.251 29586-29607/? W/GAv4﹕ AnalyticsService not registered in the app manifest. Hits might not be delivered reliably. See http://goo.gl/8Rd3yj for instructions. 12-19 19:34:55.268 29586-29608/? D/OpenGLRenderer﹕ Use EGL_SWAP_BEHAVIOR_PRESERVED: true 12-19 19:34:55.332 29586-29608/? I/Adreno-EGL﹕ : QUALCOMM Build: 09/02/15, 76f806e, Ibddc658e36 12-19 19:34:55.334 29586-29608/? I/OpenGLRenderer﹕ Initialized EGL, version 1.4 12-19 19:34:55.346 781-815/? W/WindowAnimator﹕ Failed to dispatch window animation state change. android.os.DeadObjectException at android.os.BinderProxy.transactNative(Native Method) at android.os.BinderProxy.transact(Binder.java:503) at android.view.IWindow$Stub$Proxy.onAnimationStopped(IWindow.java:534) at com.android.server.wm.WindowAnimator.updateWindowsLocked(WindowAnimator.java:286) at com.android.server.wm.WindowAnimator.animateLocked(WindowAnimator.java:678) at com.android.server.wm.WindowAnimator.-wrap0(WindowAnimator.java) at com.android.server.wm.WindowAnimator$1.doFrame(WindowAnimator.java:123) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:856) at android.view.Choreographer.doCallbacks(Choreographer.java:670) at android.view.Choreographer.doFrame(Choreographer.java:603) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.os.HandlerThread.run(HandlerThread.java:61) at com.android.server.ServiceThread.run(ServiceThread.java:46) 12-19 19:34:55.498 781-815/? I/ActivityManager﹕ Displayed com.seeforge.SEEForge/.ui.screens.MainScreenActivity: +429ms 12-19 19:34:57.156 201-805/? D/audio_hw_primary﹕ disable_audio_route: reset and update mixer path: low-latency-playback 12-19 19:34:57.156 201-805/? D/audio_hw_primary﹕ disable_snd_device: snd_device(2: speaker) 12-19 19:35:03.504 781-884/? D/ConnectivityService﹕ updateNetworkScore for NetworkAgentInfo [WIFI () - 118] to 57 12-19 19:35:03.504 781-884/? D/ConnectivityService﹕ rematching NetworkAgentInfo [WIFI () - 118] 12-19 19:35:09.571 781-1349/? I/AccountManagerService﹕ getTypesVisibleToCaller: isPermitted? true 12-19 19:35:09.586 1600-29811/? E/AppUsageEventWatcher﹕ wrong time range: [1453405867138, 1450550109585)