From owner-freebsd-bugs Sat Aug 12 20:10: 5 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 435DF37BDCD for ; Sat, 12 Aug 2000 20:10:00 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id UAA69860; Sat, 12 Aug 2000 20:10:00 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from starbug.ugh.net.au (starbug.ugh.net.au [203.31.238.37]) by hub.freebsd.org (Postfix) with ESMTP id F2A9637BB0B for ; Sat, 12 Aug 2000 20:09:22 -0700 (PDT) (envelope-from andrew@ugh.net.au) Received: by starbug.ugh.net.au (Postfix, from userid 1000) id 8DA9CA84B; Sun, 13 Aug 2000 13:10:26 +1000 (EST) Message-Id: <20000813031026.8DA9CA84B@starbug.ugh.net.au> Date: Sun, 13 Aug 2000 13:10:26 +1000 (EST) From: andrew@ugh.net.au Reply-To: andrew@ugh.net.au To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/20569: libvgl tries to free global array Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 20569 >Category: bin >Synopsis: libvgl tries to free global array >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Aug 12 20:10:00 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Andrew >Release: FreeBSD 4.0-STABLE i386 >Organization: UgH! >Environment: 4.1-STABLE a week or so old >Description: I have a program trying to use libvgl. When VGLInit is called it calls VGLTextSetFontFile((byte *)0). This causes VGLTextFont to point to some allocated memory and VGLTextFont->BitmapArray to point to VGLFont which is a global array defined in text.c. Later, when my program calls VGLTextSetFontFile VGLTextSetFontFile tries to free this array causing "free(): warning: junk pointer, too high to make sense" Also there are a few style(9) things...specifically the use of (type *)0 rather than NULL. >How-To-Repeat: if (VGLInit(VIDEO_MODE) != 0) { err(EX_UNAVAILABLE, "failed to initialise video display"); } if (VGLTextSetFontFile(FONT) != 0) { reset_and_err(EX_UNAVAILABLE, "failed to load font (%s)", FONT); } >Fix: I guess a flag needs to be set to indicate if the builtin font is being used or a user set font. There may be a better way. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message