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

FATAL EXCEPTION: LeakCanary-Heap-Dump Failure during heap dump; check log output for details #226

Closed
bywyu opened this issue Jul 23, 2015 · 9 comments
Milestone

Comments

@bywyu
Copy link

bywyu commented Jul 23, 2015

 FATAL EXCEPTION: LeakCanary-Heap-Dump
 java.lang.RuntimeException: Failure during heap dump; check log output for details
    at dalvik.system.VMDebug.dumpHprofData(Native Method)
    at dalvik.system.VMDebug.dumpHprofData(VMDebug.java:305)
    at android.os.Debug.dumpHprofData(Debug.java:948)
    at com.squareup.leakcanary.AndroidHeapDumper.dumpHeap(AndroidHeapDumper.java:69)
    at com.squareup.leakcanary.RefWatcher.ensureGone(RefWatcher.java:122)
    at com.squareup.leakcanary.RefWatcher$5.run(RefWatcher.java:103)
    at android.os.Handler.handleCallback(Handler.java:730)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:137)
    at android.os.HandlerThread.run(HandlerThread.java:61)
@pyricau
Copy link
Member

pyricau commented Jul 23, 2015

Failure during heap dump; check log output for details => if would be nice to provide that log output.

I'll also need the android api version.

But otherwise, this looks like we could catch RuntimeException instead of just IOException.

@bywyu
Copy link
Author

bywyu commented Jul 24, 2015

sorry,i have check

dalvik/vm/native/dalvik_system_VMDebug.cpp file's Dalvik_dalvik_system_VMDebug_dumpHprofData mthod.
dalvik/vm/hprof/Hprof.cpp file's hprofDumpHeap method.

but i have no find log output.

android api version is 4.3.

could you catch RuntimeException instead of just IOException in latest version,thx.

@manijshrestha
Copy link

I am seeing this on 4.1.2 (Droid Razr) also.

@pyricau
Copy link
Member

pyricau commented Aug 27, 2015

Need logs. Closing.

@pyricau pyricau closed this as completed Aug 27, 2015
@Jedyny
Copy link

Jedyny commented Aug 28, 2015

I am getting the same issue.

Phone: HUAWEI G525-U00
Android: 4.1.2

08-28 11:49:00.810  13035-13077/com.example.android.debug E/dalvikvm﹕ can't open /storage/sdcard0/Download/leakcanary/suspected_leak_heapdump.hprof: Permission denied
08-28 11:49:00.830  13035-13077/com.example.android.debug W/dalvikvm﹕ threadid=24: thread exiting with uncaught exception (group=0x41ada438)
08-28 11:49:00.830  13035-13077/com.example.android.debug E/ACRA﹕ ACRA caught a RuntimeException for com.example.android.debug
    java.lang.RuntimeException: Failure during heap dump; check log output for details
            at dalvik.system.VMDebug.dumpHprofData(Native Method)
            at dalvik.system.VMDebug.dumpHprofData(VMDebug.java:302)
            at android.os.Debug.dumpHprofData(Debug.java:885)
            at com.squareup.leakcanary.AndroidHeapDumper.dumpHeap(AndroidHeapDumper.java:69)
            at com.squareup.leakcanary.RefWatcher.ensureGone(RefWatcher.java:122)
            at com.squareup.leakcanary.RefWatcher$5.run(RefWatcher.java:103)
            at android.os.Handler.handleCallback(Handler.java:615)
            at android.os.Handler.dispatchMessage(Handler.java:92)
            at android.os.Looper.loop(Looper.java:137)
            at android.os.HandlerThread.run(HandlerThread.java:60)

Apparently the file where the dump should be stored cannot be opened, but leakcanary does not fail gracefully then.

@pyricau pyricau reopened this Aug 28, 2015
pyricau added a commit that referenced this issue Aug 28, 2015
pyricau added a commit that referenced this issue Aug 28, 2015
Don't crash when heap dump fails #226
@pyricau pyricau closed this as completed Aug 28, 2015
@parahall
Copy link

parahall commented Sep 2, 2015

Guys
happens also on 4.0.4:

09-02 15:13:26.623 4756-4776/com.gettaxi.dbx.android I/dalvikvm﹕ hprof: dumping heap strings to "/mnt/sdcard/Download/leakcanary/suspected_leak_heapdump.hprof".
09-02 15:13:26.742 4756-4776/com.gettaxi.dbx.android E/dalvikvm﹕ can't open /mnt/sdcard/Download/leakcanary/suspected_leak_heapdump.hprof: Permission denied
09-02 15:13:26.747 4756-4877/com.gettaxi.dbx.android D/NativeCrypto﹕ Returned from SSL_Read() with result 289, error code 0 ssl=0xea5820, appData=0x1064a70
09-02 15:13:26.758 4756-4776/com.gettaxi.dbx.android W/dalvikvm﹕ threadid=12: thread exiting with uncaught exception (group=0x40c9d258)
09-02 15:13:26.769 4756-4776/com.gettaxi.dbx.android E/AndroidRuntime﹕ FATAL EXCEPTION: LeakCanary-Heap-Dump
java.lang.RuntimeException: Failure during heap dump; check log output for details
at dalvik.system.VMDebug.dumpHprofData(Native Method)
at dalvik.system.VMDebug.dumpHprofData(VMDebug.java:302)
at android.os.Debug.dumpHprofData(Debug.java:885)
at com.squareup.leakcanary.AndroidHeapDumper.dumpHeap(AndroidHeapDumper.java:69)
at com.squareup.leakcanary.RefWatcher.ensureGone(RefWatcher.java:122)
at com.squareup.leakcanary.RefWatcher$5.run(RefWatcher.java:103)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.os.HandlerThread.run(HandlerThread.java:60)

@allenchankl
Copy link

Got the same issue and it caused by dumping the log to a partition which is not exists (/mnt/sdcard)

@Maragues
Copy link
Contributor

I'm seeing the same issue on Nexus 4 running Android 4.0.4 (Genymotion), using leak canary 1.4-SNAPSHOT

dalvikvm: hprof: dumping heap strings to "/storage/emulated/0/Download/leakcanary/suspected_leak_heapdump.hprof".
E/dalvikvm: can't open /storage/emulated/0/Download/leakcanary/suspected_leak_heapdump.hprof: Permission denied

FATAL EXCEPTION: LeakCanary-Heap-Dump
         java.lang.RuntimeException: Failure during heap dump; check log output for details
         at dalvik.system.VMDebug.dumpHprofData(Native Method)
         at dalvik.system.VMDebug.dumpHprofData(VMDebug.java:296)
         at android.os.Debug.dumpHprofData(Debug.java:1132)
         at com.squareup.leakcanary.AndroidHeapDumper.dumpHeap(AndroidHeapDumper.java:69)
         at com.squareup.leakcanary.RefWatcher.ensureGone(RefWatcher.java:122)
         at com.squareup.leakcanary.RefWatcher$5.run(RefWatcher.java:103)
         at android.os.Handler.handleCallback(Handler.java:733)
         at android.os.Handler.dispatchMessage(Handler.java:95)
         at android.os.Looper.loop(Looper.java:136)
         at android.os.HandlerThread.run(HandlerThread.java:61)

The path /storage/emulated/0 does not exist

root@vbox86p:/storage/emulated # pwd
/storage/emulated
root@vbox86p:/storage/emulated # ls
legacy

inside legacy, I do see previous leaks

root@vbox86p:/storage/emulated # ls legacy/Download/leakcanary/detected_leaks/                                       
heap_dump_0.hprof
heap_dump_0.hprof.result
...

In this app, I've only used 1.4-SNAPSHOT.

Let me know if I can help any further

@vkash
Copy link

vkash commented Dec 14, 2015

Same exeption: E/dalvikvm: can't open /storage/emulated/0/Download/leakcanary/suspected_leak_heapdump.hprof: Permission denied
But folder exists /storage/emulated/0/Download/

@pyricau pyricau added this to the 1.4 milestone Jan 4, 2016
Yky pushed a commit to Yky/leakcanary that referenced this issue Feb 21, 2016
Yky pushed a commit to Yky/leakcanary that referenced this issue Feb 21, 2016
Pengchengxiang pushed a commit to XLibrarys/leakcanary that referenced this issue Jan 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants