Summary: | Cantor crashes with Python 2 backend when importing matplotlib.pyplot | ||
---|---|---|---|
Product: | [Applications] cantor | Reporter: | Savor d'Isavano <anohigisavay> |
Component: | general | Assignee: | Nikita Sirgienko <warquark> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | alexander.semke, alexanderrieder, dvsv, warquark |
Priority: | NOR | Keywords: | drkonqi |
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/cantor/2329f29edc8d83b4823995a184ed454b580f0809 | Version Fixed In: | 19.08 |
Sentry Crash Report: |
Description
Savor d'Isavano
2018-08-08 08:21:01 UTC
The error seems to come from PySide/QtCore.so. I cannot reproduce this problem here on openSuse. Does this import step works for when using python2 directly in the terminal? Also can't reproduce it, works on my Ubuntu 18.04 and python2.7.15rc1 (In reply to Alexander Semke from comment #1) > The error seems to come from PySide/QtCore.so. I cannot reproduce this > problem here on openSuse. Does this import step works for when using python2 > directly in the terminal? Hi, it works: Python 2.7.15 (default, Jun 27 2018, 13:05:28) [GCC 8.1.1 20180531] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib.pyplot as plt >>> plt <module 'matplotlib.pyplot' from '/usr/lib/python2.7/site-packages/matplotlib/pyplot.pyc'> >>> I'm running Arch and I have PySide2-5.11.0 and python-pyside-1.2.4 installed. Also note that the Python 3 session does not crash when running the import statement, but if doing actual plotting the backend server process terminates while Cantor remains running. (I may open a separate issue for this, but IMHO this behavior is saner than crashing) (In reply to Savor d'Isavano from comment #3) > Also note that the Python 3 session does not crash when running the import > statement, but if doing actual plotting the backend server process > terminates while Cantor remains running. (I may open a separate issue for > this, but IMHO this behavior is saner than crashing) This difference is because the python2 interpreter is embedded into the main process of Cantor whereas for python3 there is another external executable embedding the interpreter. When crashing, we crash the main process with python 2 and that another executable only for python3. But the problem will be the same for both cases. We need to understand why PySide is having problems on Arch linux. Did you build Cantor byself? (In reply to Nikita Sirgienko from comment #5) > Did you build Cantor byself? No it's the binary package acquired from the Arch official repo, i.e. extra/cantor. Can you please re-test it again with the recent version of Cantor? We don't crash the main process also for python2 anymore in case the python interpreter crashes (Cantor > 18.12 required). Maybe also the problem with PySide on Arch was solved in-between. (In reply to Alexander Semke from comment #7) > Can you please re-test it again with the recent version of Cantor? We don't > crash the main process also for python2 anymore in case the python > interpreter crashes (Cantor > 18.12 required). Maybe also the problem with > PySide on Arch was solved in-between. Hi. Python 2 sessions do not crash anymore. Python 3 will still complain about 'The name org.kde.Cantor.Python3-17062 was not provided by any .service files'. calling plt.show() has no effect in either way. I'm running Cantor 19.04.0. FYI: I'm running Cantor compiled from the commit on 31 May (19.07.70+git20190531), and it does have this problem. …I have mistyped my previous port, please read it as: I'm running Cantor compiled from the commit on 31 May (19.07.70+git20190531), and it does NOT have this problem. The problem have found: it is conflict between already loaded qt libraries (often from system installation) and qt libraries loading by PyQt5, when matplotlib import PyQt5 on pythons2server. When qt version of system and pyqt5 don't match, crash have been happening. I will fix it in a day, or two. Git commit 2329f29edc8d83b4823995a184ed454b580f0809 by Nikita Sirgienko. Committed on 04/07/2019 at 21:45. Pushed by sirgienko into branch 'master'. [Python] Don't use Qt in pythonserver executable for avoding problems with PyQt5 Related: bug 407362 FIXED-IN: 19.08 M +33 -33 src/backends/python/pythonserver.cpp M +11 -13 src/backends/python/pythonserver.h M +93 -95 src/backends/python/pythonservermain.cpp M +14 -2 src/backends/python/pythonsession.cpp M +1 -1 src/backends/python2/CMakeLists.txt M +1 -1 src/backends/python3/CMakeLists.txt https://commits.kde.org/cantor/2329f29edc8d83b4823995a184ed454b580f0809 (In reply to Nikita Sirgienko from comment #12) > Git commit 2329f29edc8d83b4823995a184ed454b580f0809 by Nikita Sirgienko. > Committed on 04/07/2019 at 21:45. > Pushed by sirgienko into branch 'master'. > > [Python] Don't use Qt in pythonserver executable for avoding problems with > PyQt5 > Related: bug 407362 > FIXED-IN: 19.08 > > M +33 -33 src/backends/python/pythonserver.cpp > M +11 -13 src/backends/python/pythonserver.h > M +93 -95 src/backends/python/pythonservermain.cpp > M +14 -2 src/backends/python/pythonsession.cpp > M +1 -1 src/backends/python2/CMakeLists.txt > M +1 -1 src/backends/python3/CMakeLists.txt > > https://commits.kde.org/cantor/2329f29edc8d83b4823995a184ed454b580f0809 (In reply to Nikita Sirgienko from comment #11) > The problem have found: it is conflict between already loaded qt libraries > (often from system installation) and qt libraries loading by PyQt5, when > matplotlib import PyQt5 on pythons2server. When qt version of system and > pyqt5 don't match, crash have been happening. > I will fix it in a day, or two. Thank you. I love you. |