Kodi from Debian (20.5) crashes when running addons due to Python 3.12

Bug #2063358 reported by Jakub Klos
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
kodi (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Basically, when Kodi starts an addon, it will use the new default Python 3.12 lang interpreter which has a new limitation of initialization order. Kodi ignores this requirement when starting an addon and crashes in the python library:

Thread 1 (Thread 0x7cef279403c0 (LWP 162962)):
#0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
#1 __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3 0x00007cef3464526e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4 0x00007cef346288ff in __GI_abort () at ./stdlib/abort.c:79
#5 0x00007cef39718f03 in ??? () at /lib/x86_64-linux-gnu/libpython3.12.so.1.0
#6 0x00007cef398f2f58 in _Py_FatalErrorFunc () at /lib/x86_64-linux-gnu/libpython3.12.so.1.0
#7 0x00007cef398d38ae in PyImport_AppendInittab () at /lib/x86_64-linux-gnu/libpython3.12.so.1.0
#8 0x000059502f31bc94 in CAddonPythonInvoker::CAddonPythonInvoker(ILanguageInvocationHandler*) ()
#9 0x000059502fdc6eea in CScriptInvocationManager::GetLanguageInvoker(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (
#10 0x000059502fdc71ac in CScriptInvocationManager::ExecuteAsync(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::sh
#11 0x000059502fdc7483 in ??? ()
#12 0x000059502fdc9474 in CBuiltins::Execute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#13 0x000059502f87c27b in CApplication::ExecuteXBMCAction(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<CGUIL
#14 0x000059502f87e9c1 in CApplication::OnMessage(CGUIMessage&) ()
#15 0x000059502f7e43f1 in CGUIWindowManager::SendMessage(CGUIMessage&) ()
#16 0x000059502f72c06f in ??? ()
#17 0x000059502f72c286 in CDirectoryProvider::OnClick(std::shared_ptr<CGUIListItem> const&) ()
#18 0x000059502f77ad2a in CGUIBaseContainer::OnClick(int) ()
#19 0x000059502f77b04c in CGUIBaseContainer::OnMouseEvent(CPointGen<float> const&, CMouseEvent const&) ()
#20 0x000059502f769727 in CGUIControl::SendMouseEvent(CPointGen<float> const&, CMouseEvent const&) ()
#21 0x000059502f78a781 in CGUIControlGroupList::SendMouseEvent(CPointGen<float> const&, CMouseEvent const&) ()
#22 0x000059502f787ac5 in CGUIControlGroup::SendMouseEvent(CPointGen<float> const&, CMouseEvent const&) ()
#23 0x000059502f787ac5 in CGUIControlGroup::SendMouseEvent(CPointGen<float> const&, CMouseEvent const&) ()
#24 0x000059502f787ac5 in CGUIControlGroup::SendMouseEvent(CPointGen<float> const&, CMouseEvent const&) ()
#25 0x000059502f787ac5 in CGUIControlGroup::SendMouseEvent(CPointGen<float> const&, CMouseEvent const&) ()
#26 0x000059502f7e984a in CGUIWindow::OnMouseAction(CAction const&) ()
#27 0x000059502f7eed55 in CGUIWindow::OnAction(CAction const&) ()
#28 0x000059502f7e48df in CGUIWindowManager::HandleAction(CAction const&) const ()
#29 0x000059502f7e4a48 in CGUIWindowManager::OnAction(CAction const&) const ()
#30 0x000059502f8793c1 in CApplication::OnAction(CAction const&) ()
#31 0x000059502f73ff93 in CInputManager::ProcessMouse(int) ()
#32 0x000059502f74a8a7 in CInputManager::OnEvent(XBMC_Event&) ()
#33 0x000059502f87aee4 in CApplication::HandlePortEvents() ()
#34 0x000059502f87b260 in CApplication::FrameMove(bool, bool) ()
#35 0x000059502f871e59 in CApplication::Run() ()
#36 0x000059502f194a1a in main ()

I have found the ticket and the fix in the Kodi github:
https://github.com/xbmc/xbmc/issues/24069

No LSB modules are available.
Description: Ubuntu 24.04 LTS
Release: 24.04

kodi-bin:
  Installed: 2:20.5+dfsg-1build2
  Candidate: 2:20.5+dfsg-1build2
  Version table:
 *** 2:20.5+dfsg-1build2 500
        500 http://cz.archive.ubuntu.com/ubuntu noble/universe amd64 Packages
        100 /var/lib/dpkg/status

ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: kodi 2:20.5+dfsg-1build2
ProcVersionSignature: Ubuntu 6.8.0-31.31-generic 6.8.1
Uname: Linux 6.8.0-31-generic x86_64
ApportVersion: 2.28.1-0ubuntu2
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Wed Apr 24 18:59:17 2024
InstallationDate: Installed on 2018-05-05 (2181 days ago)
InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
SourcePackage: kodi
UpgradeStatus: Upgraded to noble on 2024-04-24 (0 days ago)
modified.conffile..etc.init.d.apport: [modified]
mtime.conffile..etc.init.d.apport: 2024-04-19T01:50:32

Revision history for this message
Jakub Klos (9v-ka2ub-3y) wrote :
Revision history for this message
Jakub Klos (9v-ka2ub-3y) wrote :

I have applied the patch from Xbmc master to this particular problem and now addons work properly and no more crash. The patch is legit and should be applied to official Ubuntu 24.04 repo

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "0001-CPythonInvoker-code-cleanup.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in kodi (Ubuntu):
status: New → Confirmed
Revision history for this message
Jeremielapuree (jeremielapuree) wrote :

I met this bug too with ubuntu 24.04 and kodi 20.5.

Revision history for this message
yitzhaq (yitzhaq) wrote :

Please prioritize applying this patch, since it completely breaks Kodi for many users. It makes the package unusable with addons - a key feature - as it crashes upon startup.

More details:

https://github.com/xbmc/xbmc/commit/4bf9de87e700f0de56ef698a8d8d6eb7d4ff9050.patch#/python_3.12_fix.patch
https://github.com/rols1/Kodi-Addon-ARDundZDF/issues/36

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.