Bug 1115589
| Summary: | help('modules') crashes | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Marcel Kolaja <mkolaja> | ||||
| Component: | python | Assignee: | Python Maintainers <python-maint> | ||||
| Status: | CLOSED NOTABUG | QA Contact: | BaseOS QE - Apps <qe-baseos-apps> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | 7.0 | CC: | bkabrda, bnater, cstratak, dbasant, fkrska, hhorak, mkolaja, mzalewsk, pbhoot, pviktori, python-maint, rpiddapa, srandhaw, torsava | ||||
| Target Milestone: | rc | Keywords: | Reopened | ||||
| Target Release: | 7.4 | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2018-03-21 10:53:22 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: | 1167156, 1451299, 1506164, 1533516 | ||||||
| Bug Blocks: | 1203710, 1298243, 1420851 | ||||||
| Attachments: |
|
||||||
I would very much like to see the upstream solution for this problem, it seems one may come up in bug [1]. Since this is not a critical issue, I'm moving this bug to 7.3. [1] http://bugs.python.org/issue12902 No.
We can help with workarounds in specific cases where this poses a problem, but changing what help('modules') does is not realistic in Python 2.
** We can do this _if_ we have proper DIY way for users to find out which all modules are in conflict and based on it, how to workaround. Current status:
* The original bug is fixed, so the following should work:
# yum group install 'Server with GUI'
# python -c "help('modules')"
* bug 1451299 was filed for pygtk2 regarding interaction between gtk3 and gtk2 libraries, i.e. the fact that the following will still cause a segmentation fault:
python -c 'from gi.repository import Gtk; from gtk import _gtk'
* Importing gtk will fail with a Python traceback when a graphical display is not available. So, the following will fail on a typical server installation:
python -c "import gtk; help('modules')"
This is expected. The error happens in the first statement; `python -c "help('modules')"` will still work.
The "import gtk" statement will also fail when pygtk2 is not installed.
* Other modules (or combinations of modules) can still make help('modules') fail, since pydoc imports all available modules, which executes their code. Unfortunately, we can only address these issues individually, if they are reported.
I've just tested it on RHEL 7.4 and indeed the reproducer no longer works:
# yum group install 'Server with GUI'
# python -c "help('modules')"
I verified that 'orca' is installed as well and still the crash is not reproduced.
Is the current status/workarounds enough for the customer? We still have customers reporting this, request to recheck issue. The modules command is running under python interface, but still we are getting those messages : /usr/lib64/python2.7/site-packages/gobject/constants.py:24: Warning: g_boxed_type_register_static: assertion 'g_type_from_name (name) == 0' failed import gobject._gobject The failure is a result of interaction between several modules.
What other Python modules does this customer have installed? Can you post the output of:
ls /usr/lib64/python2.7/site-packages/
Also, what command is being run? Is it `python -c "help('modules')"`, or something else?
Also, let me re-open this bug. Closed bugs don't show up on trackers, so we're quite likely to miss any further comments on them. Thanks for revisiting this.
I am running just python -c "help('modules')"
interestingly this time coredump as well.
python -c "help('modules')"
Please wait a moment while I gather a list of all available modules...
/usr/lib64/python2.7/site-packages/gobject/constants.py:24: Warning: g_boxed_type_register_static: assertion 'g_type_from_name (name) == 0' failed
import gobject._gobject
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py:40: Warning: specified class size for type 'PyGtkGenericCellRenderer' is smaller than the parent type's 'GtkCellRenderer' class size
from gtk import _gtk
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py:40: Warning: g_type_get_qdata: assertion 'node != NULL' failed
from gtk import _gtk
Segmentation fault (core dumped)
python.x86_64 0:2.7.5-58.el7 python-libs.x86_64 0:2.7.5-58.el7
updated from python-libs-2.7.5-48.el7.x86_64 python-libs-2.7.5-48.el7.x86_64
attaching ls output as ls.out
Created attachment 1342221 [details]
ls
The conflicting modules are `gi` and `gio`. I've filed bug #1506164 on pygobject2. This particular problem is now tracked in bug 1506164. Feel free to re-open if there are other similar issues. Two other issues found: pykde4 and scipy interaction - bug 1533516 pykde4, python-libteam and python-ethtool interaction - bug 1533517 It might actually be pykde4 problem, but I don't want to jump to conclusions. In comment to first issue maintainer of scipy package points out to upstream issue that has not been discussed here: https://bugs.python.org/issue11995 Any update here regarding the comment #28? Reading bug #1533516, it still doesn't seems to me like anything wrong is done in python component, so can we close this bug? Right, we can close this bug -- crashes come from (combinations of) other components. |
Description of problem: help('modules') crashes when some incompatible packages are installed. Version-Release number of selected component (if applicable): python-2.7.5-16.el7.x86_64 How reproducible: always Steps to Reproduce: 1. # yum group install 'Server with GUI' 2. # python -c "help('modules')" Actual results: python crashes Expected results: Available modules are listed. Additional info: This is a known bug. It is tracked in Ubuntu, Debian and upstream at least. The problem is that when help('modules') is called, all packages are imported to get the list of all available modules. This may lead to incompatible modules to be loaded depending on what packages are installed on the system. So, just a plain package installation can break help('modules'). In our reproduction scenario, orca is installed. Having that, gtk3 and gtk2 libraries are loaded when help('modules') is run. One can observe the same behavior by running the following command: [root@rhel7 ~]# python -c 'from gi.repository import Gtk; from gtk import _gtk' ** (-c:32700): WARNING **: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-2FqQZPcFbX: Connection refused /usr/lib64/python2.7/site-packages/gobject/constants.py:24: Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed import gobject._gobject /usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py:40: Warning: specified class size for type `PyGtkGenericCellRenderer' is smaller than the parent type's `GtkCellRenderer' class size from gtk import _gtk /usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py:40: Warning: g_type_get_qdata: assertion `node != NULL' failed from gtk import _gtk Segmentation fault [root@rhel7 ~]# What happens when orca is installed is probably this (one can observe the same behavior again): [root@rhel7 ~]# python -c 'from orca.scripts.apps import Banshee; from gtk import _gtk' ** (-c:32705): WARNING **: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-2FqQZPcFbX: Connection refused /usr/lib64/python2.7/site-packages/gobject/constants.py:24: Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed import gobject._gobject /usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py:40: Warning: specified class size for type `PyGtkGenericCellRenderer' is smaller than the parent type's `GtkCellRenderer' class size from gtk import _gtk /usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py:40: Warning: g_type_get_qdata: assertion `node != NULL' failed from gtk import _gtk Segmentation fault [root@rhel7 ~]# The issue can be worked around by uninstalling orca or calling import gtk before help('modules'): # python -c "import gtk; help('modules')" List of relevant bugs: https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/896836 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=697402 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=703786 http://bugs.python.org/issue13027 http://bugs.python.org/issue12902