This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
>To: address@hidden >From: "V. Lakshmanan" <address@hidden> >Subject: Re: 20020905: ncendef error >Organization: NOAA/NSSL Hi Lak, > The previous bug fix took care several of our programs, > but another one would keep crashing, especially when running > on a machine with lots of other programs. > > Running *that* with valgrind gave me this error: > ==17483== Conditional jump or move depends on uninitialised value(s) > ==17483== at 0x40903262: ncio_px_get (posixio.c:486) > ==17483== by 0x4090B702: putNCvx_double_double (putget.c:2269) > ==17483== by 0x4090BDDF: putNCv_double (putget.c:2484) > ==17483== by 0x40911BA7: nc_put_vara_double (putget.c:5761) > > The only uninitialized variable there is also a local > variable on line 5708 of putget.c which should be: > size_t iocount=0; > If that variable is uninitialized, huge amounts of > memory may be requested(?). > > Anyway, since this error also cropped up in putget.c, > I went through the entire file and initialized the local > variables (the only ones I didn't fix are the *varm* calls). > In some cases, the variable is initialized immediately > afterwords, but it was easier to just set 'em all to 0 > than to look at each case individually. > > I hope that you the fixes go into the next version. Thanks very much for tracking this down and providing fixes. I will have to translate the fixes to putget.m4, since putget.c is generated from putget.m4, but there are a lot fewer places to fix in putget.m4. I'm surprised purify doesn't show these uninitialized memory reads when running "Make test", so you must be exercising something our extensive tests don't hit. --Russ