You are not logged in.

#1 2024-05-12 18:32:53

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,630
Website

Anyone experiencing kodi segfaults with python 3.12?

Has anyone else noticed kodi ending in segfaults since the python 3.12 update?  For example, the youtube plugin triggers them upon exiting kodi (standalone-service from the AUR), but other plugins are also trigger them.  Link to upstream bug report I created.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2024-05-12 18:37:00

loqs
Member
Registered: 2014-03-06
Posts: 17,863

Re: Anyone experiencing kodi segfaults with python 3.12?

As the coredump is from a system service it lacks debug symbols.  Upstream might benefit from having a back trace with them.
Edit:
Have you looked at https://github.com/python/cpython/issue … 2088613250?

Last edited by loqs (2024-05-12 18:41:03)

Offline

#3 2024-05-13 18:00:23

Wild Penguin
Member
Registered: 2015-03-19
Posts: 342

Re: Anyone experiencing kodi segfaults with python 3.12?

Yes, kodi is crashing always on exit.

Did you try the cpython fix?

Offline

#4 2024-05-13 18:41:06

loqs
Member
Registered: 2014-03-06
Posts: 17,863

Re: Anyone experiencing kodi segfaults with python 3.12?

Wild Penguin wrote:

Yes, kodi is crashing always on exit.

Did you try the cpython fix?

If it helps python 3.12.3 with https://github.com/python/cpython/pull/118618 applied:
https://drive.google.com/file/d/1ZMWTMy … sp=sharing python-3.12.3-1.1-x86_64.pkg.tar.zst

Offline

#5 2024-05-13 19:24:32

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,630
Website

Re: Anyone experiencing kodi segfaults with python 3.12?

Thanks loqs, I build python-3.12.3-1 with that PR and it seems to have fixed the crashing.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#6 2024-05-13 19:32:18

loqs
Member
Registered: 2014-03-06
Posts: 17,863

Re: Anyone experiencing kodi segfaults with python 3.12?

Hopefully it will be merged for upstream 3.12.4.  I do not know if Arch will take it before that as from my understanding it involves an ABI change and I doubt Arch will want to rebuild all the python packages with a C interface for this fix.

Offline

#7 2024-05-16 16:48:27

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,630
Website

Re: Anyone experiencing kodi segfaults with python 3.12?

I think you're right.  For now, I just built it patched for my own use.  Thanks again.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#8 2024-05-18 12:31:02

loqs
Member
Registered: 2014-03-06
Posts: 17,863

Re: Anyone experiencing kodi segfaults with python 3.12?

Offline

#9 2024-05-18 17:54:32

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,630
Website

Re: Anyone experiencing kodi segfaults with python 3.12?

Thanks loqs - I posted there


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#10 2024-07-13 19:00:02

ozooha
Member
Registered: 2009-09-29
Posts: 181

Re: Anyone experiencing kodi segfaults with python 3.12?

@graysky Are you still using the patched version of python 3.12.3-1.1?
I was experiencing this and applying this patch helped.

Offline

#11 2024-07-13 19:47:49

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,630
Website

Re: Anyone experiencing kodi segfaults with python 3.12?

Yes, but I build against 3.12.4-1


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#12 2024-07-14 17:18:08

ozooha
Member
Registered: 2009-09-29
Posts: 181

Re: Anyone experiencing kodi segfaults with python 3.12?

Can you share that package or educate me on how to apply that patch for every python update?
I'm using that python-3.12.3-1.1-x86_64.pkg.tar.zst from the Google Drive link above and set the IgnorPkg into pacman.conf
OZooHA

Offline

#13 2024-07-14 18:51:05

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,630
Website

Re: Anyone experiencing kodi segfaults with python 3.12?

You can build it yourself or I can share mine with you.  Here is the patch you need which has been modified from the PR to remove the section that hits the abi file.  Just clone our python package and apply the following patch to your PKGBUILD:

--- a/PKGBUILD	2024-06-07 04:28:39.000000000 -0400
+++ b/PKGBUILD	2024-07-14 14:49:26.684930488 -0400
@@ -10,7 +10,7 @@ shopt -s extglob
 pkgbase=python
 pkgname=(python python-tests)
 pkgver=3.12.4
-pkgrel=1
+pkgrel=1.1
 _pybasever=${pkgver%.*}
 pkgdesc="The Python programming language"
 arch=('x86_64')
@@ -19,9 +19,12 @@ url="https://www.python.org/"
 depends=('bzip2' 'expat' 'gdbm' 'libffi' 'libnsl' 'libxcrypt' 'openssl' 'zlib' 'tzdata' 'mpdecimal')
 makedepends=('tk' 'sqlite' 'bluez-libs' 'llvm' 'gdb' 'xorg-server-xvfb' 'ttf-font')
 source=("https://www.python.org/ftp/python/${pkgver%rc*}/Python-${pkgver}.tar.xz"{,.asc}
+         # https://patch-diff.githubusercontent.com/raw/python/cpython/pull/118618.patch
+         pythonPR.patch
         EXTERNALLY-MANAGED)
 sha512sums=('750132ee6369196096130a924f4ddb78b9a55804133e5d136a70b9280928822974d1aa559d844486df02e89155fb0d8117871e1ac532abc18174309ca4b08369'
             'SKIP'
+            '2369b8e9fbdab2b43ed6a48b51de5d312daafe2b1c9ba011735633732a05bf56d03a76b09ee1d81b55d3bd6f304bd2deed8c75f15110922c0b24dd3c8bc27bf8'
             '62a6fbfbaeaa3ba7c54e109d9c3b7f67e73bb21986da4c1fcc5d28cca83d71e0fcae28e1fc70ee8ddce7dea8cd0b64e18d1031dae3a2eae5eaa379c53efd53a0')
 validpgpkeys=('0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D'  # Ned Deily (Python release signing key) <nad@python.org>
               'E3FF2839C048B25C084DEBE9B26995E310250568'  # Łukasz Langa (GPG langa.pl) <lukasz@langa.pl>
@@ -38,6 +41,8 @@ prepare() {
   # rather than copies shipped in the tarball
   rm -r Modules/expat
   rm -r Modules/_decimal/libmpdec
+
+  patch -p1 -i ../pythonPR.patch
 }
 
 build() {

Last edited by graysky (2024-07-14 18:52:19)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#14 2024-07-26 01:53:54

ozooha
Member
Registered: 2009-09-29
Posts: 181

Re: Anyone experiencing kodi segfaults with python 3.12?

@graysky
I tried your patch, but it ran tests which took hours before I had to kill the process (twice).
So can you share your final pkg of the python with the patch.

Offline

#15 2024-07-30 13:11:40

Wild Penguin
Member
Registered: 2015-03-19
Posts: 342

Re: Anyone experiencing kodi segfaults with python 3.12?

Tests seem to hang here, too at:

test_in_thread (test.test__xxsubinterpreters.CreateTests.test_in_thread) ...

, indefinitely. There is no CPU usage (I've been waiting for an hour, seems like it is not going to finish).

Of course one could disable tests, I suppose. I'm not sure yet how, I've not built python before (possibly --disable-test-modules would do the trick), but obviously doing that is not recommended and might have huge caveats.

Last edited by Wild Penguin (2024-07-30 13:48:53)

Offline

#16 2024-07-30 19:06:34

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,630
Website

Re: Anyone experiencing kodi segfaults with python 3.12?

ozooha wrote:

@graysky
I tried your patch, but it ran tests which took hours before I had to kill the process (twice).
So can you share your final pkg of the python with the patch.

Sorry, I did not see your reply until now.  I uploaded the package and sig file here.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#17 2024-08-01 00:18:07

ozooha
Member
Registered: 2009-09-29
Posts: 181

Re: Anyone experiencing kodi segfaults with python 3.12?

Thank you.

Offline

#18 2024-08-02 14:14:24

jfk
Member
Registered: 2017-12-11
Posts: 92

Re: Anyone experiencing kodi segfaults with python 3.12?

I built Kodi with the python 3.12.4-1 shared above but it's still freezing on my system. 

@ozooha is it working for you?

Offline

#19 2024-08-11 17:57:10

ozooha
Member
Registered: 2009-09-29
Posts: 181

Re: Anyone experiencing kodi segfaults with python 3.12?

@jfk Sorry I saw this now.
Yes, it works for me - no segfaults when exiting kodi with that patched version of python.
I did not build kodi with it, but instead replaced my python with that patched version from @greysky.

OZooHA

Offline

#20 2024-08-24 14:18:09

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,630
Website

Re: Anyone experiencing kodi segfaults with python 3.12?

*sigh* the issue still exists with python-3.12.5.

I uploaded the patched package for this version and sig file here if anyone wants it.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#21 2024-09-02 01:34:17

ozooha
Member
Registered: 2009-09-29
Posts: 181

Re: Anyone experiencing kodi segfaults with python 3.12?

Thanks again.

Offline

Board footer

Powered by FluxBB