I develop android app and I want to download many files(about 1000 files).
it's with Okhttp and RxJava, and it in service.
but app must crashes by leak of file descriptor in loop about 200th:
AtomicInteger count = new AtomicInteger();
Observable.fromArray(list.toArray(new String[list.size()]))//url list
.subscribeOn(Schedulers.io())
.doOnNext(url -> {
Response response = request(url, null);
String lastSegment = url.substring(url.lastIndexOf("/")+1);
File file = new File(context.getFilesDir(), lastSegment);
file.createNewFile();
FileOutputStream fos = new FileOutputStream(file);
fos.write(response.body().bytes());
fos.close();
response.close();
})
.observeOn(AndroidSchedulers.mainThread())
.subscribe(url -> onProgress(stateCode, count.incrementAndGet(), list.size()),
this::handleError, this::onCompleteDl);
and error log:
06-15 06:26:52.204 22654-24804/{MY_PACKAEGENAME} A/libc: FORTIFY: FD_SET: file descriptor >= FD_SETSIZE
06-15 06:26:52.634 25745-25745/? A/google-breakpad: Microdump skipped (uninteresting)
06-15 06:26:52.794 22654-24804/{MY_PACKAEGENAME} A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 24804 (RxCachedThreadS)
06-15 06:26:52.854 18430-18430/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'samsung/SC-04F/SC-04F:6.0.1/MMB29M/SC04FOMU1XQH1:user/release-keys'
Revision: '13'
ABI: 'arm'
pid: 22654, tid: 24804, name: RxCachedThreadS >>> com.cks.hiroyuki2.radiko <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
06-15 06:26:53.024 18430-18430/? A/DEBUG: Abort message: 'FORTIFY: FD_SET: file descriptor >= FD_SETSIZE'
r0 00000000 r1 000060e4 r2 00000006 r3 87b03978
r4 87b03980 r5 87b03930 r6 0000000b r7 0000010c
r8 87afa6e4 r9 87afa778 sl 0000000a fp 00000002
ip 00000006 sp 87afa630 lr b6c8fc31 pc b6c92020 cpsr 40010010
06-15 06:26:53.044 18430-18430/? A/DEBUG: backtrace:
#00 pc 00042020 /system/lib/libc.so (tgkill+12)
#01 pc 0003fc2d /system/lib/libc.so (pthread_kill+32)
#02 pc 0001c3b3 /system/lib/libc.so (raise+10)
#03 pc 00019631 /system/lib/libc.so (__libc_android_abort+34)
#04 pc 00017584 /system/lib/libc.so (abort+4)
#05 pc 0001afc7 /system/lib/libc.so (__libc_fatal+16)
#06 pc 0001afdf /system/lib/libc.so (__fortify_chk_fail+18)
#07 pc 00045d85 /system/lib/libc.so (__FD_SET_chk+24)
#08 pc 0000a4cf /system/lib/libjavacrypto.so
#09 pc 0000b0ab /system/lib/libjavacrypto.so
#10 pc 033ec46f /system/framework/arm/boot.oat (offset 0x2f3a000)
06-15 06:27:00.724 18430-18430/? A/DEBUG: Tombstone written to: /data/tombstones/tombstone_02
I'm new to RxJava, so I think It's wrong to use RxJava.
How can I solve it? What's the wrong point?
Thanks in advance.
Related
A native crash happened in my Android application. This happens when I am running monkey test. From the error message and crash stack, it seems like a system problem. But I don't know about this error. My question is what does this crash mean? How can I solve it?
// CRASH: com.my.app (pid 4552)
// Short Msg: Native crash
// Long Msg: Native crash: Aborted
// Build Label: Lenovo/heart/heart:10/QKQ1.191014.001/11.5.250_200614:userdebug/test-keys
// Build Changelist: 11.5.250_200614
// Build Time: 1592147934000
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// Build fingerprint: 'Lenovo/heart/heart:10/QKQ1.191014.001/11.5.250_200614:userdebug/test-keys'
// Revision: '0'
// ABI: 'arm'
// Timestamp: 2020-10-16 14:19:20+0800
// pid: 4552, tid: 5214, name: plumber-android >>> com.my.app <<<
// uid: 10292
// signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
// Abort message: 'Could not write wake signal to fd 99 (returned -1): Bad file descriptor'
// r0 00000000 r1 0000145e r2 00000006 r3 c5d66e18
// r4 c5d66e2c r5 c5d66e10 r6 000011c8 r7 0000016b
// r8 c5d66e28 r9 c5d66e18 r10 c5d66e48 r11 c5d66e38
// ip 0000145e sp c5d66de8 lr f1f0f4cb pc f1f0f4de
//
// backtrace:
// #00 pc 000604de /apex/com.android.runtime/lib/bionic/libc.so (abort+166) (BuildId: b8ea1bc56f976308b1ee7e2335b3127e)
// #01 pc 00005a95 /system/lib/liblog.so (__android_log_assert+176) (BuildId: 87a4fc52c4da52007b41b9baaa778d64)
// #02 pc 0001066f /system/lib/libutils.so (android::Looper::wake()+110) (BuildId: 303a9d221465f0db9b5d760e0a0c6abe)
// #03 pc 00289b47 /system/framework/arm/boot-framework.oat (art_jni_trampoline+102) (BuildId: 39c685939f0d8867d4162c7a38d63ad3600807fd)
// #04 pc 0204f797 /memfd:/jit-cache (deleted) (android.os.MessageQueue.enqueueMessage+470)
// #04 pc 0204f797 /memfd:/jit-cache (deleted) (android.os.MessageQueue.enqueueMessage+470)
// #05 pc 02034cad /memfd:/jit-cache (deleted) (android.os.Handler.enqueueMessage+108)
// #06 pc 02053cb5 /memfd:/jit-cache (deleted) (android.os.Handler.sendMessageAtTime+244)
// #07 pc 0205d139 /memfd:/jit-cache (deleted) (android.os.Handler.sendMessageDelayed+120)
// #08 pc 020a22cd /memfd:/jit-cache (deleted) (android.os.Handler.post+76)
...
Sometimes, my application stops saying ->
A/libc: heap corruption detected by dlmalloc_real
Fatal signal 6 (SIGABRT), code -6 in tid 8614 (drotorres.uareu)
I'm tryng to track it, and resolve the cuase. My logcat out about the erros is that:
04-23 16:36:25.749 8614-8614/com.br.ufc.pedrotorres.uareu A/libc: heap corruption detected by dlmalloc_real
Fatal signal 6 (SIGABRT), code -6 in tid 8614 (drotorres.uareu)
04-23 16:36:25.859 395-395/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'samsung/j5xnlteub/j5xnlte:6.0.1/MMB29M/J510MNVJU2AQI1:user/release-keys'
Revision: '4'
ABI: 'arm'
pid: 8614, tid: 8614, name: drotorres.uareu >>> com.br.ufc.pedrotorres.uareu <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
04-23 16:36:25.879 395-395/? A/DEBUG: Abort message: 'heap corruption detected by dlmalloc_real'
r0 00000000 r1 000021a6 r2 00000006 r3 b6f11b94
r4 b6f11b9c r5 b6f11b4c r6 0000000b r7 0000010c
r8 be99b8fc r9 be99b894 sl 12cd2400 fp ffffffff
ip 00000006 sp be99b7a8 lr b6c90f15 pc b6c93310 cpsr 400f0010
04-23 16:36:25.889 395-395/? A/DEBUG: backtrace:
#00 pc 00044310 /system/lib/libc.so (tgkill+12)
#01 pc 00041f11 /system/lib/libc.so (pthread_kill+32)
#02 pc 0001ba13 /system/lib/libc.so (raise+10)
#03 pc 00018c81 /system/lib/libc.so (__libc_android_abort+34)
#04 pc 00016840 /system/lib/libc.so (abort+4)
#05 pc 0001a627 /system/lib/libc.so (__libc_fatal+16)
#06 pc 0002e221 /system/lib/libc.so (__bionic_heap_corruption_error+8)
#07 pc 0002f2bd /system/lib/libc.so (dlmalloc_real+628)
#08 pc 000485a9 /system/lib/libc++.so (_Znwj+16)
#09 pc 0010d319 /system/lib/libskia.so (_ZN16SkMallocPixelRef9NewDirectERK11SkImageInfoPvjP12SkColorTable+20)
#10 pc 000e95eb /system/lib/libskia.so (_ZN8SkBitmap9setPixelsEPvP12SkColorTable+30)
#11 pc 0007f9f1 /system/lib/libandroid_runtime.so
#12 pc 042dfd63 /system/framework/arm/boot.oat (offset 0x2fcf000)
04-23 16:36:26.309 395-395/? A/DEBUG: Tombstone written to: /data/tombstones/tombstone_09
04-23 16:36:26.309 395-395/? E/DEBUG: AM write failed: Broken pipe
my app at PlayStore is giving a strange ANR, it's specific to the model and the error doesn't give me clues where is the problem
this is the report at Play Console:
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'motorola/lux_retla_ds/lux_uds:6.0/MPD24.65-33.1/1:user/release-keys'
Revision: 'p2c0'
ABI: 'arm'
pid: 9584, tid: 9156, name: Chrome_InProcGp >>> com.leifacil.vademecum <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x301b
r0 b919d5a0 r1 00002fdb r2 0000301b r3 000000c0
r4 ba2a6d88 r5 b428c73c r6 ba2a6db8 r7 0000001b
r8 b91b0128 r9 0000305b sl 0c000000 fp 00000000
ip 00000000 sp 9d434fc8 lr 00000013 pc aa948730 cpsr 000f0030
backtrace:
#00 pc 0014a730 /system/vendor/lib/egl/libESXGLESv2_adreno.so (EsxMemPoolGeneral::ReturnMemory(EsxMemType, EsxTimestamp const*, unsigned int, gsl_memdesc*)+463)
#01 pc 00145325 /system/vendor/lib/egl/libESXGLESv2_adreno.so (EsxGfxMem::Destroy(EsxContext*)+644)
#02 pc 001019e5 /system/vendor/lib/egl/libESXGLESv2_adreno.so (EsxResource::SetGfxMem(EsxContext*, unsigned int, EsxGfxMem*, int)+132)
#03 pc 00101a3f /system/vendor/lib/egl/libESXGLESv2_adreno.so (EsxResource::FreeSubResource(EsxContext*, EsxSubResource*)+30)
#04 pc 00101b05 /system/vendor/lib/egl/libESXGLESv2_adreno.so (EsxResource::SetSubResource(EsxContext*, unsigned int, EsxSubResource*)+36)
#05 pc 00101d03 /system/vendor/lib/egl/libESXGLESv2_adreno.so (EsxResource::Destroy(EsxContext*)+290)
#06 pc 001210f5 /system/vendor/lib/egl/libESXGLESv2_adreno.so (EglImage::Destroy()+20)
#07 pc 0011d88b /system/vendor/lib/egl/libESXGLESv2_adreno.so (EglSurfaceAccess::~EglSurfaceAccess()+10)
#08 pc 0011a161 /system/vendor/lib/egl/libESXGLESv2_adreno.so (EglApi::DestroyImage(void*, void*)+64)
#09 pc 0001440d /system/lib/libEGL.so (eglDestroyImageKHR+44)
#10 pc 0036c93f /data/app/com.google.android.webview-1/lib/arm/libwebviewchromium.so
I am running into an issue in my Android app where Galaxy Note 4, Galaxy Edge, and some other devices crash when trying to play H.264 video streamed from a server. I'm fairly certain that the H.264 video is correct, as the same video works using the same decoder on other devices. In addition, the devices that are crashing support the decoder that I'm using.
It doesn't crash in my source code, but it does crash the app. Has anyone ever run into this issue? If so, could you give me some help on what I could do to figure out what is happening? Here's the message I'm getting from the Developer Console in Google Play:
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'Verizon/trltevzw/trltevzw:5.0.1/LRX22C/N910VVRU1BOAF:user/release-keys'
Revision: '12'
ABI: 'arm'
pid: 32467, tid: 32524, name: CodecLooper >>> com.xxxx.xxxx<<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'frameworks/av/media/libstagefright/ACodec.cpp:1304 CHECK_EQ( mOMX->freeBuffer( mNode, portIndex, info->mBufferID),(status_t)OK) failed: -2147483648 vs. 0'
r0 00000000 r1 00007f0c r2 00000006 r3 00000000
r4 a160fdb8 r5 00000006 r6 00000000 r7 0000010c
r8 00000015 r9 00000000 sl a160fcf4 fp a160fdb0
ip 00007f0c sp a160f6d0 lr b6e9dff5 pc b6ec1998 cpsr 600f0010
backtrace:
#00 pc 00037998 /system/lib/libc.so (tgkill+12)
#01 pc 00013ff1 /system/lib/libc.so (pthread_kill+52)
#02 pc 00014c0f /system/lib/libc.so (raise+10)
#03 pc 00011531 /system/lib/libc.so (__libc_android_abort+36)
#04 pc 0000fcbc /system/lib/libc.so (abort+4)
#05 pc 00007709 /system/lib/libcutils.so (__android_log_assert+88)
#06 pc 000672f9 /system/lib/libstagefright.so (android::ACodec::freeBuffer(unsigned int, unsigned int)+152)
#07 pc 00067589 /system/lib/libstagefright.so (android::ACodec::freeOutputBuffersNotOwnedByComponent()+56)
#08 pc 0006b86f /system/lib/libstagefright.so (android::ACodec::ExecutingState::onOMXEvent(OMX_EVENTTYPE, unsigned int, unsigned int)+210)
#09 pc 0006ba23 /system/lib/libstagefright.so (android::ACodec::BaseState::onOMXMessage(android::sp<android::AMessage> const&)+342)
#10 pc 0006bc71 /system/lib/libstagefright.so (android::ACodec::BaseState::onMessageReceived(android::sp<android::AMessage> const&)+84)
#11 pc 0006c0e1 /system/lib/libstagefright.so (android::ACodec::ExecutingState::onMessageReceived(android::sp<android::AMessage> const&)+652)
#12 pc 00009819 /system/lib/libstagefright_foundation.so (android::AHierarchicalStateMachine::handleMessage(android::sp<android::AMessage> const&)+44)
#13 pc 00061a6f /system/lib/libstagefright.so
#14 pc 0000a5a3 /system/lib/libstagefright_foundation.so (android::ALooperRoster::deliverMessage(android::sp<android::AMessage> const&)+166)
#15 pc 00009f25 /system/lib/libstagefright_foundation.so (android::ALooper::loop()+220)
#16 pc 0000ef11 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+112)
#17 pc 0000ea81 /system/lib/libutils.so
#18 pc 000137bb /system/lib/libc.so (__pthread_start(void*)+30)
#19 pc 0001189b /system/lib/libc.so (__start_thread+6)
A user with a Galaxy Note4 with Android 5.0 had my app crash yesterday. This was the stack trace.
My app is mostly just a webview wrapper of a website. Is there anything I can do to improve the webview or make it more efficient to prevent the 20 or so crashes I'm getting a week that all have this same stack trace?
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'samsung/trlteuc/trlteatt:5.0.1/LRX22C/N910AUCU2COC6:user/release-keys'
Revision: '12'
ABI: 'arm'
pid: 421, tid: 421, name: ****.app >>> org.***********.app <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: '[FATAL:jni_android.cc(249)] Check failed: false. Please include Java exception stack in crash report
'
r0 00000000 r1 000001a5 r2 00000006 r3 00000000
r4 b6fd3114 r5 00000006 r6 0000000b r7 0000010c
r8 b6fb2e04 r9 be972e14 sl 00000000 fp b3be8ac4
ip 000001a5 sp be972968 lr b6f5cff5 pc b6f7f9fc cpsr 600f0010
backtrace:
#00 pc 000369fc /system/lib/libc.so (tgkill+12)
#01 pc 00013ff1 /system/lib/libc.so (pthread_kill+52)
#02 pc 00014c0f /system/lib/libc.so (raise+10)
#03 pc 00011531 /system/lib/libc.so (__libc_android_abort+36)
#04 pc 0000fcbc /system/lib/libc.so (abort+4)
#05 pc 002b8bf9 /data/app/com.google.android.webview-1/lib/arm/libwebviewchromium.so