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

LibreElec/Kodi/Tvheadend crashed when clicking a radio channel in Tvheadend client #687

Open
kkarsten62 opened this issue Oct 18, 2024 · 12 comments

Comments

@kkarsten62
Copy link

I already opened a ticket in Kodi forum:
https://forum.kodi.tv/showthread.php?tid=379169&pid=3212900#pid3212900
But people advised me to open the ticket here.

I am using LibreElec/Kodi/Tvheadend on a Intel NUC as server. And Fedora 40 Workstation on my Desktop Computer and on a Tablet as clients.

  • Free TV channels via DVB-T2
  • Private TV channels via IPTV
  • Free Radio channels via IPTV

All TV channels working fine on all three devices (NUC server, Desktop Workstation client, Tablet client)
Radio channels working fine on NUC server
Kodi crashed when a radio channels is clicked on Desktop Workstation client and Tablet client

Entry of a radio channel in iptv.m3u
https://paste.kodi.tv/vigetukodi

Here a some logs:
System environment of my Desktop computer
https://paste.kodi.tv/cizohaqide

Journalctl of relevant crash
https://paste.kodi.tv/asebidetuz.kodi

Tvheadend log
https://paste.kodi.tv/ecuvolofef

kodi.log
https://paste.kodi.tv/irugofodiz.kodi

For flatpak debugging I followed
https://docs.flatpak.org/en/latest/debugging.html
flatpak install --include-sdk --include-debug tv.kodi.Kodi
I choose:

  1. flathub’ (system)

Then:
flatpak run --command=sh --devel --filesystem=$(pwd) tv.kodi.Kodi
A new sh opened, but I don't know what to do here?!
Stepped out by CTRL-D

Instead:
coredumpctl list
flatpak-coredumpctl -m 14948 tv.kodi.Kodi
(gdb) bt full
See log here:
https://paste.kodi.tv/penuleyuca.kodi

Thanks for any help.
Karl

@ksooo
Copy link
Member

ksooo commented Oct 18, 2024

Kodi crashed when a radio channels is clicked on Desktop Workstation client and Tablet client

Was this a one-time crash or can you reproduce it?

@kkarsten62
Copy link
Author

kkarsten62 commented Oct 18, 2024

Was this a one-time crash or can you reproduce it?

Yes it can be reproduce.

  • On both devices, the Tablet Client and my Desktop Workstation client
  • Both with Fedora 40
  • Using TVheadend Client, connected to the Intel NUC Hardware installed with Libreelec/Kodi/Tvheadend server
  • Tvheadend client installed using Fedora GUI Software/Kodi (Flathub/Flatpak) on the both clients
  • Clicking on TV channel on NUC, Desktop, Tablet ==> ok
  • Click on radio channel NUC ==> ok
  • Click on radio channel on Tablet and Desktop => crash ==> Kodi disappears, Messagebox in Fedora shown up:"Ups! We are sorry, it looks "Kodi.bin" crashed. Please contact the developer if you want to report the issue."

@ksooo
Copy link
Member

ksooo commented Oct 18, 2024

Okay, from looking at the related code i cannot see where it crashes exactly. Would you be able to build the addon yourself so we get debug symbols?

@kkarsten62
Copy link
Author

Okay, from looking at the related code i cannot see where it crashes exactly. Would you be able to build the addon yourself so we get debug symbols?

I never did to build a Flatpack/Kodi Addon. But I am developer in C++, Qt, Python3 - so I will do my very best. Please give me some advice where to start.

@ksooo
Copy link
Member

ksooo commented Oct 18, 2024

@kkarsten62
Copy link
Author

I will set up on weekend a dedicated VM to build kodi and pvr.hts with debug symbols.

I just checked the debugging options adviced by https://docs.flatpak.org/en/latest/debugging.html#debug-shell.
But what I see this is not really helpful.
I did:
Delete existing Kodi Flatpak via GUI software app

$ flatpak install --include-sdk --include-debug tv.kodi.Kodi
$ flatpak run --command=sh --devel --filesystem=$(pwd) tv.kodi.Kodi
$ /app/bin/kodi

