Non trivial number of AutoCloseableRouter finalizer exceptions |
|||||||||
Issue descriptionNoticed in that one of the crash dumps had "java.lang.IllegalStateException: Warning: Router objects should be explicitly closed when no longer required otherwise you may leak handles." error. It turns we have many of them (11K for all versions): https://crash.corp.google.com/browse?q=product.name%3D%27Chrome_Android%27%20OMIT%20RECORD%20IF%20SUM(special_protos.android_info.logcat_errors%3D%27java.lang.IllegalStateException%3A%20Warning%3A%20Router%20objects%20should%20be%20explicitly%20closed%20when%20no%20longer%20required%20otherwise%20you%20may%20leak%20handles.%27)%20%3D%200&ignore_case=false&enable_rewrite=true&omit_field_name=special_protos.android_info.logcat_errors&omit_field_value=java.lang.IllegalStateException%3A%20Warning%3A%20Router%20objects%20should%20be%20explicitly%20closed%20when%20no%20longer%20required%20otherwise%20you%20may%20leak%20handles.&omit_field_opt=%3D#samplereports Don't know how severe that is though. Can we include something that would identify responsible code?
,
May 26 2017
,
Sep 6 2017
Can we assign someone to this? Getting external reports of perf issues (issue 749417)
,
Sep 6 2017
Issue 749417 has been merged into this issue.
,
Sep 6 2017
Jay, would you have some time to poke at this in the near future?
,
Sep 6 2017
I'll look at it.
,
Sep 19 2017
I am adding the allocation location of the AutoCloseableRouter in this CL: https://chromium-review.googlesource.com/c/chromium/src/+/672005 That should hopefully help identify the offending AutoCloseableRouters.
,
Sep 19 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/76f4984b228babeaee64be51c38221e5c7971f90 commit 76f4984b228babeaee64be51c38221e5c7971f90 Author: Jay Civelli <jcivelli@google.com> Date: Tue Sep 19 17:49:34 2017 Adding tracking of location for AutoCloseableRouter. In order to make it easier to track down leaked AutoCloseableRouter, adding the stacktrace of the allocation location of the leaked AutoCloseableRouter. Bug: 725661 Change-Id: Id5496c881747013a37a77e8e5127d4d78347e749 Reviewed-on: https://chromium-review.googlesource.com/672005 Reviewed-by: Ken Rockot <rockot@chromium.org> Commit-Queue: Jay Civelli <jcivelli@chromium.org> Cr-Commit-Position: refs/heads/master@{#502886} [modify] https://crrev.com/76f4984b228babeaee64be51c38221e5c7971f90/mojo/public/java/bindings/src/org/chromium/mojo/bindings/AutoCloseableRouter.java
,
Sep 21 2017
Issue 762403 has been merged into this issue.
,
Sep 28 2017
,
Sep 29 2017
And here is the stack: java.lang.IllegalStateException: Warning: Router objects should be explicitly closed when no longer required otherwise you may leak handles. at org.chromium.mojo.bindings.AutoCloseableRouter.finalize(AutoCloseableRouter.java:117) at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:250) at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:237) at java.lang.Daemons$Daemon.run(Daemons.java:103) at java.lang.Thread.run(Thread.java:764) Caused by: java.lang.Exception: AutocloseableRouter allocated at: at org.chromium.mojo.bindings.AutoCloseableRouter.<init>(AutoCloseableRouter.java:43) at org.chromium.mojo.bindings.Interface$Manager.attachProxy(Interface.java:400) at org.chromium.mojo.bindings.Interface$Manager.attachProxy(Interface.java:364) at org.chromium.mojo.bindings.Interface$Manager.getInterfaceRequest(Interface.java:380) at org.chromium.services.service_manager.InterfaceProvider.getInterface(InterfaceProvider.java:48) at org.chromium.chrome.browser.AppIndexingUtil.getCopylessPasteInterface(AppIndexingUtil.java:147) at org.chromium.chrome.browser.AppIndexingUtil.extractCopylessPasteMetadata(AppIndexingUtil.java:75) at org.chromium.chrome.browser.ChromeTabbedActivity$2.onPageLoadFinished(ChromeTabbedActivity.java:1474) at org.chromium.chrome.browser.tab.Tab.didFinishPageLoad(Tab.java:1562) at org.chromium.chrome.browser.tab.TabWebContentsObserver.didFinishLoad(TabWebContentsObserver.java:144) at org.chromium.content.browser.webcontents.WebContentsObserverProxy.didFinishLoad(WebContentsObserverProxy.java:169) at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method) at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:52) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6535) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
,
Nov 16 2017
Saw this last stack trace just by launching a local build of chrome_modern_apk_incremental. +CC wychen, dproctor (authors of AppIndexingUtil)
,
Nov 16 2017
dproctor@ is no longer on this project.
,
Nov 16 2017
Quote from https://chromium-review.googlesource.com/c/chromium/src/+/775476/1/chrome/android/java/src/org/chromium/chrome/browser/AppIndexingUtil.java#79 by Ted: I wonder if there are mojo changes we should investigate to support things like AutoCloseable or something to make this less error prone in the future. Since this is only closed after the async task completes, there isn't really a path where AutoCloseable would make since. Just something we should see if we can introduce some nicer patterns. nyquist@ has a patch to support automatically deleting native counterparts when the java side is GC'd: https://chromium-review.googlesource.com/c/chromium/src/+/704180 I'd prefer to find a way to enforce and explicit close vs relying on GC magic, but that's a hard thing to force in java.
,
Nov 17 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/602dee256a3b07da9aa5226abef453dbb03b3d42 commit 602dee256a3b07da9aa5226abef453dbb03b3d42 Author: Wei-Yin Chen (陳威尹) <wychen@chromium.org> Date: Fri Nov 17 06:15:00 2017 Close the mojo pipe for AppIndexing after job is done Bug: 725661 Change-Id: I29d98e6c022ca96de11dce35bc521307a24ce3d1 Reviewed-on: https://chromium-review.googlesource.com/775476 Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org> Reviewed-by: Jay Civelli <jcivelli@chromium.org> Reviewed-by: Ted Choc <tedchoc@chromium.org> Cr-Commit-Position: refs/heads/master@{#517323} [modify] https://crrev.com/602dee256a3b07da9aa5226abef453dbb03b3d42/chrome/android/java/src/org/chromium/chrome/browser/AppIndexingUtil.java [modify] https://crrev.com/602dee256a3b07da9aa5226abef453dbb03b3d42/chrome/android/junit/src/org/chromium/chrome/browser/AppIndexingUtilTest.java
,
Oct 17
,
Jan 7
|
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by roc...@chromium.org
, May 25 2017