[net.news.b] news and portability

dclemans@mntgfx.UUCP (07/10/86)

The following discussion is about the "beta" 2.10.3 news release.

During the process of bringing up news under Apollo's Domain/IX system, I've
found a number of places where a structure is declared as a local variable to
some function, and is then used without explicitly initializing all of its
fields.  Those fields are just "assumed" to be zero.

The offender I noticed most recently is the use of "hbuf" within control.c.
When it's generating a new control message in response to another control
message, it has a local "struct hbuf" to build up the header in.  The fields
relevant to the control message are assigned, but no others.  If the unused
fields in the hbuf structure actually aren't zero (since they're character
strings, if the first byte isn't zero), you end up with all sorts of garbage
characters in the generated control message.

My guess is that this hasn't been much of a problem on most architectures, since
they typically create a whole new process body for each process with all memory
zeroed, and news probably doesn't go up and down enough in the stack to dirty
enough memory to cause problems.

However, that is NOT true on Domain/IX, which likes to run multiple processes
within a single address space.

dgc