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

Addons crashing Kodi Matrix v19.0-6 in Arch Linux #19324

Closed
1 of 7 tasks
cg00001 opened this issue Mar 3, 2021 · 42 comments
Closed
1 of 7 tasks

Addons crashing Kodi Matrix v19.0-6 in Arch Linux #19324

cg00001 opened this issue Mar 3, 2021 · 42 comments
Labels
Platform: Linux Resolution: External a real bug, but not in the code in this repo (add link!)

Comments

@cg00001
Copy link

cg00001 commented Mar 3, 2021

Bug report

Describe the bug

Here is a clear and concise description of what the problem is:

Some addons crash, reading the logs I suspect that's because Arch Linux uses Python v3.9.2.
As an example, on an empty Kodi, I installed just TheMovieDb Helper and after restarting Kodi I tried to open it and it freezes, then shuts down after a few seconds. See the log.

Expected Behavior

Here is a clear and concise description of what was expected to happen:

Kodi 19 addons should work in Linux.

Actual Behavior

Some Kodi 19 addons don't work in Linux.

Possible Fix

To Reproduce

Steps to reproduce the behavior:

  1. Install eg TheMovieDb Helper and try to use it.

Debuglog

The debuglog can be found here:
https://pastebin.com/KYcH0FnW

Screenshots

Here are some links or screenshots to help explain the problem:

ksnip_20210303-113401

Additional context or screenshots (if appropriate)

Here is some additional context or explanation that might help:

Your Environment

Used Operating system:

  • Android

  • iOS

  • tvOS

  • Linux

  • OSX

  • Windows

  • Windows UWP

  • Operating system version/name:
    Arch Linux

  • Kodi version:
    Kodi v19.0-6

note: Once the issue is made we require you to update it with new information or Kodi versions should that be required.
Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.

@enen92
Copy link
Member

enen92 commented Mar 3, 2021

Can you get a crashlog? The debug log won't explain the reason for the crash. Either way I suspect this is YABDBR (yet another busydialog bug report :) )

@cg00001
Copy link
Author

cg00001 commented Mar 3, 2021

Can you get a crashlog? The debug log won't explain the reason for the crash. Either way I suspect this is YABDBR (yet another busydialog bug report :) )

Kodi crash log:
https://pastebin.com/C9r0FUSf

@wsnipex
Copy link
Member

wsnipex commented Mar 3, 2021

you need to install gdb to get a stack trace

@cg00001
Copy link
Author

cg00001 commented Mar 3, 2021

you need to install gdb to get a stack trace

Oops, hope this is it:
https://pastebin.com/s3dkemEe

@cg00001
Copy link
Author

cg00001 commented Mar 3, 2021

The first thing I noticed is numpy I remember I had to downgrade that in Kodi Leia:
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f103eddd0e8 in ?? () from /usr/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-x86_64-linux-gnu.so

@DaVukovic
Copy link
Member

Just to let you know....

There's a PR to bump the Python version to 3.8.8 (from 3.8.5). I somewhat guess we might backport that to Kodi Matrix as it fixes some CVEs and also for the reason it's micro-version-bump. But I highly guess we won't bump the minor version (3.8->3.9) for Matrix as the changelog compare to 3.8 is not that small ;)

https://docs.python.org/3/whatsnew/3.9.html

@cg00001
Copy link
Author

cg00001 commented Mar 5, 2021

Just to let you know....

There's a PR to bump the Python version to 3.8.8 (from 3.8.5). I somewhat guess we might backport that to Kodi Matrix as it fixes some CVEs and also for the reason it's micro-version-bump. But I highly guess we won't bump the minor version (3.8->3.9) for Matrix as the changelog compare to 3.8 is not that small ;)

https://docs.python.org/3/whatsnew/3.9.html

Thanks for the reply.
You think if I downgrade my Python to v3.8.8 at that time (or to v3.8.5 now) those freezes will be gone?

@zkte
Copy link

zkte commented Mar 5, 2021

this is a known issue pillow+numpy in Linux

sualfred/script.embuary.helper#28
jurialmunkey/plugin.video.themoviedb.helper#244

@cg00001
Copy link
Author

cg00001 commented Mar 5, 2021

this is a known issue pillow+numpy in Linux

sualfred/script.embuary.helper#28
jurialmunkey/plugin.video.themoviedb.helper#244
That was about Kodi Leia -notice the python2.7 bit.
I did try that on Kodi Matrix with Python v3.9.2, but numpy v1.15.4 gives errors with:
python -m ensurepip --user --default-pip
python -m pip install --user numpy==1.15.4
ksnip_20210305-093445
I guess I would have to use pyenv and install Python v3.8.5 in it to try.

@basilgello
Copy link
Collaborator

. But I highly guess we won't bump the minor version (3.8->3.9) for Matrix as the changelog compare to 3.8 is not that small ;)

In Debian, Python 3.9.1 is in testing and no new issues spotted so far (other than the fix I reported and rolled into RC1)

https://tracker.debian.org/pkg/python3-defaults

@cg00001
Copy link
Author

cg00001 commented Mar 5, 2021

. But I highly guess we won't bump the minor version (3.8->3.9) for Matrix as the changelog compare to 3.8 is not that small ;)

In Debian, Python 3.9.1 is in testing and no new issues spotted so far (other than the fix I reported and rolled into RC1)

https://tracker.debian.org/pkg/python3-defaults

Current version of Python in Arch is 3.9.2-1.

@cg00001
Copy link
Author

cg00001 commented Mar 5, 2021

I tried pyenv, set Python v3.8.5 as global, ran "pyenv exec kodi" a number of times, but after checking kodi.log it seems to use Python v3.9.2 instead of what pyenv suggested.
Even tried installing Kodi via pyenv.
I guess I'm back to Kodi Leia.

@cg00001
Copy link
Author

cg00001 commented Mar 5, 2021

If anyone has any suggestions, feel free to comment.

@cg00001
Copy link
Author

cg00001 commented Mar 6, 2021

Same issue still exists in Kodi v19.0-9.

@lrusak
Copy link
Contributor

lrusak commented Mar 6, 2021

Kodi is really only tested against the python version we have in our depends, so I would suggest using that version.

I believe python 3.9 may require other changes. It's unlikely Kodi 19 will fully support anything above 3.8 however we are always open to fixes. No one that I know of is actively working on it though.

@basilgello
Copy link
Collaborator

basilgello commented Mar 6, 2021

If anyone has any suggestions, feel free to comment.

I am now gonna make a snapshot of my Kodi development VM running Debian testing and install python3 3.9.2-2 from unstable.

If PIL crash is reproducible I will check the stacktrace. If not, you can port 3.9.2-2 from Debian to Arch and see which patch in Debian packaging (or a patch in Arch packaging) brings an error.

About the VM

The VM has the following addons installed at the moment:

audioencoder.kodi.builtin.aac v1.0.2 installed
audioencoder.kodi.builtin.wma v1.0.2 installed
game.controller.default v1.0.9 installed
game.controller.snes v1.0.9 installed
inputstream.adaptive v2.6.7 installed
inputstream.ffmpegdirect v1.19.2 installed
inputstream.rtmp v3.4.0 installed
kodi.binary.global.audioengine v1.1.1 installed
kodi.binary.global.filesystem v1.1.6 installed
kodi.binary.global.general v1.0.5 installed
kodi.binary.global.gui v5.15.0 installed
kodi.binary.global.main v1.3.0 installed
kodi.binary.global.network v1.0.4 installed
kodi.binary.global.tools v1.0.4 installed
kodi.binary.instance.audiodecoder v3.0.0 installed
kodi.binary.instance.audioencoder v2.1.0 installed
kodi.binary.instance.game v2.1.0 installed
kodi.binary.instance.imagedecoder v2.1.1 installed
kodi.binary.instance.inputstream v3.0.1 installed
kodi.binary.instance.peripheral v2.0.0 installed
kodi.binary.instance.pvr v7.1.0 installed
kodi.binary.instance.screensaver v2.1.0 installed
kodi.binary.instance.vfs v3.0.0 installed
kodi.binary.instance.videocodec v2.0.2 installed
kodi.binary.instance.visualization v3.0.0 installed
kodi.resource v1.0.0 installed
metadata.album.universal v3.1.4 installed
metadata.artists.universal v4.3.3 installed
metadata.common.allmusic.com v3.2.2 installed
metadata.common.fanart.tv v3.6.3 installed
metadata.common.imdb.com v3.1.6 installed
metadata.common.musicbrainz.org v2.2.4 installed
metadata.common.theaudiodb.com v2.0.3 installed
metadata.common.themoviedb.org v3.2.13 installed
metadata.generic.albums v1.0.14 installed
metadata.generic.artists v1.0.14 installed
metadata.local v1.0.1 installed
metadata.themoviedb.org v5.2.6 installed
metadata.themoviedb.org.python v1.3.1+matrix.1 installed
metadata.tvshows.themoviedb.org v3.5.13 installed
metadata.tvshows.themoviedb.org.python v1.4.0 installed
plugin.video.youtube v6.8.10+matrix.1 installed
pvr.iptvsimple v7.4.2 installed
repository.xbmc.org v3.2.5 installed
resource.images.weathericons.default v1.1.9 installed
resource.language.en_gb v2.0.2 installed
resource.language.uk_ua v9.0.14 installed
resource.timezone v1.0.0 installed
resource.uisounds.kodi v1.0.1 installed
screensaver.xbmc.builtin.black v1.0.34 installed
screensaver.xbmc.builtin.dim v1.0.64 installed
script.module.certifi v2019.11.28+matrix.1 installed
script.module.chardet v3.0.4+matrix.3 installed
script.module.future v0.18.2+matrix.1 installed
script.module.idna v2.8.1+matrix.1 installed
script.module.kodi-six v0.1.3.1 installed
script.module.pil v5.1.0 installed
script.module.pycryptodome v3.4.3 installed
script.module.requests v2.22.0+matrix.1 installed
script.module.six v1.14.0+matrix.2 installed
script.module.urllib3 v1.25.8+matrix.1 installed
script.transmission v1.0.2 installed
service.xbmc.versioncheck v0.5.14+matrix.1 installed
skin.estouchy v3.0.6 installed
skin.estuary v3.0.5 installed
visualization.spectrum v3.4.0 installed
weather.gismeteo v0.5.2+matrix.1 installed
webinterface.default v2.2.33 installed
xbmc.addon v19.0.0 installed
xbmc.core v0.1.0 installed
xbmc.gui v5.15.0 installed
xbmc.json v12.2.1 installed
xbmc.metadata v2.1.0 installed
xbmc.python v3.0.0 installed
xbmc.webinterface v1.0.0 installed

Tests Run:

  1. Start Kodi
  2. Let the weather pull in
  3. Update media library
  4. Stop Kodi

Run 1: Update Python3 only - works as expected

root@kodi-test:~# apt install -t unstable python3
Зчитування переліків пакунків... Виконано
Побудова дерева залежностей... Виконано            
Зчитування інформації про стан... Виконано   
The following additional packages will be installed:
  libpython3-stdlib libpython3.9 libpython3.9-minimal libpython3.9-stdlib python3-minimal python3.9 python3.9-minimal
Пропоновані пакунки:
  python3-doc python3-tk python3-venv python3.9-venv python3.9-doc binfmt-support
Пакунки, які будуть ОНОВЛЕНІ:
  libpython3-stdlib libpython3.9 libpython3.9-minimal libpython3.9-stdlib python3 python3-minimal python3.9 python3.9-minimal
оновлено 8, встановлено 0 нових, 0 відмічено для видалення і 69 не оновлено.
Необхідно завантажити 6 694 kB архівів.
Після цієї операції об'єм зайнятого дискового простору зменшиться на 104 kB.
Бажаєте продовжити? [Y/n] y
Отр:1 http://deb.debian.org/debian unstable/main amd64 python3.9 amd64 3.9.2-1 [466 kB]
Отр:2 http://deb.debian.org/debian unstable/main amd64 libpython3.9 amd64 3.9.2-1 [1 691 kB]
Отр:3 http://deb.debian.org/debian unstable/main amd64 python3.9-minimal amd64 3.9.2-1 [1 955 kB]
Отр:4 http://deb.debian.org/debian unstable/main amd64 libpython3.9-minimal amd64 3.9.2-1 [801 kB]
Отр:5 http://deb.debian.org/debian unstable/main amd64 libpython3.9-stdlib amd64 3.9.2-1 [1 684 kB]
Отр:6 http://deb.debian.org/debian unstable/main amd64 python3-minimal amd64 3.9.2-2 [38,2 kB]
Отр:7 http://deb.debian.org/debian unstable/main amd64 python3 amd64 3.9.2-2 [37,8 kB]
Отр:8 http://deb.debian.org/debian unstable/main amd64 libpython3-stdlib amd64 3.9.2-2 [21,3 kB]
Отримано 6 694 kB за 2сB (3 427 kB/s)             
Reading changelogs... Done
(Reading database ... 82037 files and directories currently installed.)
Preparing to unpack .../python3.9_3.9.2-1_amd64.deb ...
Unpacking python3.9 (3.9.2-1) over (3.9.1-4) ...
Preparing to unpack .../libpython3.9_3.9.2-1_amd64.deb ...
Unpacking libpython3.9:amd64 (3.9.2-1) over (3.9.1-4) ...
Preparing to unpack .../python3.9-minimal_3.9.2-1_amd64.deb ...
Unpacking python3.9-minimal (3.9.2-1) over (3.9.1-4) ...
Preparing to unpack .../libpython3.9-minimal_3.9.2-1_amd64.deb ...
Unpacking libpython3.9-minimal:amd64 (3.9.2-1) over (3.9.1-4) ...
Preparing to unpack .../libpython3.9-stdlib_3.9.2-1_amd64.deb ...
Unpacking libpython3.9-stdlib:amd64 (3.9.2-1) over (3.9.1-4) ...
Setting up libpython3.9-minimal:amd64 (3.9.2-1) ...
Setting up python3.9-minimal (3.9.2-1) ...
(Reading database ... 82037 files and directories currently installed.)
Preparing to unpack .../python3-minimal_3.9.2-2_amd64.deb ...
Unpacking python3-minimal (3.9.2-2) over (3.9.1-1) ...
Setting up python3-minimal (3.9.2-2) ...
(Reading database ... 82037 files and directories currently installed.)
Preparing to unpack .../python3_3.9.2-2_amd64.deb ...
running python pre-rtupdate hooks for python3.9...
Unpacking python3 (3.9.2-2) over (3.9.1-1) ...
Preparing to unpack .../libpython3-stdlib_3.9.2-2_amd64.deb ...
Unpacking libpython3-stdlib:amd64 (3.9.2-2) over (3.9.1-1) ...
Setting up libpython3.9-stdlib:amd64 (3.9.2-1) ...
Setting up libpython3-stdlib:amd64 (3.9.2-2) ...
Setting up libpython3.9:amd64 (3.9.2-1) ...
Setting up python3.9 (3.9.2-1) ...
Setting up python3 (3.9.2-2) ...
running python rtupdate hooks for python3.9...
running python post-rtupdate hooks for python3.9...
Processing triggers for mailcap (3.68) ...
Processing triggers for libc-bin (2.31-9) ...
Processing triggers for man-db (2.9.4-2) ...

Run 2: Update Python3-pil on top of updated Python3 - works as expected

ii  python3-pil:amd64                 8.1.1-1                           amd64        Python Imaging Library (Python3)
---

Run 3: Update all Python3 packages - works as expected

root@kodi-test:~#  apt install -t unstable $(dpkg -l | grep " python3-" | awk '{print $2}')
Зчитування переліків пакунків... Виконано
Побудова дерева залежностей... Виконано            
Зчитування інформації про стан... Виконано   
python3-avahi is already the newest version (0.8-5).
python3-chardet is already the newest version (4.0.0-1).
python3-chardet позначений як встановлений вручну.
python3-dbus is already the newest version (1.2.16-5).
python3-ldb is already the newest version (2:2.2.0-3+b1).
python3-ldb позначений як встановлений вручну.
python3-olefile is already the newest version (0.46-3).
python3-olefile позначений як встановлений вручну.
python3-bluez is already the newest version (0.23-3).
python3-bluez позначений як встановлений вручну.
python3-pycryptodome is already the newest version (3.9.7+dfsg1-1+b2).
python3-pycryptodome позначений як встановлений вручну.
python3-pycurl is already the newest version (7.43.0.6-5).
python3-pycurl позначений як встановлений вручну.
python3-gattlib is already the newest version (0~20201113-1+b1).
python3-gattlib позначений як встановлений вручну.
python3-gi is already the newest version (3.38.0-2).
python3-gi позначений як встановлений вручну.
python3-pysimplesoap is already the newest version (1.16.2-3).
python3-pysimplesoap позначений як встановлений вручну.
python3-apt is already the newest version (2.1.7).
python3-apt позначений як встановлений вручну.
python3-certifi is already the newest version (2020.6.20-1).
python3-certifi позначений як встановлений вручну.
python3-debian is already the newest version (0.1.39).
python3-debian позначений як встановлений вручну.
python3-debianbts is already the newest version (3.1.0).
python3-debianbts позначений як встановлений вручну.
python3-httplib2 is already the newest version (0.18.1-3).
python3-httplib2 позначений як встановлений вручну.
python3-idna is already the newest version (2.10-1).
python3-idna позначений як встановлений вручну.
python3-urllib3 is already the newest version (1.26.2-1).
python3-urllib3 позначений як встановлений вручну.
python3-gdbm is already the newest version (3.9.2-1).
python3-gdbm позначений як встановлений вручну.
python3-pyudev is already the newest version (0.22.0-2).
python3-usb is already the newest version (1.0.2-2).
python3-requests is already the newest version (2.25.1+dfsg-2).
python3-requests позначений як встановлений вручну.
python3-six is already the newest version (1.15.0-2).
python3-six позначений як встановлений вручну.
python3-talloc is already the newest version (2.3.1-2+b1).
python3-talloc позначений як встановлений вручну.
python3-pil is already the newest version (8.1.1-1).
python3-pil позначений як встановлений вручну.
python3-minimal is already the newest version (3.9.2-2).
python3-minimal позначений як встановлений вручну.
The following additional packages will be installed:
  debconf debconf-i18n reportbug
Пропоновані пакунки:
  debconf-doc debconf-utils libterm-readline-gnu-perl libgtk3-perl libnet-ldap-perl debconf-kde-helper python3-setuptools default-mta
  | postfix | exim4 | mail-transport-agent debsums dlocate python3-urwid reportbug-gtk xdg-utils emacs-bin-common claws-mail
Пакунки, які будуть ОНОВЛЕНІ:
  debconf debconf-i18n python3-debconf python3-pkg-resources python3-reportbug reportbug
оновлено 6, встановлено 0 нових, 0 відмічено для видалення і 62 не оновлено.
Необхідно завантажити 822 kB архівів.
Після цієї операції об'єм зайнятого дискового простору зросте на 0 B.
Бажаєте продовжити? [Y/n] y
Отр:1 http://deb.debian.org/debian unstable/main amd64 python3-debconf all 1.5.75 [4 016 B]
Отр:2 http://deb.debian.org/debian unstable/main amd64 debconf-i18n all 1.5.75 [206 kB]
Отр:3 http://deb.debian.org/debian unstable/main amd64 debconf all 1.5.75 [145 kB]
Отр:4 http://deb.debian.org/debian unstable/main amd64 reportbug all 7.10.3 [135 kB]
Отр:5 http://deb.debian.org/debian unstable/main amd64 python3-reportbug all 7.10.3 [143 kB]
Отр:6 http://deb.debian.org/debian unstable/main amd64 python3-pkg-resources all 52.0.0-3 [189 kB]
Отримано 822 kB за 1сB (691 kB/s)                 
Reading changelogs... Done
Передналаштування пакунків...
(Reading database ... 82024 files and directories currently installed.)
Preparing to unpack .../python3-debconf_1.5.75_all.deb ...
Unpacking python3-debconf (1.5.75) over (1.5.74) ...
Preparing to unpack .../debconf-i18n_1.5.75_all.deb ...
Unpacking debconf-i18n (1.5.75) over (1.5.74) ...
Preparing to unpack .../debconf_1.5.75_all.deb ...
Unpacking debconf (1.5.75) over (1.5.74) ...
Setting up debconf (1.5.75) ...
(Reading database ... 82024 files and directories currently installed.)
Preparing to unpack .../reportbug_7.10.3_all.deb ...
Unpacking reportbug (7.10.3) over (7.10.2) ...
Preparing to unpack .../python3-reportbug_7.10.3_all.deb ...
Unpacking python3-reportbug (7.10.3) over (7.10.2) ...
Preparing to unpack .../python3-pkg-resources_52.0.0-3_all.deb ...
Unpacking python3-pkg-resources (52.0.0-3) over (52.0.0-1) ...
Setting up python3-pkg-resources (52.0.0-3) ...
Setting up python3-debconf (1.5.75) ...
Setting up debconf-i18n (1.5.75) ...
Setting up python3-reportbug (7.10.3) ...
Setting up reportbug (7.10.3) ...
Processing triggers for man-db (2.9.4-2) ...

