-
Notifications
You must be signed in to change notification settings - Fork 4k
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
IllegalArgumentException: Object id {id} not found in heap dump. #2567
Comments
Spent some time bisecting to find the exact time LeakCanary stopped working and I found the root cause. We were bringing in the
Those So clearly there was a fixable issue on our end, but I'm not sure that there still isn't a bug in LeakCanary as I wouldn't have expected it to break due to excluding libs from a completely separate dependency. I'll leave it up to y'all to decide whether or not to close this. |
Thank you @tommyjackson for the details and the hprof! I can reproduce locally with:
My intuition here is that your setup led to a weird heap state, although that really shouldn't happen. Let's make a change in LeakCanary to provide more details on the path we use to reach this unknown object id: TODO link PR Here's the updated error:
This is fascinating. It looks like the array class is malformed, it has a
In other words, The CapabilityBuilder class is defined here: https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:core/core-google-shortcuts/src/main/java/androidx/core/google/shortcuts/builders/CapabilityBuilder.java;drc=f965a68527c86919fef87a7705619d78b46d0139 As far as I can tell the only usage of the CapabilityBuilder[] class is here:
It's worth noting that the entire method likely does not ever actually load the Note: the heap dump shows this is Android 13 / SDK 33, on a Google Pixel 4a, fingerprint "google/sunfish/sunfish:13/TQ3A.230805.001.A2/10385117:user/release-keys" @tommyjackson by any chance, would you be able to look up your APKs from back then (or recreate a faulty one) and see if the dex files include Also, was this issue limited to specific versions of Android? Can you reproduce on recent versions of Android? It'd be even more amazing if you could set up a small repro project since you've isolated the dependencies causing this issue. |
Description
Anywhere in our app we try to dump the heap, the heap analysis fails with the stack trace below. This is making it impossible to use LeakCanary since we can't get any data from these heap dumps. We have been using LeakCanary for years and have only recently started seeing this issue, and I don't think there would be an issue on our side since all we do is bring in the dependency.
Steps to Reproduce
hprof file: https://drive.google.com/file/d/1w1kwAmWlRB2PmzgaIDq2sRwCO9Sgsns2/view?usp=sharing
Expected behavior: [What you expect to happen]
I expect to be able to view the results from the analyzed heap dump.
Version Information
Additional Information
There isn't anything specific we do to reproduce it, it just happens whenever a heap is dumped, whether manually or automatically, and regardless of the device or emulator. Happy to provide anymore info if necessary.
The text was updated successfully, but these errors were encountered: