amzn / exoplayer-amazon-port

Official port of ExoPlayer for Amazon devices
Apache License 2.0
173 stars 80 forks source link

Exoplayer crashed when player.stop() or player.release() called #37

Closed cot-dev closed 6 years ago

cot-dev commented 6 years ago

Issue description

i'm developing some application using Exoplayer. at first, it's really good to play playready drm contents before it call stop() or release() function. i want to see other drm contents , so i call player.stop() or player.release() then android box automatically reboot right now.

Reproduction steps

playready drm contents play player.stop() or player.release() call application crash and android box reboot . ( it happens 100%)

Link to test content

playready contents with drm (no superspeed contents)

Version of ExoPlayer being used

i tested two version (2.6.1, 2.7.1) like this compile 'com.google.android.exoplayer:exoplayer-core:2.7.1' compile 'com.google.android.exoplayer:exoplayer-dash:2.7.1' compile 'com.google.android.exoplayer:exoplayer-ui:2.7.1' compile 'com.google.android.exoplayer:exoplayer-hls:2.7.1' compile 'com.google.android.exoplayer:exoplayer-smoothstreaming:2.7.1'

Device(s) and version(s) of Android being used

device name:Fire TV BOX (3rd Gen) Software Version:Fire OS 6.2.1.2

A full bug report captured from the device

private void stopVod() { if (player != null) { player.release(); player = null; trackSelector = null; eventLogger = null; } } 03-22 04:41:16.906 10863-10863/com.cotconnected.sirius I/ExoPlayerImpl: Release c7c0e5 [ExoPlayerLib/2.7.1] [needle, AFTN, Amazon, 25] [goog.exo.core, goog.exo.ui, goog.exo.smoothstreaming] 03-22 04:41:16.907 3117-10962/? I/OmxComponent: OMX_CommandStateSet 712 Cmd 0 nParam1 0x2 03-22 04:41:16.907 3117-10962/? I/OmxComponent: STATE_SET: OMX_StateExecuting => OMX_StateIdle : OMX.amlogic.avc.decoder.awesome.secure 03-22 04:41:16.907 3117-10962/? I/OmxComponent: OMX.amlogic.avc.decoder.awesome.secure: flush input 03-22 04:41:16.907 3117-10962/? V/AmlogicVideoDecoderAwesome: flushInput:644 > 03-22 04:41:16.907 3117-10962/? V/OMX_WorkerPeer: vendor/amlogic/libstagefrighthw/omx_framework/WorkerPeer.cpp:flushInput:56 -------------------- 03-22 04:41:16.907 3117-10962/? V/AmlogicVideoDecoderAwesome: pause:208 > 03-22 04:41:16.920 3117-10962/? V/AmlogicVideoDecoderAwesome: reset:248 > 03-22 04:41:16.920 3117-10962/? D/AmlogicVideoDecoderAwesome: reset_1 03-22 04:41:16.930 3117-10962/? I/amcodec: [codec_reset:1067]ret=0 03-22 04:41:16.931 3117-10962/? D/AmlogicVideoDecoderAwesome: reset_2 03-22 04:41:16.931 3117-10962/? D/AmlogicVideoDecoderAwesome: mDTaskStatus=1 03-22 04:41:16.931 3117-10962/? V/AmlogicVideoDecoderAwesome: start:216 > 03-22 04:41:16.931 3117-10962/? E/ThreadWorker: pthread on exit wait clean 03-22 04:41:16.931 3117-10962/? D/AmlogicVideoDecoderAwesome: mVideo start 03-22 04:41:16.931 3117-10962/? I/OmxComponent: OMX.amlogic.avc.decoder.awesome.secure: flush output 03-22 04:41:16.931 3117-10962/? V/AmlogicVideoDecoderAwesome: flushOutput:671 > 03-22 04:41:16.931 3117-10962/? D/AmlogicVideoDecoderAwesome: mVideo stop 03-22 04:41:16.931 3117-10982/? V/OMX_WorkerPeer: vendor/amlogic/libstagefrighthw/omx_framework/WorkerPeer.cpp:runWorkerStatic:152 -------------------- 03-22 04:41:16.931 3117-10982/? V/OMX_WorkerPeer: vendor/amlogic/libstagefrighthw/omx_framework/WorkerPeer.cpp:runWorker:158 -------------------- 03-22 04:41:16.933 3117-10962/? V/AmlogicVideoDecoderAwesome: stop:238 > 03-22 04:41:16.942 3117-10962/? I/OmxComponent: STATE_TRANS: OMX_StateExecuting => OMX_StateIdle : OMX.amlogic.avc.decoder.awesome.secure 03-22 04:41:16.942 3117-10962/? I/OmxComponent: STATE_TRANS: OMX_StateExecuting => OMX_StateIdle : OMX.amlogic.avc.decoder.awesome.secure 03-22 04:41:16.942 3117-10962/? I/OmxComponent: STATE_TRANS: OMX_StateExecuting => OMX_StateIdle : OMX.amlogic.avc.decoder.awesome.secure 03-22 04:41:16.942 3117-10962/? I/OmxComponent: STATE_DONE: OMX_StateExecuting => OMX_StateIdle : OMX.amlogic.avc.decoder.awesome.secure 03-22 04:41:16.944 3117-10962/? I/OmxComponent: OMX_CommandStateSet 712 Cmd 0 nParam1 0x1 03-22 04:41:16.944 3117-10962/? I/OmxComponent: STATE_SET: OMX_StateIdle => OMX_StateLoaded : OMX.amlogic.avc.decoder.awesome.secure 03-22 04:41:16.944 3117-10962/? V/AmlogicVideoDecoderAwesome: releaseResources:280 > 03-22 04:41:16.944 3117-10962/? V/AmlogicVideoDecoderAwesome: tearDown:1001 > 03-22 04:41:16.944 3117-10962/? V/AmlogicVideoDecoderAwesome: initializeState_l:1047 > 03-22 04:41:16.947 10863-10961/com.cotconnected.sirius D/SurfaceUtils: set up nativeWindow 0xddd57808 for 1x1, color 0x2, rotation 0, usage 0x930 03-22 04:41:16.959 3117-10962/? E/amdrmutils: segment 0: [54b00000-5eafffff] 03-22 04:41:16.959 3117-10962/? I/secmem_tz: used 1, i 0, start 54b00000 size a000000 03-22 04:41:16.959 3117-10962/? I/secmem_tz: used 1, i 1, start 0 size 1 03-22 04:41:16.954 10962-10962/? W/.awesome.secure: type=1400 audit(0.0:2074): avc: denied { read } for name="tvp_region" dev="sysfs" ino=11319 scontext=u:r:mediacodec:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0 03-22 04:41:16.961 5348-5348/? A/libc: Fatal signal 8 (SIGFPE), code -6, fault addr 0x14e4 in tid 5348 (surfaceflinger) [ 03-22 04:41:16.961 2993: 2993 W/ ] debuggerd: handling request: pid=5348 uid=1000 gid=1003 tid=5348 03-22 04:41:16.966 3117-10962/? D/AmlogicVideoDecoderAwesome: close seclib handle 03-22 04:41:16.967 3037-3131/? I/SystemControl: writeSysfs [ /sys/class/video/freerun_mode ] [ 0 ] from pid=3117, uid=1046, process name= 03-22 04:41:16.954 3131-3131/? W/Binder:3037_1: type=1400 audit(0.0:2075): avc: denied { sys_ptrace } for capability=19 scontext=u:r:system_control:s0 tcontext=u:r:system_control:s0 tclass=capability permissive=0 03-22 04:41:16.968 3037-3695/? I/SystemControl: writeSysfs [ /sys/module/amlvideodri/parameters/freerun_mode ] [ 0 ] from pid=3117, uid=1046, process name= 03-22 04:41:16.968 3037-3695/? E/SystemControl: writeSysFs, open /sys/module/amlvideodri/parameters/freerun_mode fail. 03-22 04:41:16.968 3117-10962/? V/AmlogicVideoDecoderAwesome: disable osd or videorm default,ret=0 03-22 04:41:16.968 3117-10962/? V/AmlogicVideoDecoderAwesome: disable osd video ...0 03-22 04:41:16.968 3117-10962/? I/OmxComponent: STATE_TRANS: OMX_StateIdle => OMX_StateLoaded : OMX.amlogic.avc.decoder.awesome.secure 03-22 04:41:16.968 3117-10962/? I/OmxComponent: STATE_DONE: OMX_StateIdle => OMX_StateLoaded : OMX.amlogic.avc.decoder.awesome.secure 03-22 04:41:16.954 3695-3695/? W/Binder:3037_2: type=1400 audit(0.0:2076): avc: denied { sys_ptrace } for capability=19 scontext=u:r:system_control:s0 tcontext=u:r:system_control:s0 tclass=capability permissive=0 03-22 04:41:17.027 10984-10984/? A/DEBUG: 03-22 04:41:17.027 10984-10984/? A/DEBUG: Build fingerprint: 'Amazon/needle:6.0/NS6212/927/N:user/amz-p,release-keys' 03-22 04:41:17.027 10984-10984/? A/DEBUG: Revision: '0' 03-22 04:41:17.027 10984-10984/? A/DEBUG: ABI: 'arm' 03-22 04:41:17.027 10984-10984/? A/DEBUG: pid: 5348, tid: 5348, name: surfaceflinger >>> /system/bin/surfaceflinger <<< 03-22 04:41:17.028 10984-10984/? A/DEBUG: signal 8 (SIGFPE), code -6 (SI_TKILL), fault addr 0x14e4 03-22 04:41:17.028 10984-10984/? A/DEBUG: r0 00000000 r1 000014e4 r2 00000008 r3 00000780 03-22 04:41:17.028 10984-10984/? A/DEBUG: r4 e8bff58c r5 00000008 r6 e8bff534 r7 0000010c 03-22 04:41:17.028 10984-10984/? A/DEBUG: r8 fff720f0 r9 fff720e0 sl 0011003e fp 00000003 03-22 04:41:17.028 10984-10984/? A/DEBUG: ip 00000009 sp fff720a8 lr e88a4457 pc e88a6cb4 cpsr 20070010 03-22 04:41:17.032 10984-10984/? A/DEBUG: backtrace: 03-22 04:41:17.032 10984-10984/? A/DEBUG: #00 pc 00049cb4 /system/lib/libc.so (tgkill+12) 03-22 04:41:17.032 10984-10984/? A/DEBUG: #1 pc 00047453 /system/lib/libc.so (pthread_kill+34) 03-22 04:41:17.032 10984-10984/? A/DEBUG: #2 pc 0001d755 /system/lib/libc.so (raise+10) 03-22 04:41:17.032 10984-10984/? A/DEBUG: #3 pc 0001f8c8 /system/lib/hw/hwcomposer.amlogic.so (aeabi_ldiv0+8) 03-22 04:41:17.032 10984-10984/? A/DEBUG: #4 pc 000117fb /system/lib/hw/hwcomposer.amlogic.so (_ZN7android7amlogic8HwcLayer15isInvalidScaledEv+94) 03-22 04:41:17.032 10984-10984/? A/DEBUG: #5 pc 0001671b /system/lib/hw/hwcomposer.amlogic.so (_ZN7android7amlogic14PhysicalDevice16layersStateCheckEiRNS_11KeyedVectorIyPNS0_8HwcLayerEEE+378) 03-22 04:41:17.032 10984-10984/? A/DEBUG: #6 pc 000167ab /system/lib/hw/hwcomposer.amlogic.so (_ZN7android7amlogic14PhysicalDevice15composersFilterERNS_11KeyedVectorIyPNS0_8HwcLayerEEE+86) 03-22 04:41:17.032 10984-10984/? A/DEBUG: #7 pc 00016fc5 /system/lib/hw/hwcomposer.amlogic.so (ZN7android7amlogic14PhysicalDevice15validateDisplayEPjS2+752) 03-22 04:41:17.032 10984-10984/? A/DEBUG: #8 pc 00023e37 /system/lib/libsurfaceflinger.so 03-22 04:41:17.032 10984-10984/? A/DEBUG: #9 pc 000429e1 /system/lib/libsurfaceflinger.so 03-22 04:41:17.032 10984-10984/? A/DEBUG: #10 pc 00014309 /system/lib/libsurfaceflinger.so 03-22 04:41:17.032 10984-10984/? A/DEBUG: #11 pc 0003963f /system/lib/libsurfaceflinger.so 03-22 04:41:17.033 10984-10984/? A/DEBUG: #12 pc 00038bbb /system/lib/libsurfaceflinger.so 03-22 04:41:17.033 10984-10984/? A/DEBUG: #13 pc 0003896f /system/lib/libsurfaceflinger.so 03-22 04:41:17.033 10984-10984/? A/DEBUG: #14 pc 00011e45 /system/lib/libutils.so (_ZN7android6Looper9pollInnerEi+492) 03-22 04:41:17.033 10984-10984/? A/DEBUG: #15 pc 00011bcb /system/lib/libutils.so (_ZN7android6Looper8pollOnceEiPiS1_PPv+26) 03-22 04:41:17.033 10984-10984/? A/DEBUG: #16 pc 00020039 /system/lib/libsurfaceflinger.so 03-22 04:41:17.033 10984-10984/? A/DEBUG: #17 pc 00038309 /system/lib/libsurfaceflinger.so (_ZN7android14SurfaceFlinger3runEv+8) 03-22 04:41:17.033 10984-10984/? A/DEBUG: #18 pc 000010bd /system/bin/surfaceflinger 03-22 04:41:17.033 10984-10984/? A/DEBUG: #19 pc 00016c5d /system/lib/libc.so (__libc_init+48) 03-22 04:41:17.033 10984-10984/? A/DEBUG: #20 pc 00000e90 /system/bin/surfaceflinger 03-22 04:41:17.153 5568-5754/? W/NativeCrashListener: Couldn't find ProcessRecord for pid 5348 03-22 04:41:17.159 10863-10961/com.cotconnected.sirius E/SurfaceUtils: error pushing blank frames: dequeueBuffer failed: Broken pipe (32) 03-22 04:41:17.159 10863-10875/com.cotconnected.sirius W/SurfaceComposerClient: ComposerService remote (surfaceflinger) died [0xd6c2cc40] 03-22 04:41:17.160 10342-10354/? W/SurfaceComposerClient: ComposerService remote (surfaceflinger) died [0xda9c3fc0] 03-22 04:41:17.160 5568-5618/? E/DisplayEventDispatcher: Display event receiver pipe was closed or an error occurred. events=0x9 03-22 04:41:17.160 5568-5592/? E/DisplayEventDispatcher: Display event receiver pipe was closed or an error occurred. events=0x9 03-22 04:41:17.160 10863-10933/com.cotconnected.sirius E/DisplayEventDispatcher: Display event receiver pipe was closed or an error occurred. events=0x9 03-22 04:41:17.160 10863-10896/? E/OpenGLRenderer: Display event receiver pipe was closed or an error occurred. events=0x9 03-22 04:41:17.160 5568-5568/? E/DisplayEventDispatcher: Display event receiver pipe was closed or an error occurred. events=0x9 03-22 04:41:17.160 6099-6111/? W/SurfaceComposerClient: ComposerService remote (surfaceflinger) died [0xd6c2cec0] 03-22 04:41:17.160 6099-6099/? E/DisplayEventDispatcher: Display event receiver pipe was closed or an error occurred. events=0x9 03-22 04:41:17.160 6099-6757/? E/OpenGLRenderer: Display event receiver pipe was closed or an error occurred. events=0x9 03-22 04:41:17.161 5568-6860/? W/SurfaceComposerClient: ComposerService remote (surfaceflinger) died [0xd6c2cfc0] 03-22 04:41:17.161 6473-6485/? W/SurfaceComposerClient: ComposerService remote (surfaceflinger) died [0xd6a1d300] 03-22 04:41:17.161 7758-7769/? W/SurfaceComposerClient: ComposerService remote (surfaceflinger) died [0xc7661080] 03-22 04:41:17.161 7758-7758/? E/DisplayEventDispatcher: Display event receiver pipe was closed or an error occurred. events=0x9 03-22 04:41:17.161 7758-8854/? E/OpenGLRenderer: Display event receiver pipe was closed or an error occurred. events=0x9 03-22 04:41:17.162 6473-6473/? E/DisplayEventDispatcher: Display event receiver pipe was closed or an error occurred. events=0x9 03-22 04:41:17.162 10342-10370/? E/OpenGLRenderer: Display event receiver pipe was closed or an error occurred. events=0x9 03-22 04:41:17.162 10863-10961/? E/SurfaceUtils: error pushing blank frames: api_disconnect failed: Broken pipe (32) 03-22 04:41:17.162 10863-10961/? E/SurfaceUtils: error pushing blank frames: api_connect failed: Broken pipe (32) 03-22 04:41:17.162 6388-6405/? W/SurfaceComposerClient: ComposerService remote (surfaceflinger) died [0xc8adb140] 03-22 04:41:17.162 10863-10960/? W/MediaCodec: native_window_api_disconnect returned an error: Broken pipe (-32) 03-22 04:41:17.162 3042-3042/? I/ServiceManager: service 'gpu' died 03-22 04:41:17.163 3042-3042/? I/ServiceManager: service 'SurfaceFlinger' died 03-22 04:41:17.163 3042-3042/? I/ServiceManager: service 'display.qservice' died 03-22 04:41:17.163 6172-6967/? W/SurfaceComposerClient: ComposerService remote (surfaceflinger) died [0xc903a700] 03-22 04:41:17.163 5568-5611/? E/DisplayEventDispatcher: Display event receiver pipe was closed or an error occurred. events=0x9 03-22 04:41:17.163 5568-5611/? E/PointerController: Display event receiver pipe was closed or an error occurred. events=0x9 03-22 04:41:17.163 5568-5611/? E/DisplayEventDispatcher: Display event receiver pipe was closed or an error occurred. events=0x9 [ 03-22 04:41:17.163 2993: 2993 W/ ] debuggerd: resuming target 5348 03-22 04:41:17.163 10863-10934/? I/MediaCodecLogger: MC Stop Time(start: 6571788, stop:6572045 :257 <profileMCStopEnd 700> 03-22 04:41:17.164 5568-5608/? I/BootReceiver: Copying /data/tombstones/tombstone_04 to DropBox (SYSTEM_TOMBSTONE) 03-22 04:41:17.362 3118-4497/? V/PlayReadyDrmPlugin: ~PlayReadyDrmPlugin >> 03-22 04:41:17.362 3118-4497/? V/PlayReadySessionManager: closeSessionInPlugin >> mSessionMap.size() 2 03-22 04:41:17.362 3118-4497/? V/PlayReadySession: ~PPlayReadySession >> sessionId = PR1 03-22 04:41:17.362 3118-4497/? V/PlayReadyContext: PlayReadyAppContext::terminate 03-22 04:41:17.362 3118-4497/? V/PlayReadyContext: ~PlayReadyDecryptContext >> 03-22 04:41:17.368 3117-3638/? E/OMXNodeInstance: !!! Observer died. Quickly, do something, ... anything... 03-22 04:41:17.368 3117-3638/? D/OmxComponentManagerImpl: DecreaseEntryNumByName pEntry->mNum=1, pEntry->mMaxNum:1,componentName:OMX.amlogic.avc.decoder.awesome.secure 03-22 04:41:17.369 3117-3638/? I/omx_core: OMX_freeHandlenum= 0 03-22 04:41:17.369 3117-3638/? D/AmlogicVideoDecoderAwesome: ~AmlogicVideoDecoderAwesome 03-22 04:41:17.369 3117-3117/? E/OMXNodeInstance: !!! Observer died. Quickly, do something, ... anything...

bugreport-NS6212-2018-03-22-04-09-55.zip

cot-dev commented 6 years ago

i installed in shaomi mi box. it did perfectly without crash.

peddisri commented 6 years ago

Thanks for the report. Can we get access to the content URL? You can send email to pii-ExoPlayer-core@amazon.com

cot-dev commented 6 years ago

i found root cause.

  1. i resized suface bigger than real screen resolution.
  2. i played vod contents.
  3. player.stop()

this case happen to call system crash. surface flinger is dead and system reboot.

so i modified step1. i resized suface fit as real screen resolution. then all crash is disappered.