'this->recurse > 0' failed at ../src/pipewire/thread-loop.c:63 do_unlock()
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/intel-vaapi-driver/radeonsi_drv_video.so
libva info: Trying to open /usr/lib/x86_64-linux-gnu/GL/lib/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
amdgpu: amdgpu_cs_ctx_create2 failed. (-13)
/usr/include/c++/13.2.0/bits/basic_string.h:1226: std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_reference = const char&; size_type = long unsigned int]: Assertion '__pos <= size()' failed.
/app/bin/kodi: Zeile 216:   152 Abgebrochen             (Speicherabzug geschrieben) ${KODI_BINARY} ${ENV_ARGS} $SAVED_ARGS
find: ‘/home/karl/Computer/Backup/fromServer/Nextcloud_data’: Keine Berechtigung
find: ‘/home/karl/Computer/Backup/fromServer/proxy_certs’: Keine Berechtigung
Crash report available at /home/karl/.var/app/tv.kodi.Kodi/data/kodi_crashlog-20241019_110435.log

Crashlog: https://paste.kodi.tv/ugidaxariz.kodi

$ gdb /app/bin/kodi

GNU gdb (GDB) 15.1
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
"/app/bin/kodi": not in executable format: file format not recognized

(gdb) run

Starting program:  
No executable file specified.
Use the "file" or "exec-file" command.

@kkarsten62
Copy link
Author

I need a helping hand.

I set up a VM with a fresh Fedora 40 Workstation installation. Crash can be reproduce in this VM.
I followed https://github.com/xbmc/xbmc/blob/master/docs/README.Fedora.md
I cloned kodi and checkout branch Omega.
I installed compiler and all packages. libusb-devel was not found - so I installed libusb1-devel instead.
Then I switch to https://github.com/xbmc/xbmc/blob/master/docs/README.Linux.md
I followed the given instructions.
But now I am blocked at sudo make -C tools/depends/target/wayland-protocols PREFIX=/usr/local
First meson was missing. I installed it.
Next I run into:

$ LANG=C sudo make -C tools/depends/target/wayland-protocols PREFIX=/usr/local
make: Entering directory '/home/karl/kodi/tools/depends/target/wayland-protocols'
cd native/build; /bin/ninja -v install
ninja: error: loading 'build.ninja': No such file or directory
make: *** [Makefile:54: .installed-native] Error 1
make: Leaving directory '/home/karl/kodi/tools/depends/target/wayland-protocols'

I have no idea how to fix this.

@ksooo
Copy link
Member

ksooo commented Oct 19, 2024

I'm not a Linux guy. Maybe @howie-f can help?

@howie-f
Copy link

howie-f commented Oct 19, 2024

hi, @kkarsten62 unfortunately our build instructions for linux are somewhat outdated and i am on debian not fedora, but i'll try to help.

Let's assume you cloned the kodi repo to ~/xbmc. in case you cloned somewhere else (example ~/kodi) you would need to adjust the cmake command below accordingly.

so, first check out the omega branch.

fhw@xbmc-build:~/xbmc (master) $ git checkout Omega
Switched to branch 'Omega'
Your branch is up to date with 'origin/Omega'.
fhw@xbmc-build:~/xbmc (Omega) $

Then create the build directory and change into it:

fhw@xbmc-build:~/xbmc (Omega) $ mkdir pvr.hts-build && cd pvr.hts-build
fhw@xbmc-build:~/xbmc/pvr.hts-build (Omega) $

Next configure the build of pvr.hts with cmake (adjust the path ../../xbmc/cmake/addons, if needed)

cmake -DADDONS_TO_BUILD=pvr.hts \
          -DCMAKE_BUILD_TYPE=Debug \
          -DPACKAGE_ZIP=1 \
          ../../xbmc/cmake/addons

you should see something like

-- Configuring done
-- Generating done
-- Build files have been written to: /home/fhw/xbmc/pvr.hts-build

then build: make

