From owner-freebsd-amd64@FreeBSD.ORG Sun May 15 09:55:21 2005 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DA38E16A4CE for ; Sun, 15 May 2005 09:55:21 +0000 (GMT) Received: from web61113.mail.yahoo.com (web61113.mail.yahoo.com [209.73.179.42]) by mx1.FreeBSD.org (Postfix) with SMTP id 50C7E43D5A for ; Sun, 15 May 2005 09:55:21 +0000 (GMT) (envelope-from archwndas@yahoo.com) Received: (qmail 68577 invoked by uid 60001); 15 May 2005 09:55:20 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=DUCUp2AZO7kuBOqNbMY2dEmeAcrxfaR7RCX4RFaK+UyiRZ+mfcjriCmyVHp+s+/N/GV8OmEfansFg5cJEFsqC4SqGJFMiVZn3zOe6J9nffVBrmft1/QzlXG4n+th5+OZ9+/iiNLydswYeFR3iPkuPWB/MsH59JeG39lLWG+bw6I= ; Message-ID: <20050515095520.68575.qmail@web61113.mail.yahoo.com> Received: from [62.169.237.28] by web61113.mail.yahoo.com via HTTP; Sun, 15 May 2005 02:55:20 PDT Date: Sun, 15 May 2005 02:55:20 -0700 (PDT) From: Simeon Nifos To: freebsd-amd64@freebsd.org In-Reply-To: <20050513120029.E720816A4DB@hub.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: memory allocation / initialization of allocated memory X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2005 09:55:22 -0000 Dear list, I just encountered something which may cause problems to debugging memory allocation. You see I had a C code with a lot of memory allocation/deallocation instructions and indirect addressing. Unfortunately I had 3 bugs there. Running under Linux the compiler reported *** glibc detected *** free(): invalid pointer: 0x08056aa8 *** This was not however the case with FreeBSD 4.11, 5.4 which didn't have a problem. Testing a simple program which allocates doubles and/or ints I realized that FreeBSD automatically initializes to zero the memory which is allocated by malloc. This is default behaviour I guess and I hope that it can be changed. Otherwise we have problems tracking memory allocation errors in buggy code. Could somebody let me know how to change this default behaviour? Thanks in advance! Symeon! Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html