Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Aug 2000 21:40:00 +1000 (EST)
From:      Iain Templeton <iain@research.canon.com.au>
To:        andrew@ugh.net.au
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: libvgl: free(): warning: junk pointer, too high to make sense.
Message-ID:  <Pine.SOL.4.10.10008122135290.502-100000@elph.research.canon.com.au>
In-Reply-To: <Pine.BSF.4.21.0008122101560.47329-100000@starbug.ugh.net.au>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.4.10.10008122135290.502-100000>