Subject: Bug#695: Fwd: [Bug 1172639] New: [abrt] nxagent: XKeycodeToKeysym(): nxagent killed by SIGSEGV

From: Orion Poplawski <[email-masked]>
Date: Wed, 10 Dec 2014 09:25:18 -0700

Package: nx-libs
Version: 3.5.0.28

Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/usr/lib64/nx/../x2go/bin/x2goagent -extension XFIXES
-nolisten tcp -nolisten t'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  XKeycodeToKeysym (dpy=0x3ece520, kc=0 '\000', col=0) at XKBBind.c:122
122	    if ((kc<xkb->min_key_code)||(kc>xkb->max_key_code))

Thread 1 (Thread 0x7f1ca40e7740 (LWP 1903)):
#0  XKeycodeToKeysym (dpy=0x3ece520, kc=0 '\000', col=0) at XKBBind.c:122
        xkb = 0x0

XKeycodeToKeysym(Display *dpy,
#if NeedWidePrototypes
                 unsigned int kc,
#else
                 KeyCode kc,
#endif
                 int col)
{
    XkbDescRec  *xkb;

    if (_XkbUnavailable(dpy))
        return _XKeycodeToKeysym(dpy, kc, col);

    _XkbCheckPendingRefresh(dpy,dpy->xkb_info);

    xkb = dpy->xkb_info->desc;
    if ((kc<xkb->min_key_code)||(kc>xkb->max_key_code))

Looks like we need a check for xkb being NULL before trying to reference it.

Looks like this is supposed to do that:

#define _XkbUnavailable(d) \
        (((d)->flags&XlibDisplayNoXkb) ||\
         ((!(d)->xkb_info || (!(d)->xkb_info->desc)) && !_XkbLoadDpy(d)))

And _XkbLoadDpy(d) should have initialized dpy->xkb_info->desc, so I'm really
not sure how this could happen.  Unless _XkbCheckPendingRefresh could have set
it back to NULL:

#define _XkbCheckPendingRefresh(d,xi) {\
    if ((xi)->flags&XkbXlibNewKeyboard)\
        _XkbReloadDpy((d));\
    else if ((xi)->flags&XkbMapPending) {\
        if (XkbGetMapChanges((d),(xi)->desc, &(xi)->changes)==Success) {\
            LockDisplay((d));\
            (xi)->changes.changed= 0;\
            UnlockDisplay((d));\
        }\
    }\
}

Also not sure if returning from hibernate is something worth supporting
gracefully.

-------- Forwarded Message --------
Subject: [Bug 1172639] New: [abrt] nxagent: XKeycodeToKeysym(): nxagent killed
by SIGSEGV
Date: Wed, 10 Dec 2014 13:44:59 +0000
From: [email-masked]
To: [email-masked]

https://bugzilla.redhat.com/show_bug.cgi?id=1172639

            Bug ID: 1172639
           Summary: [abrt] nxagent: XKeycodeToKeysym(): nxagent killed by
                    SIGSEGV
           Product: Fedora
           Version: 21
         Component: nx-libs
          Assignee: [email-masked]
          Reporter: [email-masked]
        QA Contact: [email-masked]
                CC: [email-masked]

Description of problem:
using x2go, put laptop into hibernate.  Then woke up.  Tried to reconnect.

Version-Release number of selected component:
nxagent-3.5.0.28-1.fc21

Additional info:
reporter:       libreport-2.3.0
backtrace_rating: 4
cmdline:        /usr/lib64/nx/../x2go/bin/x2goagent -extension XFIXES -nolisten
tcp -nolisten tcp -dpi 115 -D -auth /home/nbecker/.Xauthority -geometry
1680x1015 -name X2GO-nbecker-91-1418065897_stDKDE_dp24 :91
crash_function: XKeycodeToKeysym
executable:     /usr/lib64/nx/bin/nxagent
kernel:         3.17.4-301.fc21.x86_64
runlevel:       N 5
type:           CCpp
uid:            1000

Truncated backtrace:
Thread no. 1 (8 frames)
 #0 XKeycodeToKeysym at XKBBind.c:122
 #1 find_keystroke at Keystroke.c:395
 #2 nxagentCheckSpecialKeystroke at Keystroke.c:420
 #3 nxagentDispatchEvents at Events.c:1178
 #4 nxagentBlockHandler at Handlers.c:488
 #5 BlockHandler at dixutils.c:442
 #6 WaitForSomething at WaitFor.c:257
 #7 Dispatch at X/NXdispatch.c:619

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.