Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1175662

Summary: [abrt] gnome-abrt: XCloseDisplay(): cannot open and close a display
Product: Red Hat Enterprise Linux 7 Reporter: Jakub Filak <jfilak>
Component: gnome-abrtAssignee: Jakub Filak <jfilak>
Status: CLOSED ERRATA QA Contact: Martin Kyral <mkyral>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.1CC: isenfeld, jberan, mkyral, ofourdan
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: ppc64   
OS: Unspecified   
Whiteboard: abrt_hash:670d554600ddde07d58f7547e786a4b818f13256
Fixed In Version: gnome-abrt-0.3.4-7.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-04 03:05:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: cgroup
none
File: core_backtrace
none
File: dso_list
none
File: environ
none
File: limits
none
File: maps
none
File: open_fds
none
File: proc_pid_status
none
File: var_log_messages
none
File: sosreport.tar.xz
none
Test program in plain C
none
Patch none

Description Jakub Filak 2014-12-18 10:03:36 UTC
Description of problem:
I run a python script testing whether it is possible to open and close display while I was logged via ssh -X into a ppc64 machine. See bug #1020505 for more details.

Version-Release number of selected component:
gnome-abrt-0.3.4-6.el7

Additional info:
reporter:       libreport-2.1.11
backtrace_rating: 4
cmdline:        /usr/bin/python /usr/bin/gnome-abrt
crash_function: XCloseDisplay
executable:     /usr/bin/python2.7
kernel:         3.10.0-210.el7.ppc64
machineid:      systemd=cd2dd5749b584a59ab5f52d6bfd3f560
runlevel:       N 3
type:           CCpp
uid:            0

Truncated backtrace:
Thread no. 1 (10 frames)
 #0 XCloseDisplay at ClDisplay.c:51
 #1 .ffi_call_LINUX64 at ../src/powerpc/linux64.S:116
 #2 ffi_call at ../src/powerpc/ffi.c:985
 #3 _call_function_pointer at /usr/src/debug/Python-2.7.5/Modules/_ctypes/callproc.c:832
 #4 _ctypes_callproc at /usr/src/debug/Python-2.7.5/Modules/_ctypes/callproc.c:1179
 #5 PyCFuncPtr_call at /usr/src/debug/Python-2.7.5/Modules/_ctypes/_ctypes.c:3929
 #6 PyObject_Call at /usr/src/debug/Python-2.7.5/Objects/abstract.c:2529
 #7 do_call at /usr/src/debug/Python-2.7.5/Python/ceval.c:4316
 #8 call_function at /usr/src/debug/Python-2.7.5/Python/ceval.c:4121
 #9 PyEval_EvalFrameEx at /usr/src/debug/Python-2.7.5/Python/ceval.c:2740

Comment 1 Jakub Filak 2014-12-18 10:03:38 UTC
Created attachment 970466 [details]
File: backtrace

Comment 2 Jakub Filak 2014-12-18 10:03:39 UTC
Created attachment 970467 [details]
File: cgroup

Comment 3 Jakub Filak 2014-12-18 10:03:39 UTC
Created attachment 970468 [details]
File: core_backtrace

Comment 4 Jakub Filak 2014-12-18 10:03:40 UTC
Created attachment 970469 [details]
File: dso_list

Comment 5 Jakub Filak 2014-12-18 10:03:41 UTC
Created attachment 970470 [details]
File: environ

Comment 6 Jakub Filak 2014-12-18 10:03:41 UTC
Created attachment 970471 [details]
File: limits

Comment 7 Jakub Filak 2014-12-18 10:03:42 UTC
Created attachment 970472 [details]
File: maps

Comment 8 Jakub Filak 2014-12-18 10:03:43 UTC
Created attachment 970473 [details]
File: open_fds

Comment 9 Jakub Filak 2014-12-18 10:03:44 UTC
Created attachment 970474 [details]
File: proc_pid_status

Comment 10 Jakub Filak 2014-12-18 10:03:44 UTC
Created attachment 970475 [details]
File: var_log_messages

Comment 11 Jakub Filak 2014-12-18 10:03:55 UTC
Created attachment 970476 [details]
File: sosreport.tar.xz

Comment 12 Jakub Filak 2014-12-18 10:06:55 UTC
*** Bug 1175643 has been marked as a duplicate of this bug. ***

Comment 14 Olivier Fourdan 2015-06-18 12:10:13 UTC
While I can reproduce the crash, I am not entirely convinced the problem really lies in libX11/libxcb.

According to the backtrace in comment #0, the segfault occurs in XCloseDisplay() at line 51 of ClDisplay.c which reads:

44    int
45    XCloseDisplay (
46    	register Display *dpy)
47    {
48    	register _XExtension *ext;
49    	register int i;
50    
51 ==>  if (!(dpy->flags & XlibDisplayClosing))
52    	{

We can reasonably think that dpy is pointing to either 0 or a wrong address, thus the segfault when trying to access dpy->flags

That would mean the problem lies in the caller instead, not in the library, or else XOpenDisplay() does not return a valid display address, in which case all X11 programs would fail on PPC (which is not the case, AFAIK).

So it could be a problem with Python and dlopen() of a library on ppc64.

Comment 15 Olivier Fourdan 2015-06-18 12:13:26 UTC
The core file shows dpy is not null, so most likely pointing to a wrong address.

#0  XCloseDisplay (dpy=0x283b1dd0) at ClDisplay.c:51

Comment 16 Olivier Fourdan 2015-06-18 14:45:04 UTC
Created attachment 1040519 [details]
Test program in plain C

I think it's a problem with Python, the exact same program written in plain C (using dlopen on libX11) works just fine.

Comment 17 Jakub Filak 2015-06-18 14:53:32 UTC
We have fixed the crash in gnome-abrt upstream by moving the check from Python code to C wrappers:
https://github.com/abrt/gnome-abrt/commit/5dcf9097cdfa68087569e13f9e8c2eb2eba8250f
because the crash started appearing in Fedora Rawhide (bug #1188002).

If there is no interest in finding out the root cause of this crash, we can re-assign this bug report to gnome-abrt.

Comment 24 Jakub Filak 2016-02-17 09:42:52 UTC
Created attachment 1127897 [details]
Patch

I backported the upstream patch https://github.com/abrt/gnome-abrt/commit/5dcf9097cdfa68087569e13f9e8c2eb2eba8250f

Comment 29 errata-xmlrpc 2016-11-04 03:05:41 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2307.html