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 2225954

Summary: Apparent issue with "XIM: Make Xim handle NEED_SYNC_REPLY flag" patch
Product: Red Hat Enterprise Linux 7 Reporter: Paulo Andrade <pandrade>
Component: libX11Assignee: José Expósito <jexposit>
Status: CLOSED MIGRATED QA Contact: Desktop QE <desktop-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.9CC: ndegraef, peter.hutterer, sbarcomb
Target Milestone: rcKeywords: MigratedToJIRA
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-11 17:01:15 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:

Description Paulo Andrade 2023-07-25 18:18:31 UTC
Patch https://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=738f7b867341c1da87ee667d48815822715c3e75
[XIM: Make Xim handle NEED_SYNC_REPLY flag] should handle the condition user
is experimenting. Checking newer patches on top of libX11 does not show any
extra fixes, so, issue probably will happen on newer RHEL releases as well.

We can provide extra data inspection or access to coredump to debug internal
data structure states:

(gdb) bt
#0  0x00007f6e8befac3d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f6e6e00a022 in poll (__timeout=-1, __nfds=1, __fds=0x7f6e6cd90ff0) at /usr/include/bits/poll2.h:46
#2  _xcb_conn_wait (c=c@entry=0x7f6e841b3240, cond=cond@entry=0x7f6e841b3280, vector=vector@entry=0x0, count=count@entry=0x0) at xcb_conn.c:479
#3  0x00007f6e6e00bc6f in xcb_wait_for_event (c=0x7f6e841b3240) at xcb_in.c:697
#4  0x00007f6e6e889dc8 in _XReadEvents (dpy=dpy@entry=0x7f6e841b1ff0) at xcb_io.c:400
#5  0x00007f6e6e871851 in XIfEvent (dpy=0x7f6e841b1ff0, event=event@entry=0x7f6e6cd91230, predicate=predicate@entry=0x7f6e6e8b96b0 <_CheckCMEvent>, arg=arg@entry=0x7f6e3405c580 "@&\270nn\177") at IfEvent.c:68
#6  0x00007f6e6e8b9e44 in _XimXRead (im=0x7f6e3405c580, recv_buf=0x7f6e6cd91e50 "", buf_len=2048, ret_len=0x7f6e6cd91364) at imTrX.c:476
#7  0x00007f6e6e8baac0 in _XimReadData (im=im@entry=0x7f6e3405c580, len=len@entry=0x7f6e6cd913c6, buf=buf@entry=0x7f6e6cd91e50 "", 
    buf_size=buf_size@entry=2048) at imTransR.c:165
#8  0x00007f6e6e8badb1 in _XimRead (im=im@entry=0x7f6e3405c580, len=len@entry=0x7f6e6cd91462, buf=buf@entry=0x7f6e6cd91e50 "", buf_size=buf_size@entry=2048, predicate=predicate@entry=0x7f6e6e8a8070 <_XimCreateICCheck>, arg=arg@entry=0x0) at imTransR.c:235
#9  0x00007f6e6e8a98fd in _XimProtoCreateIC (xim=0x7f6e3405c580, arg=0x0) at imDefIc.c:1558
#10 0x00007f6e6e89680c in XCreateIC (im=0x7f6e3405c580) at ICWrap.c:250
#11 0x00007f6e6edcf502 in createXIC (env=0x7f6e8427f2d0, w=48234524, pX11IMData=0x7f6e3405ee30) at /usr/src/debug/java-1.8.0-openjdk-1.8.0.262.b10-1.el7.x86_64/openjdk/jdk/src/solaris/native/sun/awt/awt_InputMethod.c:977
#12 Java_sun_awt_X11_XInputMethod_createXICNative (env=0x7f6e8427f2d0, this=0x7f6e6cd928f8, window=48234524) at /usr/src/debug/java-1.8.0-openjdk-1.8.0.262.b10-1.el7.x86_64/openjdk/jdk/src/solaris/native/sun/awt/awt_InputMethod.c:1411
#13 0x00007f6e75018427 in ?? ()

(gdb) f 8
#8  0x00007f6e6e8badb1 in _XimRead (im=im@entry=0x7f6e3405c580, len=len@entry=0x7f6e6cd91462, buf=buf@entry=0x7f6e6cd91e50 "", buf_size=buf_size@entry=2048, 
    predicate=predicate@entry=0x7f6e6e8a8070 <_XimCreateICCheck>, arg=arg@entry=0x0) at imTransR.c:235
235             ret_code = _XimReadData(im, &read_len, buf, buf_size);
(gdb) p im
$1 = (struct _Xim *) 0x7f6e3405c580
(gdb) p/t im.private.proto.flag
$2 = 1

Should match src/xlibi18n/XimintP.h:
...
/*
 * bit mask for the flag of XIMPrivateRec
 */
#define SERVER_CONNECTED        (1L)
#define DYNAMIC_EVENT_FLOW      (1L << 1)
#define USE_AUTHORIZATION_FUNC  (1L << 2)
#ifdef XIM_CONNECTABLE
#define DELAYBINDABLE           (1L << 3)
#define RECONNECTABLE           (1L << 4)
#endif /* XIM_CONNECTABLE */
#define FABRICATED              (1L << 5)
#define NEED_SYNC_REPLY         (1L << 6)
...

  Do not see anything special in frame 5 where, heuristically, there could be
some hang:

(gdb) f 5
#5  0x00007f6e6e871851 in XIfEvent (dpy=0x7f6e841b1ff0, event=event@entry=0x7f6e6cd91230, predicate=predicate@entry=0x7f6e6e8b96b0 <_CheckCMEvent>, 
    arg=arg@entry=0x7f6e3405c580 "@&\270nn\177") at IfEvent.c:68
68                  _XReadEvents(dpy);
(gdb) list XIfEvent
...
53              while (1) {
54                  for (qelt = prev ? prev->next : dpy->head;
55                       qelt;
56                       prev = qelt, qelt = qelt->next) {
57                      if(qelt->qserial_num > qe_serial
58                         && (*predicate)(dpy, &qelt->event, arg)) {
59                          *event = qelt->event;
60                          _XDeq(dpy, prev, qelt);
61                          _XStoreEventCookie(dpy, event);
62                          UnlockDisplay(dpy);
63                          return 0;
64                      }
65                  }
66                  if (prev)
67                      qe_serial = prev->qserial_num;
68                  _XReadEvents(dpy);
69                  if (prev && prev->qserial_num != qe_serial)
70                      /* another thread has snatched this event */
71                      prev = NULL;
72              }
(gdb) ptype prev
type = struct _XSQEvent {
    struct _XSQEvent *next;
    XEvent event;
    unsigned long qserial_num;
} *
(gdb) p prev.event.type
$3 = 6

Should be a:

#define MotionNotify            6

so, to better debug, it could be required to somehow have it easily
reproducible.

The java program is different but the C stack matches
https://bugs.openjdk.org/browse/JDK-6506617?focusedCommentId=12130327&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-12130327

The issue is very difficult to reproduce, it might need up to 200 times
to reproduce the issue.

The issue happens when loging out and login back in gnome. It looks as
if some state was not properly cleared in some point.

It is possible to reproduce with C locale and very clean and small rhel7
installatoin, but should be easier to reproduce with Korean, Chinese or
Japanese input methods.

We have some "brute" force workarounds, but it would be better to have
some idea of what triggers the problem, and how to correct it.

Comment 5 RHEL Program Management 2023-09-11 15:05:26 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 6 RHEL Program Management 2023-09-11 17:01:15 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.