This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c/9699: rdesktop CVS compiles but exits with "ERROR: Less than 8 bpp not currently supported."
- From: adamh at densi dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 14 Feb 2003 00:53:52 -0000
- Subject: c/9699: rdesktop CVS compiles but exits with "ERROR: Less than 8 bpp not currently supported."
- Reply-to: adamh at densi dot com
>Number: 9699
>Category: c
>Synopsis: rdesktop CVS compiles but exits with "ERROR: Less than 8 bpp not currently supported."
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Feb 14 00:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: adamh@densi.com
>Release: gcc-3_3-branch
>Organization:
>Environment:
Linux 2.4.20, gcc-3.3 compiled from CVS today (2-13-03)
glibc-2.3.1, XFree86 Version 3.2.1
Athlon XP 1600+, 256MB RAM
>Description:
So it looks like an rdesktop bug.
So I went in to debug. I added a couple of lines of the source code to print out various warnings, compiled again, and it can connect to the server. I removed the warnings, recompiled, and it exits with the error, "ERROR: Less than 8 bpp not currently supported."
I barely know C, so I apologize for not being able to think up a little example snippet of code. But I hope I've given enough information in the 'how-to-repeat' -- I for one can reproduce this behavior 100% of the time.
I'll bet this is some kind of one-in-a-million thing, but here's the relevant snippet of code (in xwin.c, around line 525).
pfm = XListPixmapFormats(display, &i);
if (pfm != NULL)
{
/* Use maximum bpp for this depth - this is generally
desirable, e.g. 24 bits->32 bits. */
while (i--)
{
if ((pfm[i].depth == depth) && (pfm[i].bits_per_pixel > bpp))
{
bpp = pfm[i].bits_per_pixel;
}
}
XFree(pfm);
}
if (bpp < 8)
{
error("Less than 8 bpp not currently supported.\n");
XCloseDisplay(display);
return False;
}
>How-To-Repeat:
$ export CVSROOT=:pserver:anonymous@cvs.rdesktop.sourceforge.net:/cvsroot/rdesktop
$ cvs co rdesktop
$ cd rdesktop
$ ./configure
$ make
$ su -c 'make install'
$ rdesktop www.example.com
The program will exit with "ERROR: Less than 8 bpp not currently supported."
Apply the following patch (to CVS checkout of 2-13-03):
-------------------------------------------------------
diff -u -3 -p -r1.97 xwin.c
--- xwin.c 10 Feb 2003 13:02:57 -0000 1.97
+++ xwin.c 14 Feb 2003 00:47:03 -0000
@@ -527,8 +527,10 @@ ui_init(void)
{
/* Use maximum bpp for this depth - this is generally
desirable, e.g. 24 bits->32 bits. */
+ warning("Real depth: %d, bpp: %d\n", depth, bpp);
while (i--)
{
+ warning("depth %d, bpp %d\n", pfm[i].depth, pfm[i].bits_per_pixel);
if ((pfm[i].depth == depth) && (pfm[i].bits_per_pixel > bpp))
{
bpp = pfm[i].bits_per_pixel;
-------------------------------------------------------
$ make
$ su -c 'make install'
$ rdesktop www.example.com
This time rdesktop will time out looking up www.example.com, which is what it should do.
>Fix:
I haven't a clue. This is my first bug report and I have a feeling it's a lousy one. I apologize in advance, and I'm aware that it's probably not a compiler bug, but I just can't see what else it could be when adding two harmless lines of code changes the program's behavior.
>Release-Note:
>Audit-Trail:
>Unformatted: