Skip to content
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

SnapshotException: SnapshotImpl_Error_ObjectNotFound #110

Closed
ralph-bergmann opened this issue May 17, 2015 · 17 comments
Closed

SnapshotException: SnapshotImpl_Error_ObjectNotFound #110

ralph-bergmann opened this issue May 17, 2015 · 17 comments

Comments

@ralph-bergmann
Copy link

I got the following error and was asked to report it here(?):

05-17 12:00:57.099  17748-18395/me.foo.debug D/LeakCanary﹕ In me.foo.debug:1.0.0-debug (Git SHA: ce19c3b):1001000004.
    * FAILURE:
    org.eclipse.mat.SnapshotException: SnapshotImpl_Error_ObjectNotFound
            at org.eclipse.mat.parser.internal.SnapshotImpl.mapAddressToId(SnapshotImpl.java:1194)
            at org.eclipse.mat.snapshot.model.ObjectReference.getObjectId(ObjectReference.java:38)
            at org.eclipse.mat.snapshot.model.ObjectReference.getObject(ObjectReference.java:42)
            at org.eclipse.mat.parser.model.AbstractObjectImpl.resolveValue(AbstractObjectImpl.java:149)
            at com.squareup.leakcanary.HeapAnalyzer.findLeakingReference(HeapAnalyzer.java:161)
            at com.squareup.leakcanary.HeapAnalyzer.checkForLeak(HeapAnalyzer.java:95)
            at com.squareup.leakcanary.internal.HeapAnalyzerService.onHandleIntent(HeapAnalyzerService.java:57)
            at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.os.HandlerThread.run(HandlerThread.java:61)
    * Reference Key: ee5aac58-f9ad-4b50-86b7-0d0ce10a1f1e
    * Device: asus google Nexus 7 razor
    * Android Version: 5.1.1 API: 22 LeakCanary: 1.3.1
    * Durations: watch=5010ms, gc=125ms, heap dump=2440ms, analysis=20306ms
@pyricau
Copy link
Member

pyricau commented May 17, 2015

Can you upload the heap dump and share the link here?

@ralph-bergmann
Copy link
Author

Sorry the heap dump for this crash is in /dev/null... but the next one is yours :-)

@ralph-bergmann
Copy link
Author

@pyricau
Copy link
Member

pyricau commented May 18, 2015

Seems like a heap dump parsing bug. The FacebookActivity instance is the culprit. HAHA don't see any instance of that, although it does have a memory address for the keyed weak reference, it then can't resolve it to an object id.

Interestingly, MAT can do the job just find. Seems like a bug in the old MAT implementation.

@pyricau
Copy link
Member

pyricau commented May 18, 2015

Here's how I reproduce it: c92a778

I need to look into this more, this will require digging into the core MAT mechanics.

@andkulikov
Copy link

i reproduce it too

* FAILURE:
org.eclipse.mat.SnapshotException: SnapshotImpl_Error_ObjectNotFound
at org.eclipse.mat.parser.internal.SnapshotImpl.mapAddressToId(SnapshotImpl.java:1194)
at org.eclipse.mat.snapshot.model.ObjectReference.getObjectId(ObjectReference.java:38)
at org.eclipse.mat.snapshot.model.ObjectReference.getObject(ObjectReference.java:42)
at org.eclipse.mat.parser.model.AbstractObjectImpl.resolveValue(AbstractObjectImpl.java:149)
at com.squareup.leakcanary.HeapAnalyzer.findLeakingReference(HeapAnalyzer.java:161)
at com.squareup.leakcanary.HeapAnalyzer.checkForLeak(HeapAnalyzer.java:95)
at com.squareup.leakcanary.internal.HeapAnalyzerService.onHandleIntent(HeapAnalyzerService.java:57)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:211)
at android.os.HandlerThread.run(HandlerThread.java:61)

* Reference Key: 46c532a6-ef64-4566-93de-ff5ea15927be
* Device: Sony Sony D5803 D5803
* Android Version: 5.0.2 API: 21 LeakCanary: 1.3.1
* Durations: watch=5124ms, gc=152ms, heap dump=2092ms, analysis=30342ms

link to dump
https://docs.google.com/file/d/0Bx6U6K76tqX-RFQycUpWYTJ0cDA/edit

@ninja-
Copy link

ninja- commented Jun 3, 2015

same here

@ninja-
Copy link

ninja- commented Jun 3, 2015

it's a race condition when the weak reference is still there but the 'object' has been properly gc'd before the heap dump

@ninja-
Copy link

ninja- commented Jun 4, 2015

#157 fixes this

@pyricau
Copy link
Member

pyricau commented Jul 14, 2015

@ninja- actually, nope. This isn't a race condition AFAIK. As pointed out above, the heapdump can be parsed fine in MAT and the reference does exists, but it can't be read in HAHA. See c92a778

@SecUpwN
Copy link

SecUpwN commented Jul 15, 2015

Thanks for pointing the issue, should be an easy fix (regardless of the number of GC). Cool!

Hoping to see a fix for this soon so that we can re-implement leakcanary into our app again.

@pyricau
Copy link
Member

pyricau commented Jul 15, 2015

@SecUpwN As I pointed out in the follow up comment, it's actually not easy. You're more than welcome to checkout the heap dump parsing code and fix this bug.

@pyricau
Copy link
Member

pyricau commented Jul 15, 2015

We'll very likely need to change our heap dump parser anyway, see #160.

@pyricau
Copy link
Member

pyricau commented Jul 20, 2015

Will be fixed by #219

@pyricau pyricau closed this as completed Jul 20, 2015
@xiaolongyuan
Copy link

+1

@LeoDZhao
Copy link

I also met this issue

@pyricau
Copy link
Member

pyricau commented Sep 19, 2016

Please update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants