From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13572 invoked by alias); 14 Feb 2003 00:56:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 13552 invoked by uid 71); 14 Feb 2003 00:56:00 -0000 Resent-Date: 14 Feb 2003 00:56:00 -0000 Resent-Message-ID: <20030214005600.13551.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, adamh@densi.com Received: (qmail 4428 invoked by uid 48); 14 Feb 2003 00:53:52 -0000 Message-Id: <20030214005352.4427.qmail@sources.redhat.com> Date: Fri, 14 Feb 2003 00:56:00 -0000 From: adamh@densi.com Reply-To: adamh@densi.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c/9699: rdesktop CVS compiles but exits with "ERROR: Less than 8 bpp not currently supported." X-SW-Source: 2003-02/txt/msg00603.txt.bz2 List-Id: >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: