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

Native crash Segmentation fault #631

Closed
zhfnjust opened this issue Sep 16, 2015 · 6 comments
Closed

Native crash Segmentation fault #631

zhfnjust opened this issue Sep 16, 2015 · 6 comments
Labels

Comments

@zhfnjust
Copy link

04-24 15:19:21.383  8403  8744 D dalvikvm: GC_FOR_ALLOC freed 1528K, 25% free 45227K/59544K, paused 141ms, total 141ms
04-24 15:19:21.383  8403  8744 I dalvikvm-heap: Forcing collection of SoftReferences for 8294416-byte allocation
04-24 15:19:21.533  8403  8744 D dalvikvm: GC_BEFORE_OOM freed 73K, 25% free 45154K/59544K, paused 149ms, total 149ms
04-24 15:19:21.533  8403  8744 E dalvikvm-heap: Out of memory on a 8294416-byte allocation.
04-24 15:19:21.543  8403  8744 I dalvikvm: "fifo-pool-thread-0" prio=5 tid=39 RUNNABLE
04-24 15:19:21.543  8403  8744 I dalvikvm:   | group="main" sCount=0 dsCount=0 obj=0x4233ac90 self=0x571fe128
04-24 15:19:21.543  8403  8744 I dalvikvm:   | sysTid=8744 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1461708160
04-24 15:19:21.543  8403  8744 I dalvikvm:   | state=R schedstat=( 1101720682 143437654 588 ) utm=102 stm=8 core=1
04-24 15:19:21.543  8403  8744 I dalvikvm:   at android.graphics.Bitmap.nativeCreate(Native Method)
04-24 15:19:21.543  8403  8744 I dalvikvm:   at android.graphics.Bitmap.createBitmap(Bitmap.java:810)
04-24 15:19:21.543  8403  8744 I dalvikvm:   at android.graphics.Bitmap.createBitmap(Bitmap.java:787)
04-24 15:19:21.543  8403  8744 I dalvikvm:   at android.graphics.Bitmap.createBitmap(Bitmap.java:754)
04-24 15:19:21.543  8403  8744 I dalvikvm:   at android.media.MediaMetadataRetriever._getFrameAtTime(Native Method)
04-24 15:19:21.543  8403  8744 I dalvikvm:   at android.media.MediaMetadataRetriever.getFrameAtTime(MediaMetadataRetriever.java:247)
04-24 15:19:21.543  8403  8744 I dalvikvm:   at android.media.MediaMetadataRetriever.getFrameAtTime(MediaMetadataRetriever.java:289)
04-24 15:19:21.543  8403  8744 I dalvikvm:   at com.bumptech.glide.load.resource.bitmap.t.a((null):-1)
04-24 15:19:21.543  8403  8744 I dalvikvm:   at com.bumptech.glide.load.resource.bitmap.h.a((null):-1)
04-24 15:19:21.543  8403  8744 I dalvikvm:   at com.bumptech.glide.load.resource.bitmap.h.a((null):-1)
04-24 15:19:21.543  8403  8744 I dalvikvm:   at com.bumptech.glide.load.resource.bitmap.o.a((null):-1)
04-24 15:19:21.543  8403  8744 I dalvikvm:   at com.bumptech.glide.load.resource.bitmap.o.a((null):-1)
04-24 15:19:21.543  8403  8744 I dalvikvm:   at com.bumptech.glide.load.engine.a.a((null):-1)
04-24 15:19:21.543  8403  8744 I dalvikvm:   at com.bumptech.glide.load.engine.a.e((null):-1)
04-24 15:19:21.543  8403  8744 I dalvikvm:   at com.bumptech.glide.load.engine.a.c((null):-1)
04-24 15:19:21.543  8403  8744 I dalvikvm:   at com.bumptech.glide.load.engine.EngineRunnable.f((null):-1)
04-24 15:19:21.543  8403  8744 I dalvikvm:   at com.bumptech.glide.load.engine.EngineRunnable.d((null):-1)
04-24 15:19:21.543  8403  8744 I dalvikvm:   at com.bumptech.glide.load.engine.EngineRunnable.run((null):-1)
04-24 15:19:21.543  8403  8744 I dalvikvm:   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
04-24 15:19:21.543  8403  8744 I dalvikvm:   at java.util.concurrent.FutureTask.run(FutureTask.java:237)
04-24 15:19:21.543  8403  8744 I dalvikvm:   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
04-24 15:19:21.543  8403  8744 I dalvikvm:   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
04-24 15:19:21.543  8403  8744 I dalvikvm:   at java.lang.Thread.run(Thread.java:841)
04-24 15:19:21.543  8403  8744 I dalvikvm:   at com.bumptech.glide.load.engine.executor.a$1.run((null):-1)
04-24 15:19:21.543  8403  8744 I dalvikvm: 
04-24 15:19:21.553  8403  8744 F libc    : Fatal signal 11 (SIGSEGV) at 0x00000024 (code=1), thread 8744 (fifo-pool-threa)


======================================================================



Native crash    Segmentation fault
unknown 0
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'vivo/msm8916_32/msm8916_32:4.4.4/KTU84P/eng.compiler.20150327:user/dev-keys'
Revision: '0'
pid: 8403, tid: 8744, name: fifo-pool-threa  >>> com.vivo.easyshare <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000024
    r0 00000000  r1 00000011  r2 00000024  r3 56d23e28
    r4 4c5e6334  r5 00000000  r6 50b62b3c  r7 57274cc4
    r8 00000000  r9 57274cb8  sl 571fe138  fp 59393b24
    ip 571fe148  sp 59393a88  lr 41551a7f  pc 41551a86  cpsr 60070030
    d0  64616f6c2e656428  d1  2e656e69676e656e
    d2  726f747563657875  d3  6e75722e3124616c
    d4  0000000000000000  d5  0000000040800000
    d6  3e4ccccd02e0b6f8  d7  42c800004c3062ba
    d8  000000003f800000  d9  4012f0013ef8c33f
    d10 400921fb54442d18  d11 3f86845b9e018584
    d12 4000000000000000  d13 3f0000003f02d08b
    d14 000000003f02d08b  d15 0000000000000000
    d16 0000023d00000000  d17 4020000000000000
    d18 3fe0000000000000  d19 00ff0078007c0077
    d20 7873727a71707175  d21 7d78777f7675767b
    d22 7974737b72717277  d23 ffffffffffffffff
    d24 ff0073d677d672d0  d25 ff007ae67ee679e6
    d26 ff0078447c447744  d27 ff007fd483d47ed4
    d28 0100010001000100  d29 0100010001000100
    d30 ffffffffffffffff  d31 ffffffffffffffff
    scr 20000017

backtrace:
    #00  pc 0004ea86  /system/lib/libdvm.so
    #01  pc 00013e7f  /system/lib/libmedia_jni.so
    #02  pc 0001c6f1  /system/lib/libmedia_jni.so
    #03  pc 000204cc  /system/lib/libdvm.so (dvmPlatformInvoke+112)
    #04  pc 00051157  /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+398)
    #05  pc 00029960  /system/lib/libdvm.so
    #06  pc 00030dec  /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
    #07  pc 0002e484  /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
    #08  pc 000635b9  /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+336)
    #09  pc 000635dd  /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
    #10  pc 000582bb  /system/lib/libdvm.so
    #11  pc 0000d251  /system/lib/libc.so (__thread_entry+44)
    #12  pc 0000d3f1  /system/lib/libc.so (pthread_create+316)

code around pc:
    41551a64 4603bd30 460db537 4619a801 f7fd4614  
    41551a74 4629fd43 f7fe9801 68e1fd7b f0116922  
    41551a84 58840f40 f3bfd001 a8018f5f fd5cf7fd  
    41551a94 bd3e4620 b5374603 a801460d 46144619  
    41551aa4 fd2af7fd 98014629 fd62f7fe 692268e1  
    41551ab4 0f40f011 5880d004 8f5ff3bf e000b284  
    41551ac4 a8015a84 fd40f7fd bd3eb220 b5374603  
    41551ad4 a801460d 46144619 fd0ef7fd 98014629  
    41551ae4 fd46f7fe 692268e1 0f40f011 5880d004  
    41551af4 8f5ff3bf e000b284 a8015a84 fd24f7fd  
    41551b04 bd3e4620 b5374603 a801460d 46144619  
    41551b14 fcf2f7fd 98014629 fd2af7fe 692268e1  
    41551b24 0f40f011 5880d004 8f5ff3bf e000b2c4  
    41551b34 a8015c84 fd08f7fd bd3eb260 b5374603  
    41551b44 a801460d 46144619 fcd6f7fd 98014629  
    41551b54 fd0ef7fe 692268e1 0f40f011 5880d003  

code around lr:
    41551a5c 4620fd77 b0034629 4603bd30 460db537  
    41551a6c 4619a801 f7fd4614 4629fd43 f7fe9801  
    41551a7c 68e1fd7b f0116922 58840f40 f3bfd001  
    41551a8c a8018f5f fd5cf7fd bd3e4620 b5374603  
    41551a9c a801460d 46144619 fd2af7fd 98014629  
    41551aac fd62f7fe 692268e1 0f40f011 5880d004  
    41551abc 8f5ff3bf e000b284 a8015a84 fd40f7fd  
    41551acc bd3eb220 b5374603 a801460d 46144619  
    41551adc fd0ef7fd 98014629 fd46f7fe 692268e1  
    41551aec 0f40f011 5880d004 8f5ff3bf e000b284  
    41551afc a8015a84 fd24f7fd bd3e4620 b5374603  
    41551b0c a801460d 46144619 fcf2f7fd 98014629  
    41551b1c fd2af7fe 692268e1 0f40f011 5880d004  
    41551b2c 8f5ff3bf e000b2c4 a8015c84 fd08f7fd  
    41551b3c bd3eb260 b5374603 a801460d 46144619  
    41551b4c fcd6f7fd 98014629 fd0ef7fe 692268e1  
@zhfnjust
Copy link
Author

this is my config

public class GlideConfiguration extends VolleyGlideModule {
    public static int MAX_MEMORY_CACHE_SIZE = 10*1024*1024;
    public static int MAX_BITMAP_POOL_SIZE = 12*1024*1024;
    @Override
    public void applyOptions(Context context, GlideBuilder builder) {
        // Do nothing.
        MemorySizeCalculator calculator = new MemorySizeCalculator(context);
        int defaultMemoryCacheSize = calculator.getMemoryCacheSize();
        int defaultBitmapPoolSize = calculator.getBitmapPoolSize();
        Timber.i("defaultMemoryCacheSize %d defaultBitmapPoolSize %d", defaultMemoryCacheSize, defaultBitmapPoolSize);
        builder.setDecodeFormat(DecodeFormat.PREFER_ARGB_8888)
                .setResizeService(new FifoPriorityThreadPoolExecutor(2))
                .setDiskCache(new InternalCacheDiskCacheFactory(context, 250 * 1024 * 1024))
                .setMemoryCache(new LruResourceCache(Math.min(MAX_MEMORY_CACHE_SIZE, defaultMemoryCacheSize)))
                .setBitmapPool(new LruBitmapPool(Math.min(MAX_BITMAP_POOL_SIZE, defaultBitmapPoolSize)));
    }

    @Override
    public void registerComponents(Context context, Glide glide) {
        super.registerComponents(context, glide);
    }
}

@TWiStErRob
Copy link
Collaborator

That's not a native crash, that's an OutOfMemoryError followed by a native crash. Solve the memory problem and the native crash with disappear.

@zhfnjust
Copy link
Author

zhfnjust commented Oct 8, 2015

@TWiStErRob I have not idea to solve the problem

@TWiStErRob
Copy link
Collaborator

The only thing I can imagine is watching the LogCat view while running the app, and when it's close to OOM take a heap dump and investigate what's taking up so much memory. It may be a leaked activity holding on to unnecessary bitmaps for example.

Check these:

@sjudd
Copy link
Collaborator

sjudd commented Oct 8, 2015

Yup OOM is definitely the issue. If you identify a memory leak in Glide, please feel free to re-open.

@sjudd sjudd closed this as completed Oct 8, 2015
@sjudd sjudd added the question label Oct 8, 2015
@quibbler01
Copy link

maybe leak

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

No branches or pull requests

4 participants