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

python-numpy update recreates bug that crashes Kodi 19 which was fixed by python pillow on Arch Linux. #18848

Closed
cg00001 opened this issue Apr 25, 2021 · 9 comments

Comments

@cg00001
Copy link

cg00001 commented Apr 25, 2021

When python-pillow updated on 2021-04-23, Kodi worked fine, but one day later python-numpy updated and crashing began again.
python-pillow/Pillow#5323

@charris
Copy link
Member

charris commented Apr 25, 2021

Does anyone know what the bug is?

@cg00001
Copy link
Author

cg00001 commented Apr 25, 2021

Does anyone know what the bug is?

It all started here.
python-pillow/Pillow#5320

@rkern
Copy link
Member

rkern commented Apr 25, 2021

I believe we're already tracking the root cause (lack of sub-interpreter support) in #18586. The updates "fixing" and "unfixing" the Kodi problems are probably just red herrings.

@cg00001 cg00001 changed the title python-numby update recreates bug that crashes Kodi 19 which was fixed by python pillow on Arch Linux. python-numpy update recreates bug that crashes Kodi 19 which was fixed by python pillow on Arch Linux. Apr 25, 2021
@cg00001
Copy link
Author

cg00001 commented Apr 25, 2021

I believe we're already tracking the root cause (lack of sub-interpreter support) in #18586. The updates "fixing" and "unfixing" the Kodi problems are probably just red herrings.

I'm in no position to help, can follow what others have talked about, but no real python knowledge at all.
I know that I daily use Kodi 19 via Flatpak because Arch package crashes a lot.
The exception was the day after I updated python-pillow, and the next day python-numpy updated and crashes started again.
If it helps here's where the Flatpak working version is:
https://flathub.org/apps/details/tv.kodi.Kodi

And the only thing I could get is what is installed by that -I don't know if it uses another pillow or numpy version or just disables them:
ksnip_20210425-111847

@rkern
Copy link
Member

rkern commented Apr 25, 2021

I'm sorry you are getting bounced around from repo to repo, but there's no bug in numpy that we re-introduced recently. numpy has never supported being run in Python sub-interpreters. Probably what changed is something in one of the Kodi plugins, like TMDbHelper, causing an import of numpy (probably through Pillow). If Kodi has moved to using sub-interpreters, all of the plugins will have to studiously avoid importing numpy entirely.

@cg00001
Copy link
Author

cg00001 commented Apr 25, 2021

I'm sorry you are getting bounced around from repo to repo, but there's no bug in numpy that we re-introduced recently. numpy has never supported being run in Python sub-interpreters. Probably what changed is something in one of the Kodi plugins, like TMDbHelper, causing an import of numpy (probably through Pillow). If Kodi has moved to using sub-interpreters, all of the plugins will have to studiously avoid importing numpy entirely.

TMDBH's dev changed his addon, and that worked ever since, and his changes led a reader to suggest the pillow fix which seemed to work for a day until the python-numpy updated.
You are right, if I try Arch's Kodi it crashes on several different occasions, both skin and addons related.
From the start Kodi devs said this ain't their fault and pointed to Linux "faulty" libs -which I know might simply be not true.
The only thing I and others can do is wait.

@rkern
Copy link
Member

rkern commented Apr 26, 2021

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

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.

python-pillow/Pillow#5320 (comment)

@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 solves crashes on Arch Linux and Kodi 19.1 seems to work fine.

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