Subject: Re: shutdown(8) Heisenbug?
To: Dave Huang <email@example.com>
From: Frederick Bruckman <firstname.lastname@example.org>
Date: 09/30/1999 03:25:23
On Thu, 30 Sep 1999, Dave Huang wrote:
> On Thu, 30 Sep 1999, Frederick Bruckman wrote:
> > That is what I'm saying, that you should never rely on the value of an
> > uninitialized variable. At least, that's what I always thought. I
> > think maybe variables are automatically initialized to zero in C++ and
> > Java, but not C.
> Static variables and global variables are automatically initialized to
> 0... automatic variables aren't initialized to anything, and must be
> initialized before you do anything with 'em.
FWIW, on i386-1.4.1, _dofast is in the bss/data segment (I'm confused,
nm says bss, objdump says .data) and is zero'd there by the linker.
fredb@handy-> nm shutdown | grep dofast
0002796c b _dofast
fredb@handy-> objdump --disassemble --full-contents shutdown|grep 27960
27960 00000000 00000000 00000000 00000000 ................
17e3: c6 05 60 79 02 movb $0x0,0x27960