-- Installing: /home/fhw/xbmc/pvr.hts-build/.install/pvr.hts/pvr.hts.so.21.1
-- Installing: /home/fhw/xbmc/pvr.hts-build/.install/pvr.hts/pvr.hts.so
[ 55%] Completed 'pvr.hts'
[100%] Built target pvr.hts

then package: make package-pvr.hts

CPack: Create package
CPack: - package: /home/fhw/xbmc/pvr.hts-build/pvr.hts-prefix/src/pvr.hts-build/addon-pvr.hts-21.2.5-linux.zip generated.
Built target addon-package
[100%] Built target package-pvr.hts

then install the zip on your target...
i hope this helps

@kkarsten62
Copy link
Author

Many thanks for your clear instructions. It`s works w/o any problem.
I see the zip file:

...
-- Up-to-date: /home/karl/xbmc/cmake/addons/output/addons/pvr.hts/pvr.hts.so
[ 44%] Completed 'pvr.hts'
[100%] Built target pvr.hts
[ 16%] Built target hts
[100%] Built target pvr.hts
Run CPack packaging tool...
CPack: Create package using ZIP
CPack: Install projects
CPack: - Run preinstall target for: pvr.hts
CPack: - Install project: pvr.hts []
CPack: -   Install component: pvr.hts-21.2.5-linux
CPack: Create package
CPack: - package: /home/karl/xbmc/pvr.hts-build/pvr.hts-prefix/src/pvr.hts-build/addon-pvr.hts-21.2.5-linux.zip generated.
Built target addon-package
[100%] Built target package-pvr.hts

I guess you know that...
I use always for huge compilation make -j$(nproc). Then all processors of my computer has something to do :-)

Later on I will check with the build zip, whether I see more for the related crash.

@kkarsten62
Copy link
Author

I am unsure how to debug now with the debug addon?!
I just did the following according to: https://docs.flatpak.org/en/latest/debugging.html
$ flatpak uninstall tv.kodi.Kodi
$ flatpak install --include-sdk --include-debug tv.kodi.Kodi

...
        KENNUNG                     Zweig           Op          Gegenstelle          Herunterladen
 1. [✓] tv.kodi.Kodi.Debug          stable          i           flathub              381,7 MB / 396,9 MB
 2. [✓] tv.kodi.Kodi                stable          i           flathub              178,3 MB / 222,8 MB

$ flatpak run --command=sh --devel --filesystem=$(pwd) tv.kodi.Kodi
Entering into debug shell
[📦 tv.kodi.Kodi ~]$ /app/bin/kodi
Terminal:

'this->recurse > 0' failed at ../src/pipewire/thread-loop.c:63 do_unlock()
libva info: VA-API version 1.19.0
libva error: vaGetDriverNameByIndex() failed with invalid VADisplay, driver_name = (null)

Manual installation of addon by zip file in Kodi
Clicking on radio channel
==> Crash
Terminal:

[📦 tv.kodi.Kodi ~]$ /app/bin/kodi
'this->recurse > 0' failed at ../src/pipewire/thread-loop.c:63 do_unlock()
libva info: VA-API version 1.19.0
libva error: vaGetDriverNameByIndex() failed with invalid VADisplay, driver_name = (null)
/buildstream-build/bst_build_dir/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/basic_string.h:1226: std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_reference = const char&; size_type = long unsigned int]: Assertion '__pos <= size()' failed.
/app/bin/kodi: Zeile 216:   550 Abgebrochen             (Speicherabzug geschrieben) ${KODI_BINARY} ${ENV_ARGS} $SAVED_ARGS
Crash report available at /home/karl/.var/app/tv.kodi.Kodi/data/kodi_crashlog-20241020_114746.log

Crash report https://paste.kodi.tv/modixefuje.kodi
CTRl_D exit from debug shell
journalctl -b
https://paste.kodi.tv/oyumokuvad.kodi

I guess this is still not very helpful. Please let me know how to debug this more in detail.

@ksooo
Copy link
Member

ksooo commented Oct 20, 2024

We need debug symbols, but I have no idea how to achieve this.

      Stack trace of thread 592:
                                                   #0  0x00007f258547ee84 n/a (/usr/lib/x86_64-linux-gnu/libc.so.6 + 0x90e84)
                                                   #1  0x00007f258542cdce n/a (/usr/lib/x86_64-linux-gnu/libc.so.6 + 0x3edce)
                                                   #2  0x00007f258541483f n/a (/usr/lib/x86_64-linux-gnu/libc.so.6 + 0x2683f)
                                                   #3  0x00007f25856ececd n/a (/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.32 + 0xececd)
                                                   #4  0x00007f258576a86b n/a (/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.32 + 0x16a86b)
                                                   #5  0x00007f254c58c04b n/a (/home/karl/.var/app/tv.kodi.Kodi/data/addons/pvr.hts/pvr.hts.so.21.2.5 + 0x18c04b)
                                                   #6  0x00007f254c58a134 n/a (/home/karl/.var/app/tv.kodi.Kodi/data/addons/pvr.hts/pvr.hts.so.21.2.5 + 0x18a134)
                                                   #7  0x00007f254c5898f6 n/a (/home/karl/.var/app/tv.kodi.Kodi/data/addons/pvr.hts/pvr.hts.so.21.2.5 + 0x1898f6)
                                                   #8  0x00007f254c589ed9 n/a (/home/karl/.var/app/tv.kodi.Kodi/data/addons/pvr.hts/pvr.hts.so.21.2.5 + 0x189ed9)
                                                   #9  0x00007f254c5895d7 n/a (/home/karl/.var/app/tv.kodi.Kodi/data/addons/pvr.hts/pvr.hts.so.21.2.5 + 0x1895d7)
                                                   #10 0x00007f254c51cde1 n/a (/home/karl/.var/app/tv.kodi.Kodi/data/addons/pvr.hts/pvr.hts.so.21.2.5 + 0x11cde1)
                                                   #11 0x00007f254c584153 n/a (/home/karl/.var/app/tv.kodi.Kodi/data/addons/pvr.hts/pvr.hts.so.21.2.5 + 0x184153)
                                                   #12 0x00007f254c5853dd n/a (/home/karl/.var/app/tv.kodi.Kodi/data/addons/pvr.hts/pvr.hts.so.21.2.5 + 0x1853dd)
                                                   #13 0x00007f254c52e916 n/a (/home/karl/.var/app/tv.kodi.Kodi/data/addons/pvr.hts/pvr.hts.so.21.2.5 + 0x12e916)
                                                   #14 0x00007f254c5515ad n/a (/home/karl/.var/app/tv.kodi.Kodi/data/addons/pvr.hts/pvr.hts.so.21.2.5 + 0x1515ad)
                                                   #15 0x00007f254c5514f5 n/a (/home/karl/.var/app/tv.kodi.Kodi/data/addons/pvr.hts/pvr.hts.so.21.2.5 + 0x1514f5)
                                                   #16 0x00007f254c55140d n/a (/home/karl/.var/app/tv.kodi.Kodi/data/addons/pvr.hts/pvr.hts.so.21.2.5 + 0x15140d)
                                                   #17 0x00007f254c551350 n/a (/home/karl/.var/app/tv.kodi.Kodi/data/addons/pvr.hts/pvr.hts.so.21.2.5 + 0x151350)
                                                   #18 0x00007f254c551266 n/a (/home/karl/.var/app/tv.kodi.Kodi/data/addons/pvr.hts/pvr.hts.so.21.2.5 + 0x151266)
                                                   #19 0x00007f25856f14e4 n/a (/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.32 + 0xf14e4)
                                                   #20 0x00007f258547cea9 n/a (/usr/lib/x86_64-linux-gnu/libc.so.6 + 0x8eea9)
                                                   #21 0x00007f2585504a44 n/a (/usr/lib/x86_64-linux-gnu/libc.so.6 + 0x116a44)
                                                   ELF object binary architecture: AMD x86-64

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

No branches or pull requests

3 participants