Bug 46364 - segfault on import in python3
Summary: segfault on import in python3
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: python3-module-CTK (show other bugs)
Version: unstable
Hardware: x86_64 Linux
: P5 major
Assignee: morozovaes@altlinux.org
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-02 05:06 MSK by Ivan Zakharyaschev
Modified: 2023-11-29 15:44 MSK (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Zakharyaschev 2023-06-02 05:06:49 MSK
$ p=python3-module-CTK; hsh --without-stuff --ini ~/hasher2 && hsh-install ~/hasher2/ "$p" tests-for-installed-python3-pkgs && hsh-run ~/hasher2/ --mount=/proc,/dev/pts -- bash -c "rpm -q $p; rpm -q $p --provides; echo 'Non-importable:'; /usr/lib/rpm/check-python3-provs-importable $p"

python3-module-CTK-0.1.0-alt3.git.dc2e1289.x86_64
python3(CTKCommandLineModulesBackendFunctionPointerPythonQt)
python3(CTKCommandLineModulesBackendLocalProcessPythonQt)
python3(CTKCommandLineModulesBackendXMLCheckerPythonQt)
python3(CTKCommandLineModulesCorePythonQt)
python3(CTKCommandLineModulesFrontendQtGuiPythonQt)
python3(CTKCommandLineModulesFrontendQtWebKitPythonQt)
python3(CTKCorePythonQt)
python3(CTKDICOMCorePythonQt)
python3(CTKDICOMWidgetsPythonQt)
python3(CTKImageProcessingITKCorePythonQt)
python3(CTKPluginFrameworkPythonQt)
python3(CTKScriptingPythonWidgetsPythonQt)
python3(CTKVisualizationVTKCorePythonQt)
python3(CTKVisualizationVTKWidgetsPythonQt)
python3(CTKWidgetsPythonQt)
python3(ctk)
python3(ctkSimplePythonShell)
python3(qt)
python3-module-CTK = 0.1.0-alt3.git.dc2e1289:sisyphus+293819.1140.16.3
Non-importable:
CTKCommandLineModulesBackendFunctionPointerPythonQt
CTKCommandLineModulesBackendLocalProcessPythonQt
CTKCommandLineModulesBackendXMLCheckerPythonQt
CTKCommandLineModulesCorePythonQt
CTKCommandLineModulesFrontendQtGuiPythonQt
CTKCommandLineModulesFrontendQtWebKitPythonQt
sh: line 1: 183721 Segmentation fault      python3 -c 'import CTKCorePythonQt' 2> /dev/null
CTKCorePythonQt
sh: line 1: 183723 Segmentation fault      python3 -c 'import CTKDICOMCorePythonQt' 2> /dev/null
CTKDICOMCorePythonQt
sh: line 1: 183725 Segmentation fault      python3 -c 'import CTKDICOMWidgetsPythonQt' 2> /dev/null
CTKDICOMWidgetsPythonQt
CTKImageProcessingITKCorePythonQt
CTKPluginFrameworkPythonQt
sh: line 1: 183731 Segmentation fault      python3 -c 'import CTKScriptingPythonWidgetsPythonQt' 2> /dev/null
CTKScriptingPythonWidgetsPythonQt
sh: line 1: 183733 Segmentation fault      python3 -c 'import CTKVisualizationVTKCorePythonQt' 2> /dev/null
CTKVisualizationVTKCorePythonQt
sh: line 1: 183735 Segmentation fault      python3 -c 'import CTKVisualizationVTKWidgetsPythonQt' 2> /dev/null
CTKVisualizationVTKWidgetsPythonQt
sh: line 1: 183737 Segmentation fault      python3 -c 'import CTKWidgetsPythonQt' 2> /dev/null
CTKWidgetsPythonQt
sh: line 1: 183739 Segmentation fault      python3 -c 'import ctk' 2> /dev/null
ctk
ctkSimplePythonShell
qt
$ 

May be related to https://bugzilla.altlinux.org/show_bug.cgi?id=40278#c39 (or not).
Comment 1 Ivan Zakharyaschev 2023-06-02 05:20:53 MSK
No, it's not related to python3 being statically linked to libpython3 now:

the crash is also present in p9, where python3 was dynamically linked to libpython3.
Comment 2 Anton Farygin 2023-06-02 08:49:14 MSK
Это надо чинить одновременно с обновлением slicer
Comment 3 morozovaes@altlinux.org 2023-06-23 15:51:26 MSK
You're right, it's absolutely unrelated to changes in ALT-linking; this issue originates in CTK upstream: any attempt to import PythonQt modules outside of a Qt application produces a segfault:

https://github.com/commontk/CTK/pull/520

The current solution as of commit https://github.com/commontk/CTK/commit/a203172b634253cc3717346de30305ffe721d91c and further
is to skip such imports by standalone python interpreter. It will be included it the next CTK package release.
Comment 4 Repository Robot 2023-11-29 15:44:32 MSK
CTK-0.1.0-alt5.git.a203172b -> sisyphus:

 Tue Nov 28 2023 Elizaveta Morozova <morozovaes@altlinux> 0.1.0-alt5.git.a203172b
 - Fixed Qt module imports via standalone python (ALT #46364).