NetBSD Problem Report #31163

From martin@aprisoft.de  Mon Sep  5 14:48:26 2005
Return-Path: <martin@aprisoft.de>
Received: from mail.duskware.de (mail.duskware.de [213.146.108.170])
	by narn.netbsd.org (Postfix) with ESMTP id E0E5863B84F
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  5 Sep 2005 14:48:20 +0000 (UTC)
Message-Id: <200509051448.j85EmHCU015417@nelly.aprisoft.de>
Date: Mon, 5 Sep 2005 16:48:17 +0200 (CEST)
From: Martin Husemann <martin@aprisoft.de>
Reply-To: martin@aprisoft.de
To: gnats-bugs@netbsd.org
Subject: xuvmstat can not display on sparc64/ffb X server
X-Send-Pr-Version: 3.95

>Number:         31163
>Category:       xsrc
>Synopsis:       xuvmstat can not display on sparc64/ffb X server
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    macallan
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 05 14:49:00 +0000 2005
>Closed-Date:    Tue Sep 06 11:06:55 +0000 2005
>Last-Modified:  Tue Sep 13 12:45:01 +0000 2005
>Originator:     Martin Husemann
>Release:        NetBSD 3.99.8
>Organization:
>Environment:
System: NetBSD nelly.aprisoft.de 3.99.8 NetBSD 3.99.8 (NELLY) #1: Sun Sep 4 11:39:46 CEST 2005 martin@nelly.aprisoft.de:/usr/src/sys/arch/sparc64/compile/NELLY sparc64
Architecture: sparc64
Machine: sparc64
>Description:

The tool sysutils/xuvmstat (from pkgsrc) can not open a display on a
X server running on sparc64 with ffb frame buffer:

x Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  1 (X_CreateWindow)
  Serial number of failed request:  7
  Current serial number in output stream:  14

The same binary works when using -display on another machine (with different
server). An i386 binary trying to use the sparc64 display fails the same
way, so it's a server issue.

>How-To-Repeat:
s/a
>Fix:
n/a

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: xsrc-manager->macallan
Responsible-Changed-By: martin@netbsd.org
Responsible-Changed-When: Mon, 05 Sep 2005 14:49:50 +0000
Responsible-Changed-Why:
Michael said he'll look at this.


From: Matthias Scheler <tron@NetBSD.org>
To: Martin Husemann <martin@NetBSD.org>
Cc: NetBSD GNATS <gnats-bugs@netbsd.org>
Subject: Re: xsrc/31163
Date: Mon, 5 Sep 2005 15:53:24 +0100

 On Mon, Sep 05, 2005 at 02:49:51PM +0000, martin@netbsd.org wrote:
 > Synopsis: xuvmstat can not display on sparc64/ffb X server
 > 
 > Responsible-Changed-From-To: xsrc-manager->macallan
 > Responsible-Changed-By: martin@netbsd.org
 > Responsible-Changed-When: Mon, 05 Sep 2005 14:49:50 +0000
 > Responsible-Changed-Why:
 > Michael said he'll look at this.

 Have you considered that this might be an application bug? A lot of
 applications have problems with e.g. different byte orders used
 by visuals provided by the X11 server.

 	Kind regards

 -- 
 Matthias Scheler                                  http://scheler.de/~matthias/

From: Martin Husemann <martin@duskware.de>
To: Matthias Scheler <tron@NetBSD.org>
Cc: Martin Husemann <martin@NetBSD.org>,
	NetBSD GNATS <gnats-bugs@netbsd.org>
Subject: Re: xsrc/31163
Date: Mon, 5 Sep 2005 16:57:07 +0200

 On Mon, Sep 05, 2005 at 03:53:24PM +0100, Matthias Scheler wrote:
 > Have you considered that this might be an application bug? A lot of
 > applications have problems with e.g. different byte orders used
 > by visuals provided by the X11 server.

 Yes, and I'm not sure it isn't.
 But the code untill it fails is very simple and generic - and IMHO it does
 not matter in what category this PR waits untill Michael (who confirmed he
 can reproduce it) has time to look at it.

 Martin

From: Michael Lorenz <macallan@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: xsrc/31163
Date: Mon, 5 Sep 2005 14:58:05 -0400

 --Signature_Mon__5_Sep_2005_14_58_05_-0400_WAbIXuk27gtpLe72
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: quoted-printable

 This is a bug in xuvmstat, it requests a PseudoColor visual but tries to
 inherit colour depth from the parent window which happens to be 24bit.
 Apparently it relies on all available visuals being compatible with the
 parent's colour depth.
 A possible fix would be to inherit either both or none.

 --Signature_Mon__5_Sep_2005_14_58_05_-0400_WAbIXuk27gtpLe72
 Content-Type: application/pgp-signature

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.0 (NetBSD)

 iQEVAwUBQxyVQcpnzkX8Yg2nAQKGFQgAut9Q8E32dQd2HR1F+UfU8zGZqzwUqvXB
 TL5JW/fe3efJN+1gCWXc5jbp+WvOjaU2fbQsVr8BTrUTrhWeWHPZeHz9cVhr2qvM
 ejpE0bT6GGKalKY8dJl5vg5ahHBEa0AxmKkXZmoGn7+V7u6So2Rf7s4gha5+SvtY
 4cZoZXqIKVs0FWtB+0/1PNbEWaDJG5oqqFkATNH75O43f5h72VdkvkDwmltVrAXn
 6CeekvFvfQ8I99HzZNtydrtVwNvo1WEKf4EpVL/IEot9Y0ILLKEbWzsL6Zd0xp+3
 /WOM8xi/zc1GYx1HSLvT8kj8hlBVmPYq9zCt7JK85GKMof7UnZjk/A==
 =LyTE
 -----END PGP SIGNATURE-----

 --Signature_Mon__5_Sep_2005_14_58_05_-0400_WAbIXuk27gtpLe72--

From: Martin Husemann <martin@duskware.de>
To: macallan@NetBSD.org
Cc: NetBSD GNATS <gnats-bugs@netbsd.org>
Subject: Re: xsrc/31163
Date: Tue, 6 Sep 2005 08:45:56 +0200

 Nope, it's not that simple. True, the "depth" argument returned from
 setup_visual() is not passed to open_window() - but after changing that
 (and using the new arg in open_window) it still fails on first color
 allocation. There must be more to it...

 So there are two things:

  (1) the app is easily fixed by making the check for DefaultVisual()->class
      accept TrueColor as well as PseudoColor

  (2) if the server returns a visual array including a PseudoColor 8 bit
      depth visual, it should be usable - it's a server error, otherwise
      (and the failure is internal, isn't it?)

 Martin

 --- libcdcx.h.orig	1997-09-29 05:59:59.000000000 +0200
 +++ libcdcx.h	2005-09-06 08:42:32.000000000 +0200
 @@ -49,7 +49,7 @@ void draw_graph __P((struct xdpy *, Wind
  GC create_gc __P((struct xdpy *, Drawable, u_long, u_long));
  Display *open_display __P((char *, struct xdpy *));
  Window open_window __P((struct xdpy *, Window,  int, int, int, int, 
 -			u_long, u_long, u_long, Visual *));
 +			u_long, u_long, u_long, Visual *, int));
  void set_classhints __P((struct xdpy *, Window, char *, char *));
  void set_sizehints __P((struct xdpy *, Window, int, int, int, int));
  void set_stdhints __P((struct xdpy *, Window, char *, char *, 
 --- libcdcx.c.orig	2001-02-19 15:23:55.000000000 +0100
 +++ libcdcx.c	2005-09-06 08:42:32.000000000 +0200
 @@ -477,11 +477,11 @@ struct xdpy *xdpy;
   */

  Window open_window(xdpy, parent, x, y, w, h, bordercolor, backcolor,
 -		   event_mask, visual)
 +		   event_mask, visual, depth)

  struct xdpy *xdpy;
  Window parent;
 -int x, y, w, h;
 +int x, y, w, h, depth;
  u_long bordercolor, backcolor, event_mask;
  Visual *visual;

 @@ -498,7 +498,7 @@ Visual *visual;

    /* create */
    newwin = XCreateWindow(xdpy->dpy, parent, x, y, w, h, BORDER_WIDTH,
 -			 CopyFromParent, /* depth */
 +			 depth,
  			 InputOutput, /* class */
  			 visual, attrs_mask, &attrs);

 @@ -650,10 +650,11 @@ Visual **visual;
  int *depth;

  {
 -  int nvis;
 +  int nvis, defvis;
    XVisualInfo *visual_array, visual_info_template;

 -  if (DefaultVisual(xdpy->dpy, screen)->class == PseudoColor) {
 +  defvis = DefaultVisual(xdpy->dpy, screen)->class;
 +  if (defvis == PseudoColor || defvis == TrueColor) {
      *visual = DefaultVisual(xdpy->dpy, screen);
      *depth = DefaultDepth(xdpy->dpy, screen);
      return(True);
 --- xuvmstat.c.orig	2003-08-11 02:14:36.000000000 +0200
 +++ xuvmstat.c	2005-09-06 08:42:36.000000000 +0200
 @@ -76,7 +76,7 @@ char **argv;
    w = WIDTH;
    h = 650;
    win = open_window(&xdpy, xdpy.rootwin, x, y, w, h,
 -		    xdpy.black, xdpy.white, ExposureMask, visual);
 +		    xdpy.black, xdpy.white, ExposureMask, visual, depth);

    set_stdhints(&xdpy, win, argv[0], argv[0], x, y, w, h);


From: Michael Lorenz <macallan@netbsd.org>
To: Martin Husemann <martin@duskware.de>
Cc: macallan@NetBSD.org, NetBSD GNATS <gnats-bugs@netbsd.org>
Subject: Re: xsrc/31163
Date: Tue, 6 Sep 2005 06:39:19 -0400

 --Signature_Tue__6_Sep_2005_06_39_19_-0400_7Rr45s3MJNInLO_t
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: quoted-printable

 Hello,

 > Nope, it's not that simple. True, the "depth" argument returned from
 > setup_visual() is not passed to open_window() - but after changing
 > that (and using the new arg in open_window) it still fails on first
 > color allocation. There must be more to it...

 Yes, X also wants a colour map. You can't inherit it because the parent
 as a 24bit window doesn't have one and DefaultColormap() doesn't
 something suitable either as long as the default visual is 24bit.=20

 > So there are two things:
 >=20
 >  (1) the app is easily fixed by making the check for
 >      DefaultVisual()->class accept TrueColor as well as PseudoColor

 It does, but it checks for PseudoColor availability first and since
 that's available on ffb it tries to use it.

 >  (2) if the server returns a visual array including a PseudoColor 8
 >      bit depth visual, it should be usable - it's a server error,
 >      otherwise (and the failure is internal, isn't it?)

 No. The server wants a colour map on window creation if it can't inherit
 one somewhere ( that's ancient code in Xserver/dix/window.c ). In this
 case things should Just Work(tm) when xuvmstat would just pick the
 TrueColor visual or inherit both depth and visual.

 have fun
 Michael

 --Signature_Tue__6_Sep_2005_06_39_19_-0400_7Rr45s3MJNInLO_t
 Content-Type: application/pgp-signature

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.0 (NetBSD)

 iQEVAwUBQx1x3cpnzkX8Yg2nAQJCPggAkwtsm0jf6MebZZjpnh0uckCdZ3NjIKFx
 CZyNvgPxZ4GdtgFVxQhRGDfUdIA9RFn+Eg8EErCOKddm+KR5q8Fop8w8qzPRTjdh
 sV4DAnMa44mhknzyseuRVhi+yf/N3EznkSgMxBkj4stK3EfxZs8ruMuV/GOUHYXm
 COk+aJkntZK54KsO6Yjmh4G6y//H6m+ejKF2TsIh6TDm51w6nzrRnUsMz1tY/cNA
 oxzgf2AIEKIkQ/6rGC87FC0yTV2q2YQiIDB8dF7amMPQ+C/F7DRWKNXyors6lV1j
 qw/iMw66XUF1lqK0RisPTZiLWqehoWZr23tn6nMi0PY62Cs+Anb+MA==
 =9Ql5
 -----END PGP SIGNATURE-----

 --Signature_Tue__6_Sep_2005_06_39_19_-0400_7Rr45s3MJNInLO_t--

From: Michael Lorenz <macallan@netbsd.org>
To: Martin Husemann <martin@duskware.de>
Cc: macallan@NetBSD.org, NetBSD GNATS <gnats-bugs@netbsd.org>
Subject: Re: xsrc/31163
Date: Tue, 6 Sep 2005 07:01:20 -0400

 --Signature_Tue__6_Sep_2005_07_01_20_-0400_P9SFA8gJavYW7B59
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: quoted-printable

 Tested the patch on both ffb and cgsix - works just fine.

 --Signature_Tue__6_Sep_2005_07_01_20_-0400_P9SFA8gJavYW7B59
 Content-Type: application/pgp-signature

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.0 (NetBSD)

 iQEVAwUBQx13AMpnzkX8Yg2nAQJ3wwf/aAzBj+xSvAzNXXKP5IuORPaDQsaWrY7L
 wLQmMxF5wMhAf/Oc1zYRyPOyVqRQQMiN8sZzueavLDCfA4vRfG9Ummaw4gKu+4Ge
 TSvcZcKeGpf8GHrrZ2rsGsfJtcZwfYwKMYQebiOdaAXYcr2phXWIirCyayI2DhMt
 O6wzLE4qjBKv5DwkSroNMv8wJK3MsYyofPbPNoIxCBqWU2ijCiQEQpCPWjmYanax
 HLkdvKvpK+uJVIRIxRXYP30Zf0iBSPtcI19iyeXwoy5M7FihrQ8gfZ6GcYmo3e0z
 AjIPg5Y6pQU31Hod6EG6q3ggMf0qz3H6eatUg+t4YjsV41UlYvWAkw==
 =SiVx
 -----END PGP SIGNATURE-----

 --Signature_Tue__6_Sep_2005_07_01_20_-0400_P9SFA8gJavYW7B59--

State-Changed-From-To: open->closed
State-Changed-By: macallan@netbsd.org
State-Changed-When: Tue, 06 Sep 2005 11:06:55 +0000
State-Changed-Why:
martin's patch fixes the problem


From: Thomas Klausner <wiz@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/31163 CVS commit: pkgsrc/sysutils/xuvmstat
Date: Tue, 13 Sep 2005 12:43:48 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	wiz
 Date:		Tue Sep 13 12:43:48 UTC 2005

 Modified Files:
 	pkgsrc/sysutils/xuvmstat: Makefile distinfo

 Log Message:
 Update to 20050909:
 . patch from havard@: split file/exec statistics
 . patch from martin@ fixing PR xsrc/31163 (problems on ffb device)


 To generate a diff of this commit:
 cvs rdiff -r1.13 -r1.14 pkgsrc/sysutils/xuvmstat/Makefile
 cvs rdiff -r1.5 -r1.6 pkgsrc/sysutils/xuvmstat/distinfo

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Thomas Klausner <wiz@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/31163 CVS commit: pkgsrc/doc
Date: Tue, 13 Sep 2005 12:44:33 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	wiz
 Date:		Tue Sep 13 12:44:33 UTC 2005

 Modified Files:
 	pkgsrc/doc: CHANGES TODO

 Log Message:
 xuvmstat updated to 20050909 (PR 31163).


 To generate a diff of this commit:
 cvs rdiff -r1.11109 -r1.11110 pkgsrc/doc/CHANGES
 cvs rdiff -r1.3884 -r1.3885 pkgsrc/doc/TODO

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.