Re: I-4GL: Dirty memory (uninitialized variables)
Posted in 1998
John Bitsche wrote: > > comp.databases.informix: > > Nope. I ain't talking about "dirty memory" as in "remember Pamela > Anderson doing the wombazilly". If you're looking for a perverted good > time, and you're not strangely obsessed with 4GL, then you're looking in > the wrong posting. > > I'm a-talking about Informix-4GL. We ported a big-honkin' legacy 4GL > (FourGen-based) app from a DG box to a SUN, and are discovering that the > legacy code has a lot of uninitialized variables in it. At random, > these uninitialized variables show up with leftover garbage in them > (because the malloc got some pre-used mem). > > Apparently either the DG OS or the compiler was nice enough to clean out > memory before handing it off to the 4ge programs, so we never > experienced the prob on the DG box. Now that we're on the SUN,... > > Not wanting to resort to running all programs as 4gi only, I am looking > for a good idea on how to get "pre-cleaned" memory for the 4ge > programs. The other alternative, hunting down all uninitialized > variables, would be a long, long nightmarish experience. > > Help? > > ====== Environment ====== > SunOS 5.5.1 Generic_103640-17 > Ultra-Enterprise-10000 > gcc version 2.7.2.1 > DB-Access Version 7.24.UC2 > INFORMIX-OnLine Version 7.24.UC2 > INFORMIX-ESQL Version 7.24.UC2 > INFORMIX-4GL Version 6.05.UD2 > INFORMIX-4GL Version 6.05.UD2 > INFORMIX-SQL Version 6.05.UD2 > > Note: our group server is not currently functioning, so please respond > to me by email if possible. > > -- > John Bitsche > Programmer/Analyst > Whole Foods Market > john.bitsche@wholefoods.com Just to add a (very) little to what Jonathon wrote. Module variables should still be initialized to zeros or nulls in the compiled version (they are C statics, whcih are defined to be zeroed). Function variables come off the stack and can contain anything in the C version of 4GL. -- Peter Lancashire Information Systems Specialist, Bayer plc Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK Tel: +44-1635-562258, Fax: +44-1635-562281 Mail: Peter.Lancashire.PL1@bayer.co.uk --- My Internet plumbing does not allow me to mail and post news together. Sorry. All opinions are my own and not those of Bayer plc. --- Join Infuse, the UK Informix User Group at http://www.infuse.org.uk/