DevTools: crash in power saver code upon attaching devtools to the remote target |
|||||||
Issue descriptionI/DEBUG ( 184): backtrace: I/DEBUG ( 184): #00 pc 0003a744 /system/lib/libc.so (tgkill+12) I/DEBUG ( 184): #01 pc 000173c1 /system/lib/libc.so (pthread_kill+52) I/DEBUG ( 184): #02 pc 00017fd3 /system/lib/libc.so (raise+10) I/DEBUG ( 184): #03 pc 00014795 /system/lib/libc.so (__libc_android_abort+36) I/DEBUG ( 184): #04 pc 00012f44 /system/lib/libc.so (abort+4) I/DEBUG ( 184): #05 pc 0007df63 /data/app/org.chromium.chrome-2/lib/arm/libbase.cr.so (_ZN4base5debug13BreakDebuggerEv+18) I/DEBUG ( 184): #06 pc 00094bf5 /data/app/org.chromium.chrome-2/lib/arm/libbase.cr.so (_ZN7logging10LogMessageD1Ev+572) I/DEBUG ( 184): #07 pc 000754cf /data/app/org.chromium.chrome-2/lib/arm/libbase.cr.so (_ZN23JavaObjectWeakGlobalRefC2EP7_JNIEnvP8_jobject+78) I/DEBUG ( 184): #08 pc 0000fc13 /data/app/org.chromium.chrome-2/lib/arm/libui_android.cr.so (_ZN2ui11ViewAndroid16ScopedAnchorViewC2EP7_JNIEnvRKN4base7android7JavaRefIP8_jobjectEESB_+30) I/DEBUG ( 184): #09 pc 0000fe47 /data/app/org.chromium.chrome-2/lib/arm/libui_android.cr.so (_ZN2ui11ViewAndroid17AcquireAnchorViewEv+182) I/DEBUG ( 184): #10 pc 00001faf /data/app/org.chromium.chrome-2/lib/arm/libpower_save_blocker.cr.so (_ZN6device16PowerSaveBlocker8Delegate10ApplyBlockEv+118) I/DEBUG ( 184): #11 pc 000023ef /data/app/org.chromium.chrome-2/lib/arm/libpower_save_blocker.cr.so (_ZN6device16PowerSaveBlocker23InitDisplaySleepBlockerERKN4base7WeakPtrIN2ui11ViewAndroidEEE+234) I/DEBUG ( 184): #12 pc 00771ac9 /data/app/org.chromium.chrome-2/lib/arm/libcontent.cr.so (_ZN7content28RenderFrameDevToolsAgentHost22CreatePowerSaveBlockerEv+312) I/DEBUG ( 184): #13 pc 00771b2b /data/app/org.chromium.chrome-2/lib/arm/libcontent.cr.so (_ZN7content28RenderFrameDevToolsAgentHost16OnClientAttachedEv+50) I/DEBUG ( 184): #14 pc 007564b3 /data/app/org.chromium.chrome-2/lib/arm/libcontent.cr.so (_ZN7content21DevToolsAgentHostImpl11InnerAttachEPNS_23DevToolsAgentHostClientEb+58) I/DEBUG ( 184): #15 pc 007564b3 /data/app/org.chromium.chrome-2/lib/arm/libcontent.cr.so (_ZN7content21DevToolsAgentHostImpl11InnerAttachEPNS_23DevToolsAgentHostClientEb+58) I/DEBUG ( 184): #16 pc 007584e3 /data/app/org.chromium.chrome-2/lib/arm/libcontent.cr.so I/DEBUG ( 184): #17 pc 0075a6ad /data/app/org.chromium.chrome-2/lib/arm/libcontent.cr.so I/DEBUG ( 184): #18 pc 000813a3 /data/app/org.chromium.chrome-2/lib/arm/libbase.cr.so (_ZN4base5debug13TaskAnnotator7RunTaskEPKcRKNS_11PendingTaskE+354) I/DEBUG ( 184): #19 pc 0009a925 /data/app/org.chromium.chrome-2/lib/arm/libbase.cr.so (_ZN4base11MessageLoop7RunTaskERKNS_11PendingTaskE+396) I/DEBUG ( 184): #20 pc 0009b0dd /data/app/org.chromium.chrome-2/lib/arm/libbase.cr.so (_ZN4base11MessageLoop21DeferOrRunPendingTaskENS_11PendingTaskE+28) I/DEBUG ( 184): #21 pc 0009b1e5 /data/app/org.chromium.chrome-2/lib/arm/libbase.cr.so (_ZN4base11MessageLoop6DoWorkEv+156) I/DEBUG ( 184): #22 pc 0009ce17 /data/app/org.chromium.chrome-2/lib/arm/libbase.cr.so I/DEBUG ( 184): #23 pc 0009cf19 /data/app/org.chromium.chrome-2/lib/arm/libbase.cr.so (Java_org_chromium_base_SystemMessageHandler_nativeDoRunLoopOnce+52)
,
Sep 28 2016
I think this crash is orthogonal to the changes that I'm making. It seems like ViewAndroid::AcquireAnchorView() is DCHECKing in deep internals when called on a valid ViewAndroid pointer; the DCHECK looks like it's here: https://cs.chromium.org/chromium/src/base/android/jni_weak_ref.cc?q=jni_weak_ref.cc&sq=package:chromium&dr&l=36, called from here: https://cs.chromium.org/chromium/src/ui/android/view_android.cc?q=view_android.cc&sq=package:chromium&dr&l=25, called from here: https://cs.chromium.org/chromium/src/ui/android/view_android.cc?q=view_android.cc&sq=package:chromium&dr&l=110. I'm not familiar enough with Java or this code to understand what assumption is being violated; perhaps boliu@ is?
,
Sep 28 2016
Yep, blundell is all correct in #2. In ViewAndroid::AcquireAnchorView, there is already a check for the null delegate already, but not for the view, so need to add that. Jinsuk, wanna take care of that? On the other hand, that DCHECK seems really odd... it should be totally legal to assign null to a reference, even if it's like bad form. Is there any technical reason why we do that? torne?
,
Sep 28 2016
It is indeed legal to create a weak reference to null as far as I can see (it will obviously always be null when you look at it again later, but weak references might become null any time anyway, so yaknow). I think the code is just being defensive and assuming nobody would actually do that? If you think it's useful we could probably remove that DCHECK.
,
Sep 30 2016
,
Sep 30 2016
Just to clarify - it's okay to have a nulled-out view in ScopedAnchorView. It only cares about the situation where we have a valid view but nulled-out delegate, which is checked at https://cs.chromium.org/chromium/src/ui/android/view_android.cc?l=27 since it wouldn't be possible to pass the valid view up to Java layer later. I think we only need to modify JavaObjectWeakGlobalRef ctr to fix the crash.
,
Sep 30 2016
yeah, removing the DCHECK is fine
,
Oct 5 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/48678a7b6e9087357262f8acee9df186b337d706 commit 48678a7b6e9087357262f8acee9df186b337d706 Author: jinsukkim <jinsukkim@chromium.org> Date: Wed Oct 05 13:41:18 2016 Remove null checking in JavaObjectWeakGlobalRef ctr It is legal to create a weak reference to null. Removes the defensive null checking being done in the constructors. BUG= 649407 Review-Url: https://codereview.chromium.org/2389403002 Cr-Commit-Position: refs/heads/master@{#423143} [modify] https://crrev.com/48678a7b6e9087357262f8acee9df186b337d706/base/android/jni_weak_ref.cc
,
Oct 10 2016
,
Oct 11 2016
Thanks jinsukkim!
,
Oct 27 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/48678a7b6e9087357262f8acee9df186b337d706 commit 48678a7b6e9087357262f8acee9df186b337d706 Author: jinsukkim <jinsukkim@chromium.org> Date: Wed Oct 05 13:41:18 2016 Remove null checking in JavaObjectWeakGlobalRef ctr It is legal to create a weak reference to null. Removes the defensive null checking being done in the constructors. BUG= 649407 Review-Url: https://codereview.chromium.org/2389403002 Cr-Commit-Position: refs/heads/master@{#423143} [modify] https://crrev.com/48678a7b6e9087357262f8acee9df186b337d706/base/android/jni_weak_ref.cc
,
Nov 4 2016
[Automated comment] removing mislabelled merge-merged-2840
,
Feb 15 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599 commit 73b9848f38e00bf1b9f48cfa2da7f8cda7c41599 Author: rockot <rockot@chromium.org> Date: Wed Feb 15 18:58:02 2017 Make browser process a singleton service Changes the primordial browser process service manager connection to identify as a singleton service named content_packaged_services. This is used to package any existing global services previously associated with the global root content_browser connection. The root content_browser connection still exists in order to serve as a client process host for non-renderer child processes. One result of this change is that no services other than content_* are allowed to connect directly to content_browser, in order to avoid racing with the (now asynchronous) content_browser instance creation by ServiceManagerContext. As such, code which previously connected to content_browser has also been fixed to do something less weird. To wit: - An "ash" service is now embedded in the browser process when not running in mash mode - this allows simplification of ash client code as there is no longer a need to switch the target service name at runtime when connecting to ash interfaces - A new "chrome" service is packaged in content_packaged_services by within Chrome. This hosts a mash::mojom::Launchable interface, allowing Chrome to be launched within mash by connecting to "chrome" - ChromeInterfaceFactory is deleted Somewhat unrelated but because this CL exposed a timing issue between packaged service connection and main thread browser initialization, this also removes the unnecessary blocking of startup on service manager connection (see change in chrome_browser_main_extra_parts_views.cc.) BUG= 649407 ,594852 TEST=chrome --mash functions normally, standalone mash runner functions normally with chrome, chrome non-mash functions normally, browser_tests work with and without --run-in-mash TBR=tsepez@chromium.org Review-Url: https://codereview.chromium.org/2695803004 Cr-Commit-Position: refs/heads/master@{#450750} [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/ash/mus/manifest.json [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/chrome/app/BUILD.gn [add] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/chrome/app/chrome_manifest.json [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/chrome/app/mash/BUILD.gn [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/chrome/app/mash/mash_runner.cc [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/chrome/browser/DEPS [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/chrome/browser/browser_resources.grd [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/chrome/browser/chrome_content_browser_client.cc [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/chrome/browser/chrome_content_browser_manifest_overlay.json [add] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/chrome/browser/chrome_content_packaged_services_manifest_overlay.json [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/chrome/browser/chromeos/BUILD.gn [delete] https://crrev.com/5e8ee75a86c1c36b53c1a6b5ec28d89b7bb6d4ad/chrome/browser/chromeos/chrome_interface_factory.cc [delete] https://crrev.com/5e8ee75a86c1c36b53c1a6b5ec28d89b7bb6d4ad/chrome/browser/chromeos/chrome_interface_factory.h [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/chrome/browser/prefs/preferences_connection_manager.cc [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/chrome/browser/ui/ash/ash_util.cc [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/chrome/browser/ui/ash/ash_util.h [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/chrome/test/BUILD.gn [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/chrome/test/base/mojo_test_connector.cc [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/content/BUILD.gn [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/content/browser/service_manager/service_manager_context.cc [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/content/browser/service_manager/service_manager_context.h [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/content/common/service_manager/service_manager_connection_impl.cc [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/content/common/service_manager/service_manager_connection_impl.h [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/content/content_resources.grd [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/content/public/app/BUILD.gn [add] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/content/public/app/mojo/content_packaged_services_manifest.json [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/content/public/common/service_manager_connection.h [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/content/public/common/service_names.mojom [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/mash/BUILD.gn [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/mash/session/session.cc [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/services/service_manager/public/cpp/interface_registry.h [modify] https://crrev.com/73b9848f38e00bf1b9f48cfa2da7f8cda7c41599/services/service_manager/public/cpp/lib/interface_registry.cc
,
Mar 7 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/afc42ced3ccb6d8f6ce82ee7fe358ca299f28f9f commit afc42ced3ccb6d8f6ce82ee7fe358ca299f28f9f Author: slan <slan@chromium.org> Date: Tue Mar 07 22:56:40 2017 [Chromecast] Update manifests to use content_packaged_services. Since crrrev.com/2695803004, all services that don't require a BrowserContext should be packaged in |content_packaged_services|. Cast-specific services are all registered on this connector, so update each manifest and comments. BUG= 649407 Test: cast_shell_internal_browsertest Review-Url: https://codereview.chromium.org/2731913004 Cr-Commit-Position: refs/heads/master@{#455270} [modify] https://crrev.com/afc42ced3ccb6d8f6ce82ee7fe358ca299f28f9f/chromecast/browser/BUILD.gn [modify] https://crrev.com/afc42ced3ccb6d8f6ce82ee7fe358ca299f28f9f/chromecast/browser/cast_browser_resources.grd [modify] https://crrev.com/afc42ced3ccb6d8f6ce82ee7fe358ca299f28f9f/chromecast/browser/cast_content_browser_client.cc [add] https://crrev.com/afc42ced3ccb6d8f6ce82ee7fe358ca299f28f9f/chromecast/browser/cast_content_packaged_services_manifest_overlay.json |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by scottmg@chromium.org
, Sep 27 2016