0xdeadc0de

Andrey Simonenko simon at comsys.ntu-kpi.kiev.ua
Fri Jun 17 10:20:41 GMT 2005


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.


More information about the freebsd-hackers mailing list