I'm getting these messages when LeakCanary analyze the heap dump.
Invalid Hprof? Found unknown object id 348267312
Invalid Hprof? Found unknown object id 348783744
It doesn't appear all the times, but it's kind of easy to reproduce it.
It seems that it's not a major problem because Leak Canary shows me all the leaks and it's paths but it's kind of strange to get that messages in a reproducible way, for this reason I'm reporting it.
I attach the hprof: 2019-09-11_15-17-22_658.hprof.zip
Thanks @BraisGabin !
Initially this was causing crashes and I added guards to ignore these missing objects. I'm more and more convinced that this is just how Android sometimes dumps the heap, though I'm not sure what's causing it. I'll probably remove these logs in the next release (keeping this open to remember to do it).
I'm getting now two new messages:
JniGlobal gc root ignored because it's pointing to unknown object @345583560
JniGlobal gc root ignored because it's pointing to unknown object @344995432
Invalid Hprof? Found unknown object id 344995432
Invalid Hprof? Found unknown object id 345583560
And I'm getting this warnings in my Pixel 3XL (Android 10) and the emulator (Android 9). And I can reproduce that state nearly always.
I imagine that I can ignore those too, right?
Yes
I don't know if it is related. I got today:
```
INSTRUMENTATION_STATUS: test=testPinTried8TimesShowsBlockedFor1Hour
INSTRUMENTATION_STATUS: class=com.company.android.tests.ChangePinTests
INSTRUMENTATION_STATUS: stack=java.lang.IllegalArgumentException: Object id 315456768 not found in heap dump.
at shark.HprofHeapGraph.findObjectById(HprofHeapGraph.kt:100)
at shark.internal.PathFinder.undominateWithSkips(PathFinder.kt:665)
at shark.internal.PathFinder.visitClassRecord(PathFinder.kt:382)
at shark.internal.PathFinder.findPathsFromGcRoots(PathFinder.kt:218)
at shark.internal.PathFinder.findPathsFromGcRoots(PathFinder.kt:169)
at shark.HeapAnalyzer.findLeaks(HeapAnalyzer.kt:159)
at shark.HeapAnalyzer.analyzeGraph(HeapAnalyzer.kt:144)
at shark.HeapAnalyzer.analyze(HeapAnalyzer.kt:96)
at shark.HeapAnalyzer.analyze$default(HeapAnalyzer.kt:77)
at leakcanary.InstrumentationLeakDetector.detectLeaks(InstrumentationLeakDetector.kt:173)
at leakcanary.FailTestOnLeakRunListener.detectLeaks(FailTestOnLeakRunListener.kt:105)
at leakcanary.FailTestOnLeakRunListener.testFinished(FailTestOnLeakRunListener.kt:87)
at org.junit.runner.notification.SynchronizedRunListener.testFinished(SynchronizedRunListener.java:56)
at org.junit.runner.notification.RunNotifier$7.notifyListener(RunNotifier.java:190)
at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
at org.junit.runner.notification.RunNotifier.fireTestFinished(RunNotifier.java:187)
at org.junit.internal.runners.model.EachTestNotifier.fireTestFinished(EachTestNotifier.java:38)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:331)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:392)
at com.company.test.runner.YInstrumentationRunner.onStart(YInstrumentationRunner.kt:40)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1932)
at shark.HeapAnalyzer.analyze(HeapAnalyzer.kt:103)
at shark.HeapAnalyzer.analyze$default(HeapAnalyzer.kt:77)
at leakcanary.InstrumentationLeakDetector.detectLeaks(InstrumentationLeakDetector.kt:173)
at leakcanary.FailTestOnLeakRunListener.detectLeaks(FailTestOnLeakRunListener.kt:105)
at leakcanary.FailTestOnLeakRunListener.testFinished(FailTestOnLeakRunListener.kt:87)
at org.junit.runner.notification.SynchronizedRunListener.testFinished(SynchronizedRunListener.java:56)
at org.junit.runner.notification.RunNotifier$7.notifyListener(RunNotifier.java:190)
at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
at org.junit.runner.notification.RunNotifier.fireTestFinished(RunNotifier.java:187)
at org.junit.internal.runners.model.EachTestNotifier.fireTestFinished(EachTestNotifier.java:38)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:331)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:392)
at com.company.test.runner.YInstrumentationRunner.onStart(YInstrumentationRunner.kt:40)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1932)
Caused by: java.lang.IllegalArgumentException: Object id 315456768 not found in heap dump.
at shark.HprofHeapGraph.findObjectById(HprofHeapGraph.kt:100)
at shark.internal.PathFinder.undominateWithSkips(PathFinder.kt:665)
at shark.internal.PathFinder.visitClassRecord(PathFinder.kt:382)
at shark.internal.PathFinder.findPathsFromGcRoots(PathFinder.kt:218)
at shark.internal.PathFinder.findPathsFromGcRoots(PathFinder.kt:169)
at shark.HeapAnalyzer.findLeaks(HeapAnalyzer.kt:159)
at shark.HeapAnalyzer.analyzeGraph(HeapAnalyzer.kt:144)
at shark.HeapAnalyzer.analyze(HeapAnalyzer.kt:96)
... 32 more
````
@emartynov if you can reproduce and can provide a hprof, then please open a new issue. If not, there's nothing I can do :)
Happened once today. No way I can find how to repro it. So please ignore it.