Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.soft-sys.andrew Subject: "doload_preset" doesn't zero out BSS it allocates? Message-ID: <2662@auspex.auspex.com> Date: 23 Nov 89 01:35:58 GMT Reply-To: guy@auspex.auspex.com (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 30 "doload_preset" in all the versions of "doload.c" in the R4 beta version of Andrew (except the Apollo one, which doesn't have to bother with all that stuff since the Apollo OS already has a dynamic loading mechanism) handles commons in a ".do" file by "malloc"ing up some space. However, it doesn't zero out that space, which means it doesn't have the UNIX semantics of commons. I suspect this may ultimately be the cause of the hang in "help", reported a while ago and fixed by a workaround involving moving some YP and RPC stuff into "libcx.a". The problem appeared ultimately to have been caused by some BSS location not being zero, so this points in the direction of this bug; moving the YP/RPC stuff into "runapp" left it up to "ld", not "doload", to zero its commons out, which it does. It may also be the cause of some problems I saw with "console", which also appeared to have been caused by some BSS location not being zero and which were fixed by explicitly initializing some items in "console/lib/initglbs.h" to zero, so that they're no longer commons. It appears that the whole reason "console/lib/initglbs.h" exists in the first place is to move a bunch of stuff out of BSS, perhaps so that it *is* zeroed properly. Is it the intent that "doload" *not* zero out BSS? If so, this can certainly be worked around by Andrew code, using that very technique, but it can't be worked around by code pulled in from "libc", etc., since you have no control over that code; it would therfore seem that not having "doload" zero out BSS would be undesirable. Is this a performance issue? It already calls "malloc" for each common anyway; does adding a call to "bzero" make things noticeably worse?