RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1115589 - help('modules') crashes
Summary: help('modules') crashes
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: python
Version: 7.0
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: rc
: 7.4
Assignee: Python Maintainers
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On: 1167156 1451299 1506164 1533516
Blocks: 1203710 1298243 1420851
TreeView+ depends on / blocked
 
Reported: 2014-07-02 16:47 UTC by Marcel Kolaja
Modified: 2021-03-11 14:14 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-21 10:53:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
ls (2.37 KB, text/plain)
2017-10-23 14:58 UTC, Piyush Bhoot
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Debian BTS 697402 0 None None None Never
Debian BTS 703786 0 None None None Never
Launchpad 896836 0 None None None Never
Python 12902 0 None None None Never
Python 13027 0 None None None Never

Description Marcel Kolaja 2014-07-02 16:47:56 UTC
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

Comment 2 Bohuslav "Slavek" Kabrda 2015-04-27 12:17:20 UTC
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

Comment 12 Petr Viktorin (pviktori) 2017-01-17 11:58:20 UTC
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.

Comment 15 Piyush Bhoot 2017-03-07 11:16:34 UTC
** 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.

Comment 16 Petr Viktorin (pviktori) 2017-05-16 13:23:44 UTC
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.

Comment 17 Tomas Orsava 2017-05-29 12:08:54 UTC
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.

Comment 18 Petr Viktorin (pviktori) 2017-08-09 13:19:35 UTC
Is the current status/workarounds enough for the customer?

Comment 21 Piyush Bhoot 2017-10-18 09:27:28 UTC
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

Comment 22 Petr Viktorin (pviktori) 2017-10-23 14:20:32 UTC
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?

Comment 23 Petr Viktorin (pviktori) 2017-10-23 14:22:32 UTC
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.

Comment 24 Piyush Bhoot 2017-10-23 14:57:17 UTC
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

Comment 25 Piyush Bhoot 2017-10-23 14:58:04 UTC
Created attachment 1342221 [details]
ls

Comment 26 Petr Viktorin (pviktori) 2017-10-25 10:07:56 UTC
The conflicting modules are `gi` and `gio`. I've filed bug #1506164 on pygobject2.

Comment 27 Petr Viktorin (pviktori) 2018-01-04 14:49:05 UTC
This particular problem is now tracked in bug 1506164. Feel free to re-open if there are other similar issues.

Comment 28 Mirek Długosz 2018-01-11 15:25:28 UTC
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

Comment 29 Honza Horak 2018-03-20 17:48:16 UTC
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?

Comment 30 Petr Viktorin (pviktori) 2018-03-21 10:53:22 UTC
Right, we can close this bug -- crashes come from (combinations of) other components.


Note You need to log in before you can comment on or make changes to this bug.