Bug 2097411

Summary: libreoffice fails to build with Python 3.11: Fatal Python error: init_threadstate: thread state already initialized
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: libreofficeAssignee: Stephan Bergmann <sbergman>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: rawhideCC: caolanm, dtardon, erack, mhroncok, sbergman, thrnciar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-06-16 21:13:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2016048    

Description Tomáš Hrnčiar 2022-06-15 15:59:22 UTC
libreoffice fails to build with Python 3.11.0b3.

Fatal Python error: init_threadstate: thread state already initialized
Python runtime state: initialized
Thread 0x0000ffff81c8b020 (most recent call first):
  <no Python frame>
Fatal exception: Signal 6

I am setting severity to urgent, because without LibreOffice we cannot merge Python 3.11 side tag into rawhide.

https://docs.python.org/3.11/whatsnew/3.11.html

For the build logs, see:
https://koji.fedoraproject.org/koji/taskinfo?taskID=88265842

For all our attempts to build libreoffice with Python 3.11, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/libreoffice/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.11:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/

The mass rebuild currently happens in the f37-python side tag.

Failed builds:
https://koji.fedoraproject.org/koji/taskinfo?taskID=88240580
https://koji.fedoraproject.org/koji/taskinfo?taskID=88265609

Let us know here if you have any questions.

Comment 1 Stephan Bergmann 2022-06-16 09:00:49 UTC
<https://kojipkgs.fedoraproject.org//work/tasks/5842/88265842/build.log>:
[...]
> Fatal Python error: init_threadstate: thread state already initialized
> Python runtime state: initialized
> Thread 0x0000ffff81c8b020 (most recent call first):
>   <no Python frame>
> Fatal exception: Signal 6
> Stack:
> /builddir/build/BUILD/libreoffice-7.3.4.2/instdir/program/libuno_sal.so.3(+0x37c28)[0xffff81be7c28]
> /builddir/build/BUILD/libreoffice-7.3.4.2/instdir/program/libuno_sal.so.3(+0x37e40)[0xffff81be7e40]
> linux-vdso.so.1(__kernel_rt_sigreturn+0x0)[0xffff81ccb7ec]
> /lib64/libc.so.6(+0x82878)[0xffff81742878]
> /lib64/libc.so.6(raise+0x20)[0xffff816fae00]
> /lib64/libc.so.6(abort+0xe8)[0xffff816e72b8]
> /lib64/libpython3.11.so.1.0(+0x104e28)[0xfffee4de4e28]
> /lib64/libpython3.11.so.1.0(+0x105200)[0xfffee4de5200]
> /lib64/libpython3.11.so.1.0(PyThread_get_thread_native_id+0x0)[0xfffee4ed6764]
> /lib64/libpython3.11.so.1.0(PyThreadState_New+0x14)[0xfffee4ed6628]
> /builddir/build/BUILD/libreoffice-7.3.4.2/instdir/program/libpyuno.so(_ZN5pyuno14PyThreadAttachC2EP3_is+0x78)[0xfffee4c8c52c]
> /builddir/build/BUILD/libreoffice-7.3.4.2/instdir/program/libpythonloaderlo.so(pyuno_Loader_get_implementation+0x5c)[0xfffee5243060]
> /builddir/build/BUILD/libreoffice-7.3.4.2/instdir/program/libuno_cppuhelpergcc3.so.3(+0x544b4)[0xffff815544b4]
> /builddir/build/BUILD/libreoffice-7.3.4.2/instdir/program/libuno_cppuhelpergcc3.so.3(+0x546c8)[0xffff815546c8]
> /builddir/build/BUILD/libreoffice-7.3.4.2/instdir/program/libuno_cppuhelpergcc3.so.3(+0x54774)[0xffff81554774]
> /builddir/build/BUILD/libreoffice-7.3.4.2/instdir/program/libuno_cppuhelpergcc3.so.3(+0x55140)[0xffff81555140]
> /builddir/build/BUILD/libreoffice-7.3.4.2/instdir/program/libuno_cppuhelpergcc3.so.3(+0x5bc6c)[0xffff8155bc6c]
> /builddir/build/BUILD/libreoffice-7.3.4.2/instdir/program/libuno_cppuhelpergcc3.so.3(+0x5475c)[0xffff8155475c]
> /builddir/build/BUILD/libreoffice-7.3.4.2/workdir/LinkTarget/CppunitTest/libtest_services.so(+0xa650)[0xffff7ac4a650]
[...]

Taking a look...

Comment 2 Stephan Bergmann 2022-06-16 21:13:45 UTC
<https://src.fedoraproject.org/rpms/libreoffice/c/f66d57793ca599dba7f3733fe77de6cd9f564b8b?branch=rawhide> "Resolves: rhbz#2097411 Fails to build with Python 3.11" should fix this

Comment 3 Miro Hrončok 2022-06-16 21:55:56 UTC
Thank you.