From owner-freebsd-hackers@FreeBSD.ORG Fri Jun 17 10:20:41 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 787C916A41C for ; Fri, 17 Jun 2005 10:20:41 +0000 (GMT) (envelope-from simon@comsys.ntu-kpi.kiev.ua) Received: from comsys.ntu-kpi.kiev.ua (comsys.ntu-kpi.kiev.ua [195.245.194.142]) by mx1.FreeBSD.org (Postfix) with ESMTP id A54B043D49 for ; Fri, 17 Jun 2005 10:20:39 +0000 (GMT) (envelope-from simon@comsys.ntu-kpi.kiev.ua) Received: from pm514-9.comsys.ntu-kpi.kiev.ua (pm514-9.comsys.ntu-kpi.kiev.ua [10.18.54.109]) (authenticated bits=0) by comsys.ntu-kpi.kiev.ua (8.12.10/8.12.10) with ESMTP id j5HAQfFl007952 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 17 Jun 2005 13:26:41 +0300 (EEST) Received: by pm514-9.comsys.ntu-kpi.kiev.ua (Postfix, from userid 1000) id B4F34E4; Fri, 17 Jun 2005 13:19:20 +0300 (EEST) Date: Fri, 17 Jun 2005 13:19:20 +0300 From: Andrey Simonenko To: Alex Lyashkov Message-ID: <20050617101920.GA465@pm514-9.comsys.ntu-kpi.kiev.ua> References: <1118952949.2948.51.camel@berloga.shadowland> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1118952949.2948.51.camel@berloga.shadowland> User-Agent: Mutt/1.4.2.1i X-Spam-Status: No, score=-4.5 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.1 X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on comsys.ntu-kpi.kiev.ua X-Virus-Scanned: ClamAV 0.82/940/Wed Jun 15 09:58:59 2005 on comsys.ntu-kpi.kiev.ua X-Virus-Status: Clean Cc: freebsd-hackers@freebsd.org Subject: Re: 0xdeadc0de X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2005 10:20:41 -0000 On Thu, Jun 16, 2005 at 11:15:49PM +0300, Alex Lyashkov wrote: > > With kernel from RELENG_5_4 (and RELENG_5) compiled with INVARIANTS > i have - > gw# sysctl -a | grep debug\.kdb\.available | hexdump -C > 00000000 64 65 62 75 67 2e 6b 64 62 2e 61 76 61 69 6c 61 > |debug.kdb.availa| > 00000010 62 6c 65 3a 20 de c0 ad de de c0 ad de de c0 ad |ble: > ...........| > 00000020 de 60 9b 5c c0 de c0 ad de de c0 ad de de c0 ad > |.`.\............| > 00000030 de 60 9b 5c c0 0a |.`.\..| > 00000036 > > how can be found what are cause of trouble? This problem have been already fixed in -HEAD. The source of problem is the subr_kdb.c:kdb_sysctl_available function, which allocates memory for a string, but does not nul terminates it if nothing should be written there. > how can be found who last freed memory? You can see this garbage (old data) as the value of this sysctl variable, just because memory allocated for the value is not zeroed automatically, as pages for an userland process for example.