@cg00001
Copy link
Author

cg00001 commented Mar 6, 2021

If anyone has any suggestions, feel free to comment.

I am now gonna make a snapshot of my Kodi development VM running Debian testing and install python3 3.9.2-2 from unstable.

If PIL crash is reproducible I will check the stacktrace. If not, you can port 3.9.2-2 from Debian to Arch and see which patch in Debian packaging (or a patch in Arch packaging) brings an error.

About the VM

The VM has the following addons installed at the moment:

audioencoder.kodi.builtin.aac v1.0.2 installed
audioencoder.kodi.builtin.wma v1.0.2 installed
game.controller.default v1.0.9 installed
game.controller.snes v1.0.9 installed
inputstream.adaptive v2.6.7 installed
inputstream.ffmpegdirect v1.19.2 installed
inputstream.rtmp v3.4.0 installed
kodi.binary.global.audioengine v1.1.1 installed
kodi.binary.global.filesystem v1.1.6 installed
kodi.binary.global.general v1.0.5 installed
kodi.binary.global.gui v5.15.0 installed
kodi.binary.global.main v1.3.0 installed
kodi.binary.global.network v1.0.4 installed
kodi.binary.global.tools v1.0.4 installed
kodi.binary.instance.audiodecoder v3.0.0 installed
kodi.binary.instance.audioencoder v2.1.0 installed
kodi.binary.instance.game v2.1.0 installed
kodi.binary.instance.imagedecoder v2.1.1 installed
kodi.binary.instance.inputstream v3.0.1 installed
kodi.binary.instance.peripheral v2.0.0 installed
kodi.binary.instance.pvr v7.1.0 installed
kodi.binary.instance.screensaver v2.1.0 installed
kodi.binary.instance.vfs v3.0.0 installed
kodi.binary.instance.videocodec v2.0.2 installed
kodi.binary.instance.visualization v3.0.0 installed
kodi.resource v1.0.0 installed
metadata.album.universal v3.1.4 installed
metadata.artists.universal v4.3.3 installed
metadata.common.allmusic.com v3.2.2 installed
metadata.common.fanart.tv v3.6.3 installed
metadata.common.imdb.com v3.1.6 installed
metadata.common.musicbrainz.org v2.2.4 installed
metadata.common.theaudiodb.com v2.0.3 installed
metadata.common.themoviedb.org v3.2.13 installed
metadata.generic.albums v1.0.14 installed
metadata.generic.artists v1.0.14 installed
metadata.local v1.0.1 installed
metadata.themoviedb.org v5.2.6 installed
metadata.themoviedb.org.python v1.3.1+matrix.1 installed
metadata.tvshows.themoviedb.org v3.5.13 installed
metadata.tvshows.themoviedb.org.python v1.4.0 installed
plugin.video.youtube v6.8.10+matrix.1 installed
pvr.iptvsimple v7.4.2 installed
repository.xbmc.org v3.2.5 installed
resource.images.weathericons.default v1.1.9 installed
resource.language.en_gb v2.0.2 installed
resource.language.uk_ua v9.0.14 installed
resource.timezone v1.0.0 installed
resource.uisounds.kodi v1.0.1 installed
screensaver.xbmc.builtin.black v1.0.34 installed
screensaver.xbmc.builtin.dim v1.0.64 installed
script.module.certifi v2019.11.28+matrix.1 installed
script.module.chardet v3.0.4+matrix.3 installed
script.module.future v0.18.2+matrix.1 installed
script.module.idna v2.8.1+matrix.1 installed
script.module.kodi-six v0.1.3.1 installed
script.module.pil v5.1.0 installed
script.module.pycryptodome v3.4.3 installed
script.module.requests v2.22.0+matrix.1 installed
script.module.six v1.14.0+matrix.2 installed
script.module.urllib3 v1.25.8+matrix.1 installed
script.transmission v1.0.2 installed
service.xbmc.versioncheck v0.5.14+matrix.1 installed
skin.estouchy v3.0.6 installed
skin.estuary v3.0.5 installed
visualization.spectrum v3.4.0 installed
weather.gismeteo v0.5.2+matrix.1 installed
webinterface.default v2.2.33 installed
xbmc.addon v19.0.0 installed
xbmc.core v0.1.0 installed
xbmc.gui v5.15.0 installed
xbmc.json v12.2.1 installed
xbmc.metadata v2.1.0 installed
xbmc.python v3.0.0 installed
xbmc.webinterface v1.0.0 installed

Tests Run:

1. Start Kodi

2. Let the weather pull in

3. Update media library

4. Stop Kodi

Run 1: Update Python3 only - works as expected

root@kodi-test:~# apt install -t unstable python3
Зчитування переліків пакунків... Виконано
Побудова дерева залежностей... Виконано            
Зчитування інформації про стан... Виконано   
The following additional packages will be installed:
  libpython3-stdlib libpython3.9 libpython3.9-minimal libpython3.9-stdlib python3-minimal python3.9 python3.9-minimal
Пропоновані пакунки:
  python3-doc python3-tk python3-venv python3.9-venv python3.9-doc binfmt-support
Пакунки, які будуть ОНОВЛЕНІ:
  libpython3-stdlib libpython3.9 libpython3.9-minimal libpython3.9-stdlib python3 python3-minimal python3.9 python3.9-minimal
оновлено 8, встановлено 0 нових, 0 відмічено для видалення і 69 не оновлено.
Необхідно завантажити 6 694 kB архівів.
Після цієї операції об'єм зайнятого дискового простору зменшиться на 104 kB.
Бажаєте продовжити? [Y/n] y
Отр:1 http://deb.debian.org/debian unstable/main amd64 python3.9 amd64 3.9.2-1 [466 kB]
Отр:2 http://deb.debian.org/debian unstable/main amd64 libpython3.9 amd64 3.9.2-1 [1 691 kB]
Отр:3 http://deb.debian.org/debian unstable/main amd64 python3.9-minimal amd64 3.9.2-1 [1 955 kB]
Отр:4 http://deb.debian.org/debian unstable/main amd64 libpython3.9-minimal amd64 3.9.2-1 [801 kB]
Отр:5 http://deb.debian.org/debian unstable/main amd64 libpython3.9-stdlib amd64 3.9.2-1 [1 684 kB]
Отр:6 http://deb.debian.org/debian unstable/main amd64 python3-minimal amd64 3.9.2-2 [38,2 kB]
Отр:7 http://deb.debian.org/debian unstable/main amd64 python3 amd64 3.9.2-2 [37,8 kB]
Отр:8 http://deb.debian.org/debian unstable/main amd64 libpython3-stdlib amd64 3.9.2-2 [21,3 kB]
Отримано 6 694 kB за 2сB (3 427 kB/s)             
Reading changelogs... Done
(Reading database ... 82037 files and directories currently installed.)
Preparing to unpack .../python3.9_3.9.2-1_amd64.deb ...
Unpacking python3.9 (3.9.2-1) over (3.9.1-4) ...
Preparing to unpack .../libpython3.9_3.9.2-1_amd64.deb ...
Unpacking libpython3.9:amd64 (3.9.2-1) over (3.9.1-4) ...
Preparing to unpack .../python3.9-minimal_3.9.2-1_amd64.deb ...
Unpacking python3.9-minimal (3.9.2-1) over (3.9.1-4) ...
Preparing to unpack .../libpython3.9-minimal_3.9.2-1_amd64.deb ...
Unpacking libpython3.9-minimal:amd64 (3.9.2-1) over (3.9.1-4) ...
Preparing to unpack .../libpython3.9-stdlib_3.9.2-1_amd64.deb ...
Unpacking libpython3.9-stdlib:amd64 (3.9.2-1) over (3.9.1-4) ...
Setting up libpython3.9-minimal:amd64 (3.9.2-1) ...
Setting up python3.9-minimal (3.9.2-1) ...
(Reading database ... 82037 files and directories currently installed.)
Preparing to unpack .../python3-minimal_3.9.2-2_amd64.deb ...
Unpacking python3-minimal (3.9.2-2) over (3.9.1-1) ...
Setting up python3-minimal (3.9.2-2) ...
(Reading database ... 82037 files and directories currently installed.)
Preparing to unpack .../python3_3.9.2-2_amd64.deb ...
running python pre-rtupdate hooks for python3.9...
Unpacking python3 (3.9.2-2) over (3.9.1-1) ...
Preparing to unpack .../libpython3-stdlib_3.9.2-2_amd64.deb ...
Unpacking libpython3-stdlib:amd64 (3.9.2-2) over (3.9.1-1) ...
Setting up libpython3.9-stdlib:amd64 (3.9.2-1) ...
Setting up libpython3-stdlib:amd64 (3.9.2-2) ...
Setting up libpython3.9:amd64 (3.9.2-1) ...
Setting up python3.9 (3.9.2-1) ...
Setting up python3 (3.9.2-2) ...
running python rtupdate hooks for python3.9...
running python post-rtupdate hooks for python3.9...
Processing triggers for mailcap (3.68) ...
Processing triggers for libc-bin (2.31-9) ...
Processing triggers for man-db (2.9.4-2) ...

Run 2: Update Python3-pil on top of updated Python3 - works as expected

ii  python3-pil:amd64                 8.1.1-1                           amd64        Python Imaging Library (Python3)
---

Run 3: Update all Python3 packages - works as expected

root@kodi-test:~#  apt install -t unstable $(dpkg -l | grep " python3-" | awk '{print $2}')
Зчитування переліків пакунків... Виконано
Побудова дерева залежностей... Виконано            
Зчитування інформації про стан... Виконано   
python3-avahi is already the newest version (0.8-5).
python3-chardet is already the newest version (4.0.0-1).
python3-chardet позначений як встановлений вручну.
python3-dbus is already the newest version (1.2.16-5).
python3-ldb is already the newest version (2:2.2.0-3+b1).
python3-ldb позначений як встановлений вручну.
python3-olefile is already the newest version (0.46-3).
python3-olefile позначений як встановлений вручну.
python3-bluez is already the newest version (0.23-3).
python3-bluez позначений як встановлений вручну.
python3-pycryptodome is already the newest version (3.9.7+dfsg1-1+b2).
python3-pycryptodome позначений як встановлений вручну.
python3-pycurl is already the newest version (7.43.0.6-5).
python3-pycurl позначений як встановлений вручну.
python3-gattlib is already the newest version (0~20201113-1+b1).
python3-gattlib позначений як встановлений вручну.
python3-gi is already the newest version (3.38.0-2).
python3-gi позначений як встановлений вручну.
python3-pysimplesoap is already the newest version (1.16.2-3).
python3-pysimplesoap позначений як встановлений вручну.
python3-apt is already the newest version (2.1.7).
python3-apt позначений як встановлений вручну.
python3-certifi is already the newest version (2020.6.20-1).
python3-certifi позначений як встановлений вручну.
python3-debian is already the newest version (0.1.39).
python3-debian позначений як встановлений вручну.
python3-debianbts is already the newest version (3.1.0).
python3-debianbts позначений як встановлений вручну.
python3-httplib2 is already the newest version (0.18.1-3).
python3-httplib2 позначений як встановлений вручну.
python3-idna is already the newest version (2.10-1).
python3-idna позначений як встановлений вручну.
python3-urllib3 is already the newest version (1.26.2-1).
python3-urllib3 позначений як встановлений вручну.
python3-gdbm is already the newest version (3.9.2-1).
python3-gdbm позначений як встановлений вручну.
python3-pyudev is already the newest version (0.22.0-2).
python3-usb is already the newest version (1.0.2-2).
python3-requests is already the newest version (2.25.1+dfsg-2).
python3-requests позначений як встановлений вручну.
python3-six is already the newest version (1.15.0-2).
python3-six позначений як встановлений вручну.
python3-talloc is already the newest version (2.3.1-2+b1).
python3-talloc позначений як встановлений вручну.
python3-pil is already the newest version (8.1.1-1).
python3-pil позначений як встановлений вручну.
python3-minimal is already the newest version (3.9.2-2).
python3-minimal позначений як встановлений вручну.
The following additional packages will be installed:
  debconf debconf-i18n reportbug
Пропоновані пакунки:
  debconf-doc debconf-utils libterm-readline-gnu-perl libgtk3-perl libnet-ldap-perl debconf-kde-helper python3-setuptools default-mta
  | postfix | exim4 | mail-transport-agent debsums dlocate python3-urwid reportbug-gtk xdg-utils emacs-bin-common claws-mail
Пакунки, які будуть ОНОВЛЕНІ:
  debconf debconf-i18n python3-debconf python3-pkg-resources python3-reportbug reportbug
оновлено 6, встановлено 0 нових, 0 відмічено для видалення і 62 не оновлено.
Необхідно завантажити 822 kB архівів.
Після цієї операції об'єм зайнятого дискового простору зросте на 0 B.
Бажаєте продовжити? [Y/n] y
Отр:1 http://deb.debian.org/debian unstable/main amd64 python3-debconf all 1.5.75 [4 016 B]
Отр:2 http://deb.debian.org/debian unstable/main amd64 debconf-i18n all 1.5.75 [206 kB]
Отр:3 http://deb.debian.org/debian unstable/main amd64 debconf all 1.5.75 [145 kB]
Отр:4 http://deb.debian.org/debian unstable/main amd64 reportbug all 7.10.3 [135 kB]
Отр:5 http://deb.debian.org/debian unstable/main amd64 python3-reportbug all 7.10.3 [143 kB]
Отр:6 http://deb.debian.org/debian unstable/main amd64 python3-pkg-resources all 52.0.0-3 [189 kB]
Отримано 822 kB за 1сB (691 kB/s)                 
Reading changelogs... Done
Передналаштування пакунків...
(Reading database ... 82024 files and directories currently installed.)
Preparing to unpack .../python3-debconf_1.5.75_all.deb ...
Unpacking python3-debconf (1.5.75) over (1.5.74) ...
Preparing to unpack .../debconf-i18n_1.5.75_all.deb ...
Unpacking debconf-i18n (1.5.75) over (1.5.74) ...
Preparing to unpack .../debconf_1.5.75_all.deb ...
Unpacking debconf (1.5.75) over (1.5.74) ...
Setting up debconf (1.5.75) ...
(Reading database ... 82024 files and directories currently installed.)
Preparing to unpack .../reportbug_7.10.3_all.deb ...
Unpacking reportbug (7.10.3) over (7.10.2) ...
Preparing to unpack .../python3-reportbug_7.10.3_all.deb ...
Unpacking python3-reportbug (7.10.3) over (7.10.2) ...
Preparing to unpack .../python3-pkg-resources_52.0.0-3_all.deb ...
Unpacking python3-pkg-resources (52.0.0-3) over (52.0.0-1) ...
Setting up python3-pkg-resources (52.0.0-3) ...
Setting up python3-debconf (1.5.75) ...
Setting up debconf-i18n (1.5.75) ...
Setting up python3-reportbug (7.10.3) ...
Setting up reportbug (7.10.3) ...
Processing triggers for man-db (2.9.4-2) ...

