NetBSD Problem Report #58153

From www@netbsd.org  Mon Apr 15 03:50:55 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 40EBF1A9238
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 15 Apr 2024 03:50:55 +0000 (UTC)
Message-Id: <20240415035053.B995F1A923A@mollari.NetBSD.org>
Date: Mon, 15 Apr 2024 03:50:53 +0000 (UTC)
From: rwhitlock22@gmail.com
Reply-To: rwhitlock22@gmail.com
To: gnats-bugs@NetBSD.org
Subject: Listing grabs with XF86LogGrabInfo
X-Send-Pr-Version: www-1.0

>Number:         58153
>Category:       xsrc
>Synopsis:       Listing grabs with XF86LogGrabInfo
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    xsrc-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 15 03:55:00 +0000 2024
>Originator:     Robert Whitlock
>Release:        10.0
>Organization:
>Environment:
NetBSD 10.0, amd64, GENERIC
>Description:
The Internet suggests performing

xdotool key XF86LogGrabInfo

in order to list grabs that are currently running on the server, however it outputs

(symbol) No such key name 'XF86LogGrabInfo'. Ignoring it.
(symbol) No such key name 'XF86LogGrabInfo'. Ignoring it.

and does not print anything to the log file. I ran it through a debugger and it seems like it's failing because XStringToKeysym is returning NoSymbol when passed "XF86LogGrabInfo", as illustrated by the following code:

0 thinkpad$ cat m.c
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>

int main() {
       Display *dpy = XOpenDisplay(NULL);
       if (dpy == NULL) {
               fprintf(stderr, "XOpenDisplay failed.\n");
               exit (1);
       }

       KeySym ksym = XStringToKeysym("XF86LogGrabInfo");
       printf("Keysym: %lu\n", (unsigned long)ksym);

       XCloseDisplay(dpy);
}
0 thinkpad$ cat Makefile                                                       
a.out: m.c
       cc -I/usr/X11R7/include -L/usr/X11R7/lib m.c -lX11 -Wl,-R/usr/X11R7/lib
0 thinkpad$ make
cc -I/usr/X11R7/include -L/usr/X11R7/lib m.c -lX11 -Wl,-R/usr/X11R7/lib
0 thinkpad$ ./a.out                                                            
Keysym: 0
0 thinkpad$

In a message on netbsd-users@, RVP suggested applying the patch below, which did correct the problem. (see [1])

diff -urN a/xsrc/external/mit/libX11/dist/src/XKeysymDB b/xsrc/external/mit/libX11/dist/src/XKeysymDB
--- a/xsrc/external/mit/libX11/dist/src/XKeysymDB	2010-11-28 07:34:33.000000000 +0000
+++ b/xsrc/external/mit/libX11/dist/src/XKeysymDB	2024-03-25 21:36:39.970222356 +0000
@@ -370,6 +370,9 @@
XF86_ClearGrab		:1008FE21
XF86_Next_VMode		:1008FE22
XF86_Prev_VMode		:1008FE23
+XF86LogWindowTree	:1008FE24
+XF86LogGrabInfo	:1008FE25
+

usldead_acute		:100000A8
usldead_grave		:100000A9

...although the other suggestion that was made did not work, which was

xdotool key Ctrl+Alt+F11

and which just reported "Failed to switch from vt05 to vt11: Invalid argument" in /var/log/Xorg.0.log.

[1] https://mail-index.netbsd.org/netbsd-users/2024/03/25/msg030829.html
>How-To-Repeat:
See above.
>Fix:
Apply the patch.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.