Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Jun 2005 13:19:20 +0300
From:      Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
To:        Alex Lyashkov <shadow@psoft.net>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: 0xdeadc0de
Message-ID:  <20050617101920.GA465@pm514-9.comsys.ntu-kpi.kiev.ua>
In-Reply-To: <1118952949.2948.51.camel@berloga.shadowland>
References:  <1118952949.2948.51.camel@berloga.shadowland>

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050617101920.GA465>