From owner-freebsd-questions Thu Oct 17 19: 9:48 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 242EE37B404 for ; Thu, 17 Oct 2002 19:09:47 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id C7E4143E77 for ; Thu, 17 Oct 2002 19:09:45 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.6/8.12.5) id g9I29jxo056990; Thu, 17 Oct 2002 21:09:45 -0500 (CDT) (envelope-from dan) Date: Thu, 17 Oct 2002 21:09:45 -0500 From: Dan Nelson To: Scott Pilz Cc: freebsd-questions@FreeBSD.ORG Subject: Re: malloc Message-ID: <20021018020945.GA91928@dan.emsphone.com> References: <20021017203931.E96249-100000@mail.tznet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021017203931.E96249-100000@mail.tznet.com> X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In the last episode (Oct 17), Scott Pilz said: > This is almost depressing... > > What would cause: > > in free(): warning: junk pointer, too high to make sense > > (more so, is there a way to "fix" this, not what would cause this) > > from happening on a rare program that works well on other operating > systems, just not BSD (yes it is using malloc)? That means the program is trying to free a pointer higher in memory than the highest pointer malloc() has ever allocated. It's a good sign that the program is doing something it shouldn't. > I'd really hate to have to switch one of my machines to Redhat to make > certain applications run. It is only a warning, and will not cause the program to crash. You might be able to mask the message by setting the MALLOC_OPTIONS variable to match the behavior of your other systems (see the malloc manpage for all the flags). Try "Z" (useful if a program mallocs memory and assumes it's zero), or "jz" (useful if the program tries to use memory after it has called free() ). The correct fix, of course, is to set MALLOC_OPTIONS="A", and use the resulting coredump to fix the program :) -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message