From unknown Mon Aug 18 14:24:27 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#5938 <5938@debbugs.gnu.org> To: bug#5938 <5938@debbugs.gnu.org> Subject: Status: Unnecessary fail when XGetVisualInfo returns multiple records Reply-To: bug#5938 <5938@debbugs.gnu.org> Date: Mon, 18 Aug 2025 21:24:27 +0000 retitle 5938 Unnecessary fail when XGetVisualInfo returns multiple records reassign 5938 emacs submitter 5938 Lynn Winebarger severity 5938 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 12 12:00:03 2010 Received: (at submit) by debbugs.gnu.org; 12 Apr 2010 16:00:04 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O1M3O-0007wC-3i for submit@debbugs.gnu.org; Mon, 12 Apr 2010 12:00:03 -0400 Received: from mail-gw0-f44.google.com ([74.125.83.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O1L1u-0007T2-1X for submit@debbugs.gnu.org; Mon, 12 Apr 2010 10:54:26 -0400 Received: by gwb1 with SMTP id 1so1115914gwb.3 for ; Mon, 12 Apr 2010 07:54:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:received:message-id :subject:from:to:content-type; bh=M5qXJNHwS1dSyZxAr3bmTCkaARbgSgmBik0e3W+D85s=; b=XRzCUBcql904jFPCTGfrqJ1w4RPA+CxmeyTQE8qQb3p1GvnXcazak56WZJljLDAc9T dtymEkZ8aTQeOm4ks/G1A6ibhIXrawTmJqdkwtLxD/HBGC4lsSBP8fPZ5p53lFD3vklu XfuAK/W3AOCRKeTXWoHY448+KvxXf0jpoKWn0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=oS5Fj/ETtI+cQUagqGrKvZrtA+JKfPQdMU3Q/TabpV7z2VkXrTKQIgJ0if0OSnkkSC 2/gidqpYaPmfRqkE9CosF8bfom94+h1tyf7BeYHoFa5e2Qg3bSNlxCKmNUbeNj7ZNTgq onjQfIfpFRXF84zwDTHosEHbp+dbf6U+Nng8M= MIME-Version: 1.0 Received: by 10.151.108.21 with HTTP; Mon, 12 Apr 2010 07:54:20 -0700 (PDT) Date: Mon, 12 Apr 2010 10:54:20 -0400 Received: by 10.151.4.1 with SMTP id g1mr3817197ybi.175.1271084060784; Mon, 12 Apr 2010 07:54:20 -0700 (PDT) Message-ID: Subject: Unnecessary fail when XGetVisualInfo returns multiple records From: Lynn Winebarger To: submit@debbugs.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 12 Apr 2010 12:00:00 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.3 (-) Package: emacs Version: 23.1.50; 23.1.1; 22.2.1 When invoking emacs on a remote session using Xephyr, it responds emacs: Can't get proper X visual info In version 22 there is a newline after the message, in version 23 there is no newline. I've traced the problem to the function select_visual in the file xfns.c. If the resource database does not specify a preference, it attempts to use the default visual by getting a screen number and visual id from the supplied dpyinfo structure. For some reason Xephyr returns multiple records corresponding to the same visual id. This shows up in xpdyinfo as well, output at the end of this email. The default id is 0x21, and there are two identical entries for it. Every other visual id has a single record. The offending code is in this block: { int n_visuals; XVisualInfo *vinfo, vinfo_template; dpyinfo->visual = DefaultVisualOfScreen (screen); vinfo_template.visualid = XVisualIDFromVisual (dpyinfo->visual); vinfo_template.screen = XScreenNumberOfScreen (screen); vinfo = XGetVisualInfo (dpy, VisualIDMask | VisualScreenMask, &vinfo_template, &n_visuals); if (n_visuals != 1) /* PROBLEM */ fatal ("Can't get proper X visual info"); dpyinfo->n_planes = vinfo->depth; XFree ((char *) vinfo); } It seems that simply checking for n_visuals>1 would be sufficient. In this particular bug, the 2 XVisualInfo structures returned are actually identical, including pointing to the same Visual structure. output of xdpyinfo: [lynn@heraclitus /usr/local/share/doc/X11-1.4.5]$ xdpyinfo -display :1 name of display: :1.0 version number: 11.0 vendor string: The X.Org Foundation vendor release number: 10601000 X.Org version: 1.6.1 maximum request size: 16777212 bytes motion buffer size: 256 bitmap unit, bit order, padding: 32, LSBFirst, 32 image byte order: LSBFirst number of supported pixmap formats: 7 supported pixmap formats: depth 1, bits_per_pixel 1, scanline_pad 32 depth 4, bits_per_pixel 4, scanline_pad 32 depth 8, bits_per_pixel 8, scanline_pad 32 depth 15, bits_per_pixel 16, scanline_pad 32 depth 16, bits_per_pixel 16, scanline_pad 32 depth 24, bits_per_pixel 32, scanline_pad 32 depth 32, bits_per_pixel 32, scanline_pad 32 keycode range: minimum 8, maximum 255 focus: window 0x2e0ccc3, revert to Parent number of extensions: 23 BIG-REQUESTS Composite DAMAGE DOUBLE-BUFFER DPMS GLX Generic Event Extension MIT-SCREEN-SAVER MIT-SHM RANDR RENDER SGI-GLX SHAPE SYNC X-Resource XC-MISC XFIXES XFree86-DRI XINERAMA XInputExtension XKEYBOARD XTEST XVideo default screen number: 0 number of screens: 1 screen #0: print screen: no dimensions: 1024x768 pixels (347x260 millimeters) resolution: 75x75 dots per inch depths (7): 1, 4, 8, 15, 16, 24, 32 root window id: 0xdf depth of root window: 24 planes number of colormaps: minimum 1, maximum 1 default colormap: 0x20 default number of colormap cells: 256 preallocated pixels: black 0, white 16777215 options: backing-store NO, save-unders NO largest cursor: 1024x768 current input event mask: 0xfa8033 KeyPressMask KeyReleaseMask EnterWindowMask LeaveWindowMask ExposureMask StructureNotifyMask SubstructureNotifyMask SubstructureRedirectMask FocusChangeMask PropertyChangeMask ColormapChangeMask number of visuals: 99 default visual id: 0x21 visual: visual id: 0x21 class: TrueColor depth: 24 planes available colormap entries: 256 per subfield red, green, blue masks: 0xff0000, 0xff00, 0xff significant bits in color specification: 8 bits visual: visual id: 0x21 class: TrueColor depth: 24 planes available colormap entries: 256 per subfield red, green, blue masks: 0xff0000, 0xff00, 0xff significant bits in color specification: 8 bits visual: visual id: 0x22 class: DirectColor depth: 24 planes available colormap entries: 256 per subfield red, green, blue masks: 0xff0000, 0xff00, 0xff significant bits in color specification: 8 bits visual: visual id: 0xd3 class: TrueColor depth: 24 planes available colormap entries: 256 per subfield red, green, blue masks: 0xff0000, 0xff00, 0xff significant bits in color specification: 8 bits visual: visual id: 0xd4 class: TrueColor depth: 24 planes available colormap entries: 256 per subfield red, green, blue masks: 0xff0000, 0xff00, 0xff significant bits in color specification: 8 bits visual: visual id: 0xd5 class: TrueColor depth: 24 planes available colormap entries: 256 per subfield red, green, blue masks: 0xff0000, 0xff00, 0xff significant bits in color specification: 8 bits [...] From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 12 15:01:21 2010 Received: (at 5938-done) by debbugs.gnu.org; 12 Apr 2010 19:01:21 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O1Osr-0001K6-1Y for submit@debbugs.gnu.org; Mon, 12 Apr 2010 15:01:21 -0400 Received: from smtprelay-h11.telenor.se ([62.127.194.4]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O1Osn-0001Jy-Nm for 5938-done@debbugs.gnu.org; Mon, 12 Apr 2010 15:01:18 -0400 Received: from ipb1.telenor.se (ipb1.telenor.se [195.54.127.164]) by smtprelay-h11.telenor.se (Postfix) with ESMTP id 6E57ACB92 for <5938-done@debbugs.gnu.org>; Mon, 12 Apr 2010 21:01:13 +0200 (CEST) X-SENDER-IP: [85.225.45.110] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ar0/AAcLw0tV4S1uPGdsb2JhbACHZpNVDAEBAQE1Lb0dhQwE X-IronPort-AV: E=Sophos;i="4.52,192,1270418400"; d="scan'208";a="62472810" Received: from c-6e2de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.110]) by ipb1.telenor.se with ESMTP; 12 Apr 2010 21:01:11 +0200 Received: from [172.20.199.2] (gaffa [172.20.199.2]) by coolsville.localdomain (Postfix) with ESMTP id 95A777FA01A; Mon, 12 Apr 2010 21:01:10 +0200 (CEST) Message-ID: <4BC36DF6.3020305@swipnet.se> Date: Mon, 12 Apr 2010 21:01:10 +0200 From: =?ISO-8859-1?Q?Jan_Dj=E4rv?= User-Agent: Thunderbird 2.0.0.24 (X11/20100411) MIME-Version: 1.0 To: Lynn Winebarger Subject: Re: bug#5938: Unnecessary fail when XGetVisualInfo returns multiple records References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 5938-done Cc: 5938-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.8 (--) Lynn Winebarger skrev: > Package: emacs > Version: 23.1.50; 23.1.1; 22.2.1 > > When invoking emacs on a remote session using Xephyr, it responds > emacs: Can't get proper X visual info > In version 22 there is a newline after the message, in version 23 > there is no newline. > > I've traced the problem to the function select_visual in the file xfns.c. If > the resource database does not specify a preference, it attempts to use > the default visual by getting a screen number and visual id from the supplied > dpyinfo structure. > > For some reason Xephyr returns multiple records corresponding to the > same visual id. > This shows up in xpdyinfo as well, output at the end of this email. > The default id is 0x21, > and there are two identical entries for it. Every other visual id has > a single record. It sounds like a bug to return two identical visuals, I haven't seen that widh Xephyr. But in any case, Emacs should not abort. On the whole, the whole checking of visual is kind of redundant anyway, DefaultVisualOfScreen shall always exist. Fix checked in. Jan D. From unknown Mon Aug 18 14:24:27 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 11 May 2010 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator