From owner-freebsd-hackers Sat Sep 28 08:53:08 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id IAA10506 for hackers-outgoing; Sat, 28 Sep 1996 08:53:08 -0700 (PDT) Received: from gvr.win.tue.nl (root@gvr.win.tue.nl [131.155.210.19]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id IAA10365; Sat, 28 Sep 1996 08:52:55 -0700 (PDT) Received: by gvr.win.tue.nl (8.6.13/1.53) id RAA05940; Sat, 28 Sep 1996 17:52:49 +0200 From: guido@gvr.win.tue.nl (Guido van Rooij) Message-Id: <199609281552.RAA05940@gvr.win.tue.nl> Subject: Re: stack To: dyson@FreeBSD.org Date: Sat, 28 Sep 1996 17:52:49 +0200 (MET DST) Cc: FreeBSD-hackers@FreeBSD.org In-Reply-To: <199609281550.KAA01258@dyson.iquest.net> from "John S. Dyson" at "Sep 28, 96 10:50:32 am" X-Mailer: ELM [version 2.4ME+ PL17 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk John S. Dyson wrote: > > When I allocate something on the stack, isn't it supposed to be completely > > zero? > > like: > > main(int argc, char **argv) { > > char buf[1000]; > > > > ... > > } > > > > Then buf should be zero, or am I missing something here? > > > The first time that you use a page the kernel will demand zero it. But > if you have used the stack space before, it will be whatever you left in > it. I used exactly this program: main() { char buf[1000]; write(1, buf, 1000); } The resulting file did not conatin only zero's. I think this is weird. This is on a 2.1.5R system -Guido