Xref: news2.mv.net comp.os.msdos.djgpp:8592 From: Thomas Nilsson Newsgroups: comp.os.msdos.djgpp Subject: Possible static data zeroisation bug in DJGPP v2? Date: Fri, 13 Sep 1996 19:23:43 +0200 Organization: SoftLab Lines: 43 Message-ID: <3239989F.4626@softlab.se> NNTP-Posting-Host: rabbit.softlab.se Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp I have an application which I mainly develop on Unix, however thanks to the wonderful DJGPP it's very easy to port to PC's, thanks all who have contributed in the DJGPP project!! However I have stumbled upon a problem: In one of the modules I have a static structure that is essential to the output from the program. Somehow it is not zeroised correctly, or of course it could be overwritten by some other part of the program. I decided to investigate and started 'gdb' a debugger which I am much familiar with from the Unix environment. IT WON'T LET ME SEE THE STRUCTURE UNTIL I ENTER A FUNCTION WHICH USES IT. The structure is declared static at the top level of the module and in the beginning of the file, but still gdb says 'No symbol xxxx in current context'. The structure *should* not be used before that point in the running of the program, but it is not zero as I would have expected. This being strange, but still I wanted to investigate this structure, so I removed the static declaration to make it more visible, and thought that I might get at it already at the start of the program. And of course I could, *but* now it is zeroised correctly and not destroyed so the program works perfectly... Is this a bug, or if not, how do I find out when the structure is trashed. Note however that Purify (a lovely memory access analyser for many plattforms) does not indicate any problems on Unix (so at least it's not a general bug, but then which ones are...) /Thomas -- "Little languages go a long way..." (ThoNi of ThoNi&GorFo Adventure Factories in 1985) ------------------------------------------------------------------------ Thomas Nilsson Phone Int.: (+46) 13 12 11 67 Stenbrötsgatan 57 Phone Nat.: 013 - 12 11 67 S-582 47 LINKÖPING Email: thoni AT softlab DOT se SWEDEN alan-request AT softlab DOT se for info ------------------------------------------------------------------------