Can you add plugin.video.themoviedb.helper from jurialmunkey's Matrix repo to your VM?
Kodi File Manager Source: https://jurialmunkey.github.io/repository.jurialmunkey/
If it works when you open the addon without freezing there is hope.

@fuzzard
Copy link
Contributor

fuzzard commented Mar 6, 2021

The crash was in numpy. You are going to need to install that to have any chance of duplicating it

@cg00001
Copy link
Author

cg00001 commented Mar 6, 2021

Kodi is really only tested against the python version we have in our depends, so I would suggest using that version.

I believe python 3.9 may require other changes. It's unlikely Kodi 19 will fully support anything above 3.8 however we are always open to fixes. No one that I know of is actively working on it though.

Downgrading Arch's python means essentially breaking the system.
I already tried pyenv but it didn't work, if anyone has a working alternative I might try it.
These will have to be uninstalled first to remove current Python version in order to install eg v3.8.5:
~ ❯❯❯ pir python
checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: removing python breaks dependency 'python' required by bind
:: removing python breaks dependency 'python' required by emote
:: removing python breaks dependency 'python' required by flatpak
:: removing python breaks dependency 'python' required by gdb
:: removing python breaks dependency 'python' required by gdb-common
:: removing python breaks dependency 'python' required by gimp-plugin-instagram-effects
:: removing python breaks dependency 'python' required by gis-weather
:: removing python breaks dependency 'python' required by glslang
:: removing python breaks dependency 'python' required by gmock
:: removing python breaks dependency 'python' required by gstreamer
:: removing python breaks dependency 'python' required by inkscape
:: removing python breaks dependency 'python' required by inspektor
:: removing python breaks dependency 'python' required by itstool
:: removing python breaks dependency 'python' required by kodi-common
:: removing python breaks dependency 'python' required by libixion
:: removing python breaks dependency 'python' required by libopenshot
:: removing python breaks dependency 'python>=3.7' required by libreoffice-fresh
:: removing python breaks dependency 'python' required by mallard-ducktype
:: removing python breaks dependency 'python' required by menumaker
:: removing python breaks dependency 'python' required by mercurial
:: removing python breaks dependency 'python' required by node-gyp
:: removing python breaks dependency 'python' required by olivia
:: removing python breaks dependency 'python' required by pahole
:: removing python breaks dependency 'python' required by pyalpm
:: removing python breaks dependency 'python' required by python-appdirs
:: removing python breaks dependency 'python' required by python-attrs
:: removing python breaks dependency 'python' required by python-babel
:: removing python breaks dependency 'python' required by python-beaker
:: removing python breaks dependency 'python' required by python-cairo
:: removing python breaks dependency 'python' required by python-certifi
:: removing python breaks dependency 'python' required by python-click
:: removing python breaks dependency 'python' required by python-colorama
:: removing python breaks dependency 'python' required by python-constantly
:: removing python breaks dependency 'python' required by python-contextlib2
:: removing python breaks dependency 'python' required by python-cssselect
:: removing python breaks dependency 'python' required by python-dbus
:: removing python breaks dependency 'python' required by python-distlib
:: removing python breaks dependency 'python' required by python-distro
:: removing python breaks dependency 'python' required by python-evdev
:: removing python breaks dependency 'python' required by python-gobject
:: removing python breaks dependency 'python' required by python-greenlet
:: removing python breaks dependency 'python' required by python-idna
:: removing python breaks dependency 'python' required by python-itsdangerous
:: removing python breaks dependency 'python' required by python-libevdev
:: removing python breaks dependency 'python' required by python-lxml
:: removing python breaks dependency 'python' required by python-markdown
:: removing python breaks dependency 'python' required by python-markupsafe
:: removing python breaks dependency 'python' required by python-msgpack
:: removing python breaks dependency 'python' required by python-numpy
:: removing python breaks dependency 'python' required by python-opengl
:: removing python breaks dependency 'python' required by python-ordered-set
:: removing python breaks dependency 'python' required by python-pillow
:: removing python breaks dependency 'python' required by python-ply
:: removing python breaks dependency 'python' required by python-progress
:: removing python breaks dependency 'python' required by python-psutil
:: removing python breaks dependency 'python' required by python-pyalsa
:: removing python breaks dependency 'python' required by python-pyasn1
:: removing python breaks dependency 'python' required by python-pycryptodome
:: removing python breaks dependency 'python' required by python-pycryptodomex
:: removing python breaks dependency 'python' required by python-pynacl
:: removing python breaks dependency 'python' required by python-pyopenssl
:: removing python breaks dependency 'python' required by python-pyparsing
:: removing python breaks dependency 'python' required by python-pyqt5-sip
:: removing python breaks dependency 'python' required by python-pysocks
:: removing python breaks dependency 'python' required by python-pystache
:: removing python breaks dependency 'python' required by python-pytz
:: removing python breaks dependency 'python' required by python-pyxdg
:: removing python breaks dependency 'python' required by python-pyzmq
:: removing python breaks dependency 'python' required by python-resolvelib
:: removing python breaks dependency 'python' required by python-setproctitle
:: removing python breaks dependency 'python' required by python-simplejson
:: removing python breaks dependency 'python' required by python-six
:: removing python breaks dependency 'python' required by python-soupsieve
:: removing python breaks dependency 'python' required by python-speaklater
:: removing python breaks dependency 'python' required by python-stem
:: removing python breaks dependency 'python' required by python-toml
:: removing python breaks dependency 'python' required by python-urllib3
:: removing python breaks dependency 'python' required by python-webencodings
:: removing python breaks dependency 'python' required by python-werkzeug
:: removing python breaks dependency 'python' required by python-yaml
:: removing python breaks dependency 'python' required by python-zope-event
:: removing python breaks dependency 'python' required by python-zope-interface
:: removing python breaks dependency 'python3' required by reflector
:: removing python breaks dependency 'python' required by sherlock-git
:: removing python breaks dependency 'python' required by smbclient
:: removing python breaks dependency 'python' required by steam
:: removing python breaks dependency 'python' required by trash-cli
:: removing python breaks dependency 'python' required by unoconv
:: removing python breaks dependency 'python' required by uwsgi-plugin-python
:: removing python breaks dependency 'python' required by vulkan-mesa-layers
:: removing python breaks dependency 'python' required by youtube-dl
:: removing python breaks dependency 'python' required by zim

@basilgello
Copy link
Collaborator

Can you add plugin.video.themoviedb.helper from jurialmunkey's Matrix repo to your VM?
Kodi File Manager Source: https://jurialmunkey.github.io/repository.jurialmunkey/
If it works when you open the addon without freezing there is hope.

I installed and it throws an error on first invocation but works otherwise:
screenshot00000
screenshot00001

The log on first invocation:

kodi.log

@basilgello
Copy link
Collaborator

And the version list:

root@kodi-test:~# dpkg -l | egrep "kodi|python"
ii  kodi                              2:19.0+dfsg1-1                    amd64        Open Source Home Theatre (executable binaries)
ii  kodi-bin                          2:19.0+dfsg1-1                    amd64        Open Source Home Theatre (architecture-dependent files)
ii  kodi-bin-dbgsym                   2:19.0+dfsg1-1                    amd64        debug symbols for kodi-bin
ii  kodi-data                         2:19.0+dfsg1-1                    all          Open Source Home Theatre (arch-independent data package)
ii  kodi-eventclients-common          2:19.0+dfsg1-1                    all          Open Source Home Theatre (Event Client Common package)
ii  kodi-eventclients-kodi-send       2:19.0+dfsg1-1                    all          Open Source Home Theatre (Event Client Kodi-SEND package)
ii  kodi-inputstream-adaptive         2.6.7+ds1-1                       amd64        Adaptive inputstream addon for Kodi
ii  kodi-inputstream-ffmpegdirect     1.19.2+ds1-1                      amd64        FFmpegDirect inputstream addon for Kodi
ii  kodi-inputstream-rtmp             3.4.0+ds1-2                       amd64        Kodi input stream addon for RTMP
ii  kodi-pvr-iptvsimple               7.4.2+ds1-1                       amd64        IPTV Simple Client Kodi PVR Addon
ii  kodi-repository-kodi              2:19.0+dfsg1-1                    all          Open Source Home Theatre (official addons repository feed)
ii  kodi-visualization-spectrum:amd64 3.4.0+ds1-2                       amd64        Spectrum visualizer addon for Kodi
ii  libboost-python1.74.0             1.74.0-8                          amd64        Boost.Python Library
ii  libpython2.7-minimal:amd64        2.7.18-1                          amd64        Minimal subset of the Python language (version 2.7)
ii  libpython2.7-stdlib:amd64         2.7.18-1                          amd64        Interactive high-level object-oriented language (standard library, version 2.7)
ii  libpython3-stdlib:amd64           3.9.2-2                           amd64        interactive high-level object-oriented language (default python3 version)
ii  libpython3.9:amd64                3.9.2-1                           amd64        Shared Python runtime library (version 3.9)
ii  libpython3.9-minimal:amd64        3.9.2-1                           amd64        Minimal subset of the Python language (version 3.9)
ii  libpython3.9-stdlib:amd64         3.9.2-1                           amd64        Interactive high-level object-oriented language (standard library, version 3.9)
ii  python-apt-common                 2.1.7                             all          Python interface to libapt-pkg (locales)
ii  python2.7                         2.7.18-1                          amd64        Interactive high-level object-oriented language (version 2.7)
ii  python2.7-minimal                 2.7.18-1                          amd64        Minimal subset of the Python language (version 2.7)
ii  python3                           3.9.2-2                           amd64        interactive high-level object-oriented language (default python3 version)
ii  python3-apt                       2.1.7                             amd64        Python 3 interface to libapt-pkg
ii  python3-avahi                     0.8-5                             amd64        Python utility package for Avahi
ii  python3-bluez                     0.23-3                            amd64        Python 3 wrappers around BlueZ for rapid bluetooth development
ii  python3-certifi                   2020.6.20-1                       all          root certificates for validating SSL certs and verifying TLS hosts (python3)
ii  python3-chardet                   4.0.0-1                           all          universal character encoding detector for Python3
ii  python3-dbus                      1.2.16-5                          amd64        simple interprocess messaging system (Python 3 interface)
ii  python3-debconf                   1.5.75                            all          interact with debconf from Python 3
ii  python3-debian                    0.1.39                            all          Python 3 modules to work with Debian-related data formats
ii  python3-debianbts                 3.1.0                             all          Python interface to Debian's Bug Tracking System
ii  python3-gattlib                   0~20201113-1+b1                   amd64        Bluetooth LE GATT library for Python 3
ii  python3-gdbm:amd64                3.9.2-1                           amd64        GNU dbm database support for Python 3.x
ii  python3-gi                        3.38.0-2                          amd64        Python 3 bindings for gobject-introspection libraries
ii  python3-httplib2                  0.18.1-3                          all          comprehensive HTTP client library written for Python3
ii  python3-idna                      2.10-1                            all          Python IDNA2008 (RFC 5891) handling (Python 3)
ii  python3-ldb                       2:2.2.0-3+b1                      amd64        Python 3 bindings for LDB
ii  python3-minimal                   3.9.2-2                           amd64        minimal subset of the Python language (default python3 version)
ii  python3-olefile                   0.46-3                            all          Python module to read/write MS OLE2 files
ii  python3-pil:amd64                 8.1.1-1                           amd64        Python Imaging Library (Python3)
ii  python3-pkg-resources             52.0.0-3                          all          Package Discovery and Resource Access using pkg_resources
ii  python3-pycryptodome              3.9.7+dfsg1-1+b2                  amd64        cryptographic Python library (Python 3)
ii  python3-pycurl                    7.43.0.6-5                        amd64        Python bindings to libcurl (Python 3)
ii  python3-pysimplesoap              1.16.2-3                          all          simple and lightweight SOAP Library (Python 3)
ii  python3-pyudev                    0.22.0-2                          all          Python3 bindings for libudev
ii  python3-reportbug                 7.10.3                            all          Python modules for interacting with bug tracking systems
ii  python3-requests                  2.25.1+dfsg-2                     all          elegant and simple HTTP library for Python3, built for human beings
ii  python3-six                       1.15.0-2                          all          Python 2 and 3 compatibility library (Python 3 interface)
ii  python3-talloc:amd64              2.3.1-2+b1                        amd64        hierarchical pool based memory allocator - Python3 bindings
ii  python3-urllib3                   1.26.2-1                          all          HTTP library with thread-safe connection pooling for Python3
ii  python3-usb                       1.0.2-2                           all          USB interface for Python (Python3)
ii  python3.9                         3.9.2-1                           amd64        Interactive high-level object-oriented language (version 3.9)
ii  python3.9-minimal                 3.9.2-1                           amd64        Minimal subset of the Python language (version 3.9)

@basilgello
Copy link
Collaborator

The crash was in numpy. You are going to need to install that to have any chance of duplicating it

But jurialmunkey's addon does not use numpy! Which addon is using numpy, @CgCgCgCgCg ?

@fuzzard
Copy link
Contributor

fuzzard commented Mar 6, 2021

And that's the mystery

@cg00001
Copy link
Author

cg00001 commented Mar 6, 2021

The crash was in numpy. You are going to need to install that to have any chance of duplicating it

But jurialmunkey's addon does not use numpy! Which addon is using numpy, @CgCgCgCgCg ?

On my logs on top, I mentioned this is a blank Kodi 19 with just one addon TMDb Helper.
Jurialmunkey commented on this issue today that he'll try to make a test version of the addon that doesn't use PIL so I can check.

@jurialmunkey
Copy link

The crash was in numpy. You are going to need to install that to have any chance of duplicating it

But jurialmunkey's addon does not use numpy! Which addon is using numpy, @CgCgCgCgCg ?

Yes, but PIL/Pillow does in its ImageFilter module which is used by TMDbH:
https://github.com/python-pillow/Pillow/blob/master/src/PIL/ImageFilter.py#L20

@basilgello
Copy link
Collaborator

The crash was in numpy. You are going to need to install that to have any chance of duplicating it

You were right :) Immediate crash after I installed python3-numpy package.

Yes, but PIL/Pillow does in its ImageFilter module which is used by TMDbH:
https://github.com/python-pillow/Pillow/blob/master/src/PIL/ImageFilter.py#L20

@basilgello
Copy link
Collaborator

Trying to increment the memory which points to non-address:
gdb.log

@basilgello
Copy link
Collaborator

I found that the formatted string smashes the memory:

gdb2.log

@cg00001
Copy link
Author

cg00001 commented Mar 10, 2021

@jurialmunkey fixed his TMDb Helper addon, but the PIL issue remains for other addons and skins and only Kodi devs can fix it for all.
Quote from @jurialmunkey:
"I'm now lazy importing the PIL image modules so they will only be imported if you use one of the image functions in a skin (e.g. blur or colour matching). Obviously will still crash if you turn blur on but at least you should be able to run TMDbH without a crash by keeping blurred disabled."

@fuzzard
Copy link
Contributor

fuzzard commented Mar 10, 2021

As far as im conerned, its not a kodi issue, You are going to have to take it up with PIL and numpy to sort out the crash.

@cg00001
Copy link
Author

cg00001 commented Mar 10, 2021

As far as im conerned, its not a kodi issue, You are going to have to take it up with PIL and numpy to sort out the crash.

I opened an issue on Pillow:
python-pillow/Pillow#5320

@mliudev
Copy link

mliudev commented Mar 14, 2021

Kodi is really only tested against the python version we have in our depends, so I would suggest using that version.
I believe python 3.9 may require other changes. It's unlikely Kodi 19 will fully support anything above 3.8 however we are always open to fixes. No one that I know of is actively working on it though.

Downgrading Arch's python means essentially breaking the system.
I already tried pyenv but it didn't work, if anyone has a working alternative I might try it.

I'm trying to run Kodi on Arch as well and I can't seem to get Kodi to use a virtual environment or pyenv. Any pointers on how Kodi is looking for Python?

@lrusak
Copy link
Contributor

lrusak commented Mar 15, 2021

I'm trying to run Kodi on Arch as well and I can't seem to get Kodi to use a virtual environment or pyenv. Any pointers on how Kodi is looking for Python?

Kodi links in the python library and runs it's own python interpreter. It's not possible to use pyenv outside of kodi.

@fuzzard fuzzard added Resolution: External a real bug, but not in the code in this repo (add link!) Platform: Linux labels Mar 15, 2021
@fuzzard fuzzard closed this as completed Mar 15, 2021
@cg00001
Copy link
Author

cg00001 commented Mar 15, 2021

I tried the Flatpak Kodi Matrix version and the PIL issue doesn't exist -probably because it uses its own platform and libraries.
https://flathub.org/apps/details/tv.kodi.Kodi

@cg00001
Copy link
Author

cg00001 commented Apr 28, 2021

The Arch version of Kodi 19 (and possibly others too) still suffers from crashing due to that issue.
The latest solution I was given I can't implement, since I simply don't know enough to work it out.
Maybe it helps someone:
numpy/numpy#18848 (comment)
" [The only thing I and others can do is wait.]

Not necessarily. Try, for example, temporarily inserting a raise RuntimeError() at the top of numpy/init.py and starting up Kodi. I'm not familiar with Kodi, so you'll have to find out how Kodi logs Python tracebacks from it and its plugins. That traceback should show you which part of Kodi or its plugins is importing numpy (possibly through an intermediate like Pillow). You will have to modify that code to not attempt importing numpy (or the intermediate library).

Since numpy has never worked with sub-interpreters, the (re)introduced bug is in the code that is trying to import numpy, so I'm going to close this."

@cg00001
Copy link
Author

cg00001 commented May 16, 2021

Further investigating using the way above revealed that script.module.websocket imports numpy and it's the root of the problem -so far.

`
File "/home/k/.kodi/addons/script.module.websocket/lib/websocket/init.py", line 21, in
from ._abnf import *

                                             File "/home/k/.kodi/addons/script.module.websocket/lib/websocket/_abnf.py", line 37, in <module>
                                               import numpy  

                                             File "/usr/lib/python3.9/site-packages/numpy/__init__.py", line 110, in <module>
                                               raise RuntimeError()  

                                           RuntimeError  

                                           -->End of Python script error report<--`

@cg00001
Copy link
Author

cg00001 commented May 17, 2021

I decided to edit directly line 37 of /home/k/.kodi/addons/script.module.websocket/lib/websocket/_abnf.py and replace "import numpy" with:
numpy = None

After initial testing this seems to solve crashes on Arch Linux and Kodi 19.1 seems to work fine.

ksnip_20210517-105149

@basilgello
Copy link
Collaborator

basilgello commented May 18, 2021 via email

@pkscout
Copy link
Member

pkscout commented May 18, 2021

I'll see if I can find some time today. I had no idea web sockets imported numpy, and I need to see what might be affected if we just don't import it.

@pkscout
Copy link
Member

pkscout commented May 18, 2021

OK, I looked through the code, and it appears that with Python3 numpy is used as a more efficient way of doing some data masking (for what, I don't know), but the fallback Python2 routine works in Python3 as well (at least in my limited testing). For the scripts I have that use websocket, I can't tell any performance difference. So I will try and do a PR today or tomorrow with an updated module for the official repo.

@cg00001
Copy link
Author

cg00001 commented May 18, 2021

OK, I looked through the code, and it appears that with Python3 numpy is used as a more efficient way of doing some data masking (for what, I don't know), but the fallback Python2 routine works in Python3 as well (at least in my limited testing). For the scripts I have that use websocket, I can't tell any performance difference. So I will try and do a PR today or tomorrow with an updated module for the official repo.

numpy/numpy#18848 (comment)

@pkscout
Copy link
Member

pkscout commented May 20, 2021

script.module.websocket update submitted for review at xbmc/repo-scripts#2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Linux Resolution: External a real bug, but not in the code in this repo (add link!)
Projects
None yet
Development

No branches or pull requests