xbmc / xbmc

Kodi is an award-winning free and open source home theater/media center software and entertainment hub for digital media. With its beautiful interface and powerful skinning engine, it's available for Android, BSD, Linux, macOS, iOS, tvOS and Windows.

Home Page:https://kodi.tv/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Fatal Python error: drop_gil: drop_gil: GIL is not locked" every time kodi exits

pitsi opened this issue · comments

commented

Bug report

Describe the bug

After the upgrade to v21, which I got this weekend, I launched kodi a few times and I noticed that a crashlog was generated every time I exited it. So I launched it from a terminal to see what was going on..,

Expected Behavior

Kodi should exit cleanly.

Actual Behavior

It does not exit clearly and, as you can see below, there is a python related error in the terminal

Possible Fix

No idea.

To Reproduce

  1. On a debian testing/unstable x64 installation, launch kodi 21 and exit it.

Debuglog

The debuglog can be found here:
https://paste.debian.net/hidden/1cdce7db/

Moreover, this is what comes up in the terminal

$ KODI_DATA=~/kodi_test kodi
[W][08552.277773] pw.conf      | [          conf.c: 1031 try_load_conf()] can't load config client.conf: No such file or directory
[E][08552.277939] pw.conf      | [          conf.c: 1060 pw_conf_load_conf_for_context()] can't load config client.conf: No such file or directory
'this->recurse > 0' failed at ../src/pipewire/thread-loop.c:63 do_unlock()
libva info: VA-API version 1.20.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/r600_drv_video.so
libva info: Found init function __vaDriverInit_1_20
libva info: va_openDriver() returns 0
Fatal Python error: drop_gil: drop_gil: GIL is not locked
Python runtime state: initialized
Thread 0x00007f4acd6006c0 (most recent call first):
  File "/usr/lib/python3.11/threading.py", line 1590 in _shutdown
Aborted
Crash report available at /home/user/kodi_crashlog-20240506_090307.log

Screenshots

None

Additional context or screenshots (if appropriate)

As you can see from the log, I have also installed pvr iptvsimple, which brings some inputstream-adaptive-* dependencies. And I used the KODI_DATA variable to create a fresh installation and when kodi ran, I selected no on all questions for enabling the the addons.

Your Environment

Used Operating system:

  • Android

  • iOS

  • tvOS

  • Linux

  • macOS

  • Windows

  • Windows UWP

  • Operating system version/name: Debian testing/unstable x64

  • Kodi version: 21

How did you install this? Because I just checked the Debian Sid repo and it's still on 20.5 (https://ftp.debian.org/debian/dists/sid/main/binary-amd64/Packages.gz):

Package: kodi
Source: kodi (2:20.5+dfsg-2)
Version: 2:20.5+dfsg-2+b1
Installed-Size: 118
Maintainer: Debian Multimedia Maintainers <debian-multimedia@lists.debian.org>
Architecture: amd64
Replaces: xbmc (<< 2:13.2+dfsg1-5~)
Provides: kodi-api-audiodecoder (= 4.0.0), kodi-api-audioencoder (= 3.0.0), kodi-api-audioengine (= 1.1.1), kodi-api-filesystem (= 1.1.8), kodi-api-game (= 3.0.0), kodi-api-general (= 1.0.5), kodi-api-gui (= 5.15.0), kodi-api-imagedecoder (= 3.0.1), kodi-api-inputstream (= 3.2.0), kodi-api-main (= 2.0.2), kodi-api-network (= 1.0.4), kodi-api-peripheral (= 2.0.0), kodi-api-pvr (= 8.2.0), kodi-api-screensaver (= 2.2.0), kodi-api-vfs (= 3.0.1), kodi-api-videocodec (= 2.0.3), kodi-api-visualization (= 4.0.0)
Depends: kodi-bin (>= 2:20.5+dfsg-2), kodi-bin (<< 2:20.5+dfsg-2.1~), kodi-data (>= 2:20.5+dfsg-2)
Recommends: kodi-repository-kodi | kodi-repository, kodi-visualization-spectrum
Breaks: xbmc (<< 2:13.2+dfsg1-5~)
Description: Open Source Home Theatre (executable binaries)
Homepage: https://kodi.tv/
Description-md5: 8cbb7a58aa8f70442021b6474bb4487a
Section: video
Priority: optional
Filename: pool/main/k/kodi/kodi_20.5+dfsg-2+b1_amd64.deb
Size: 30552
MD5sum: 5230b1e40b784037a84f19000a3a9184
SHA256: 27fb4ce3b07060e60780fafa56d7a86630b58ce100cd49721eb8ec011686763d

Also, please provide a full debug log.

commented

I do not wait for the main repo to package it. I use deb-multimedia.org since ever and I have been getting kodi from there since kodi was called xbmc and its version was a single digit number.

Here is a debug log (kodi launched with the --debug parameter) and a crash log from that.
https://paste.debian.net/hidden/f18fd98a/
https://paste.debian.net/hidden/eec91c00/

---edit
Please do not tell me that kodi was built with python 3.12!

---re-edit
Assuming that python's shudown function is to blame, I checked threading.py from both python 3.11 and 3.12.
This bit is where they differ. The rest of the function is identical for both files.
3.12

    if _main_thread._is_stopped and _is_main_interpreter():
        # _shutdown() was already called
        return

3.11

    if _main_thread._is_stopped:
        # _shutdown() was already called
        return