Kodi Community Forum

Full Version: Memory leak & SIGTRAP with paused playback of H.264 content
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

kodi crashes when x264 playback was kept too long in paused state.
Starting from a memory usage of ~660m (VSZ value displayed by top)
kodi adds around 1m/sec to around 1900m when it crashes.
To create the logs I used sample nr. 6 from the Kodi wiki:
https://kodi.wiki/view/Samples#Codecs.2C..._Subtitles

Using sample nr. 11 (mpeg2) the memory usage does not increase.
I saw these crashes with locally stored H.264  files and H.264 streams,
but not with other codecs.
Hitting play again to end the paused-state does not release the increased
memory usage. Each pause state adds more memory being used by kodi
so the crash can only be prevented by not using pause at all.
Please note that this crash is not caused by oom, the system has
16gb ram with more than 10gb free.

kodi debug log (shortened in-between by removing duplicate
CDRMAtomicRequest::LogAtomicRequest entries):
https://gist.github.com/bkuhls/b293532e6...c905cf6322

gdb backtrace: https://gist.github.com/bkuhls/45a5a9915...26f2494856

syslog:
Quote:traps: kodi.bin[1485] trap int3 ip:7fa7545c57d6 sp:7fff943e3880 error:0 in i965_dri.so[7fa75447b000+1363000]
PS: The sigtraps occur with mesa3d versions 20.3.5, 21.0.2 & 21.1.0-rc1.
While I didn't crash as hard as you appear to have, the long pause you noted seemed very similar to my case.  So I thought I would offer this suggestion in case it helps.

I recently discovered a playback issue if I left the media on pause for too long, something I normally don't do.  Kodi became very slow to respond, but if I hit stop and waited it would eventually get me back to Kodi gui.  But it would never play any other file over the network until I restarted.  But it appeared I still had a valid network connection.

I'm running Kodi via Libreelec 9.2.6 on my NUC8i3 over wifi.

I turned off ASPM in the BIOS and it resolved my issue.

Good luck.
(2021-04-21, 04:51)Jogee Wrote: [ -> ]But it would never play any other file over the network until I restarted.  But it appeared I still had a valid network connection.
Thanks for the hint but I think you are seeing a different problem, my files are stored on the local hdd of the Kodi machine.
The bug can be reproduced here with gbm/opengles but not with x11/opengl.