From owner-freebsd-hackers Sat Aug 12 4:40:30 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from kwanon.research.canon.com.au (kwanon.research.canon.com.au [203.12.172.254]) by hub.freebsd.org (Postfix) with ESMTP id EF0B037BCE1 for ; Sat, 12 Aug 2000 04:40:25 -0700 (PDT) (envelope-from iain@research.canon.com.au) Received: from bellmann.research.canon.com.au (bellmann.research.canon.com.au [10.5.0.3]) by kwanon.research.canon.com.au (Postfix) with ESMTP id 7B09F8A890; Sat, 12 Aug 2000 11:43:35 +0000 (UTC) Received: from elph.research.canon.com.au (elph.research.canon.com.au [203.12.174.253]) by bellmann.research.canon.com.au (Postfix) with ESMTP id 2FB638B10; Sat, 12 Aug 2000 21:36:00 +1000 (EST) Received: from elph.research.canon.com.au (elph.research.canon.com.au [10.2.0.253]) by elph.research.canon.com.au (Postfix) with ESMTP id 22FF1208; Sat, 12 Aug 2000 21:40:00 +1000 (EST) Date: Sat, 12 Aug 2000 21:40:00 +1000 (EST) From: Iain Templeton To: andrew@ugh.net.au Cc: freebsd-hackers@freebsd.org Subject: Re: libvgl: free(): warning: junk pointer, too high to make sense. In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, 12 Aug 2000 andrew@ugh.net.au wrote: > Hi, > Hi Andrew :-) > I'm using libvgl but when I call VGLTextSetFontFile(FONT) I get: > > free(): warning: junk pointer, too high to make sense. > > What am I doing wrong? The only other vgl call I have made at this point > is VGLInit. > Well, VGLInit() calls VGLTextSetFontFile((byte *)0) We see in VGLTextSetFontFile() that if (filename==NULL) { VGLTextFont->Width = 8; VGLTextFont->Height = 8; VGLTextFont->BitmapArray = VGLFont; } But I think that when you call VGLTextSetFontFile() later you'll run the code at the beginning of the function if (VGLTextFont) { if (VGLTextFont->BitmapArray) free (VGLTextFont->BitmapArray); <--- This Line free(VGLTextFont); } So what I suspect might be happening is that its the free() of the line marked above thats failing, because it is trying to free something at the address of VGLFont, which is a global array within libvgl.a. Using gdb on the program should make it possible to confirm that or not. As for how to get around it, I would say that this is a bug in libvgl. > Also what sort of file is it after? I guessed one of the fonts in > /usr/share/syscons/fonts/ after uudecoding... > I think it might be. It reads the first 2 characters as width and height, then the rest seems to be raw font data, which is read into memory, not sure of the format other than that though. Iain To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message