Kodi Community Forum
Android Read chunked causes Kodi to crash - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: PVR & Live TV Support (https://forum.kodi.tv/forumdisplay.php?fid=167)
+---- Forum: DVBViewer (https://forum.kodi.tv/forumdisplay.php?fid=219)
+---- Thread: Android Read chunked causes Kodi to crash (/showthread.php?tid=335522)

Pages: 1 2 3


Read chunked causes Kodi to crash - CiNcH - 2018-09-13

Kodi builds with DVBViewer Client Add-on >= 3.6.7/3.6.8 crash for me on PVR channel playback.

I am attaching a Kodi log and crash dump. [DOWNLOAD]

 
Code:
09-13 16:40:20.108  2471  3008 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 3008 (Thread-13)
09-13 16:40:20.115  1108  1108 W         : debuggerd: handling request: pid=2471 uid=10155 gid=10155 tid=3008
09-13 16:40:20.437  3124  3124 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-13 16:40:20.437  3124  3124 F DEBUG   : Build fingerprint: 'Sony/BRAVIA_ATV3_4K_EU/BRAVIA_ATV3_4K:7.0/NRD91N.S139/1.6.0.56.29.1.00:user/release-keys'
09-13 16:40:20.437  3124  3124 F DEBUG   : Revision: '0'
09-13 16:40:20.437  3124  3124 F DEBUG   : ABI: 'arm'
09-13 16:40:20.437  3124  3124 F DEBUG   : pid: 2471, tid: 3008, name: Thread-13  >>> org.xbmc.kodi <<<
09-13 16:40:20.437  3124  3124 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
09-13 16:40:20.437  3124  3124 F DEBUG   :     r0 00000000  r1 00000bc0  r2 00000006  r3 00000008
09-13 16:40:20.437  3124  3124 F DEBUG   :     r4 7be7f978  r5 00000006  r6 7be7f920  r7 0000010c
09-13 16:40:20.437  3124  3124 F DEBUG   :     r8 ffffffea  r9 7f5f63e8  sl 7f5f63a8  fp dfb9b0bb
09-13 16:40:20.437  3124  3124 F DEBUG   :     ip 00000000  sp 7be7f2c8  lr ada14447  pc ada16ca4  cpsr 280f0010
09-13 16:40:20.490  3124  3124 F DEBUG   :
09-13 16:40:20.490  3124  3124 F DEBUG   : backtrace:
09-13 16:40:20.490  3124  3124 F DEBUG   :     #00 pc 00049ca4  /system/lib/libc.so (tgkill+12)
09-13 16:40:20.490  3124  3124 F DEBUG   :     #01 pc 00047443  /system/lib/libc.so (pthread_kill+34)
09-13 16:40:20.490  3124  3124 F DEBUG   :     #02 pc 0001d745  /system/lib/libc.so (raise+10)
09-13 16:40:20.490  3124  3124 F DEBUG   :     #03 pc 00019291  /system/lib/libc.so (__libc_android_abort+34)
09-13 16:40:20.490  3124  3124 F DEBUG   :     #04 pc 00017034  /system/lib/libc.so (abort+4)
09-13 16:40:20.490  3124  3124 F DEBUG   :     #05 pc 027aa928  /data/app/org.xbmc.kodi-1/lib/arm/libkodi.so
09-13 16:40:20.490  3124  3124 F DEBUG   :     #06 pc 027ab228  /data/app/org.xbmc.kodi-1/lib/arm/libkodi.so (avio_read+132)
09-13 16:40:20.490  3124  3124 F DEBUG   :     #07 pc 0287b6fc  /data/app/org.xbmc.kodi-1/lib/arm/libkodi.so
09-13 16:40:20.490  3124  3124 F DEBUG   :     #08 pc 0287b610  /data/app/org.xbmc.kodi-1/lib/arm/libkodi.so
09-13 16:40:20.490  3124  3124 F DEBUG   :     #09 pc 02878060  /data/app/org.xbmc.kodi-1/lib/arm/libkodi.so
09-13 16:40:20.490  3124  3124 F DEBUG   :     #10 pc 027b6090  /data/app/org.xbmc.kodi-1/lib/arm/libkodi.so (ff_read_packet+1852)
09-13 16:40:20.490  3124  3124 F DEBUG   :     #11 pc 027b768c  /data/app/org.xbmc.kodi-1/lib/arm/libkodi.so
09-13 16:40:20.490  3124  3124 F DEBUG   :     #12 pc 027b7188  /data/app/org.xbmc.kodi-1/lib/arm/libkodi.so (av_read_frame+1000)
09-13 16:40:20.490  3124  3124 F DEBUG   :     #13 pc 00eba1d8  /data/app/org.xbmc.kodi-1/lib/arm/libkodi.so (_ZN15CDVDDemuxFFmpeg4ReadEv+128)
09-13 16:40:20.490  3124  3124 F DEBUG   :     #14 pc 00f1a54c  /data/app/org.xbmc.kodi-1/lib/arm/libkodi.so (_ZN12CVideoPlayer10ReadPacketERP11DemuxPacketRP12CDemuxStream+344)
09-13 16:40:20.490  3124  3124 F DEBUG   :     #15 pc 00f1c628  /data/app/org.xbmc.kodi-1/lib/arm/libkodi.so (_ZN12CVideoPlayer7ProcessEv+504)
09-13 16:40:20.490  3124  3124 F DEBUG   :     #16 pc 011c0bb4  /data/app/org.xbmc.kodi-1/lib/arm/libkodi.so (_ZN7CThread6ActionEv+40)
09-13 16:40:20.490  3124  3124 F DEBUG   :     #17 pc 011bfef0  /data/app/org.xbmc.kodi-1/lib/arm/libkodi.so (_ZN7CThread12staticThreadEPv+212)
09-13 16:40:20.491  3124  3124 F DEBUG   :     #18 pc 00046f13  /system/lib/libc.so (_ZL15__pthread_startPv+22)
09-13 16:40:20.491  3124  3124 F DEBUG   :     #19 pc 00019cdd  /system/lib/libc.so (__start_thread+6)



RE: Read chunked still causes Kodi to crash - manül - 2018-09-13

Doesn't look PVR related. Also recently there were no streaming relevant changes. However if you want you can try to downgrade the PVR without downgrading Kodi just to make sure


RE: Read chunked still causes Kodi to crash - CiNcH - 2018-09-13

Afraid I can't do that on Android.

Tried the following builds:

20180905-b69ac071: crashes
20180902-7d6fddb3: doesn't crash


RE: Read chunked still causes Kodi to crash - CiNcH - 2018-09-13

20180903-5d7e1dbd: doesn't crash

No APK available for the 4th of September. Build from the 5th is the first one that crashes.


RE: Read chunked causes Kodi to crash - CiNcH - 2018-09-13

I now set the chunk size to 4K which is the default in case GetStreamReadChunkSize is not implemented by the add-on, see here. Now it is not crashing anymore.

So it is for sure related to the chunk size.


RE: Read chunked causes Kodi to crash - manül - 2018-09-13

Ah I remember. 3.6.7 was buggy. 3.6.8 should have fixed that. You sure it's crashing with 3.6.8?


RE: Read chunked causes Kodi to crash - CiNcH - 2018-09-13

I am using latest nightly with 3.7.0. So it does not mistake KByte for Byte anymore. 64K crashes, 4K does not.


Read chunked causes Kodi to crash - puenktchen - 2018-09-13

It was me who requested the GetStreamReadChunkSize because i had picture freezes when starting live tv or switching channels and sometimes some kind of buffering. The reason for the request was, if you create a ticket on trac.kodi.tv they just blame the addon because of missing api parameters. Unfortunately my problem still isn't solved, but it doesn't crash for me. If you look around in the forum there are many posts with different problems and different pvr addons regarding live tv under Leia. But sometimes it seems if you don't have Kodi on Linux and Tvheadend, nobody cares.
Anyway i will create a new ticket and you should do the same.


RE: Read chunked causes Kodi to crash - CiNcH - 2018-09-13

On my slow and buggy Sony Android TV, I don't have any problems with switching channels or buffering/picture freeze. And I am even on Wi-Fi. iperf3 attests a throughput of 250mbps (while my iPhone X does 500-600mbps at the same distance with the same 802.11ac 2x2 MIMO configuration).

64K chunks crash Kodi reproducibly when starting a PVR stream. Probably @FernetMenta has an idea, see crash dump in the first posting.


RE: Read chunked causes Kodi to crash - CiNcH - 2018-09-14

Created a ticket.


RE: Read chunked causes Kodi to crash - FernetMenta - 2018-09-14

(2018-09-13, 21:09)CiNcH Wrote: On my slow and buggy Sony Android TV, I don't have any problems with switching channels or buffering/picture freeze. And I am even on Wi-Fi. iperf3 attests a throughput of 250mbps (while my iPhone X does 500-600mbps at the same distance with the same 802.11ac 2x2 MIMO configuration).

64K chunks crash Kodi reproducibly when starting a PVR stream. Probably @FernetMenta has an idea, see crash dump in the first posting.
 This is not a crash but an assertion in ffmpeg. Means ffmpeg deliberately terminates the app because a logical problem. Since actual read function is implemented by the addon, my guess is that it is the addon that violates the contract.


RE: Read chunked causes Kodi to crash - manül - 2018-09-14

I'm not entirely sure about the cause of the crash assert. Didn't have any problems until I removed the stream read chunk size setting value from my profile yesterday evening. My first reaction was: Oh, there must be a bug in the setting implementation, maybe the PVR is somehow returning 0. So I modified the setting so that (like the custom timeout setting) a value of 0 is now Kodi's default (= I'm returning PVR_ERROR_NOT_IMPLEMENTED). This is implemented in v3.7.2 (including some other minor non crash related bugfixes).

Then I looked at the old implementation and thought: No, a bogus value can only happen if there's a bogus value saved in the user settings. However this wasn't the case as I simply removed the value for testing. Changed back to old implementation (v3.7.0) and no assert anymore.

So although I've now updated the setting/implementation I don't think I've fixed the underlying bug. However I also can't reproduce it anymore…

In the non-timeshifting case which @CiNcH is using the PVR is simply calling Kodi's ReadFile operation.


RE: Read chunked causes Kodi to crash - FernetMenta - 2018-09-14

(2018-09-14, 12:15)manül Wrote: In the non-timeshifting case which @CiNcH is using the PVR is simply calling Kodi's ReadFile operation.
The log shows that the addon's OpenLiveStream method is called:
https://github.com/xbmc/xbmc/blob/eb161cdb7c4c97e9f054192c9ea9e8d00839c305/xbmc/cores/VideoPlayer/DVDInputStreams/InputStreamPVRChannel.cpp#L35

Then it calls ReadLiveStream


RE: Read chunked causes Kodi to crash - CiNcH - 2018-09-14

Yes and ReadLiveStream calls ReadFile, see here.


RE: Read chunked causes Kodi to crash - FernetMenta - 2018-09-14

Maybe the addon passes the wrong flags when openening the file/stream