www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/02/27/02:03:18

From: j DOT aldrich6 AT genie DOT com
Message-Id: <199602270648.AA203403712@relay1.geis.com>
Date: Tue, 27 Feb 96 06:35:00 UTC 0000
To: djgpp AT delorie DOT com
Mime-Version: 1.0
Subject: I love GDB

This is going to sound ironic, given the earlier mail somebody sent about there
being few "non-bug reports", but I just had to mention it to somebody.  :)

I had always used EDEBUG32 with v1.12, because it was neat and easy to use.  I
downloaded GDB for v.2, but I have been kinda tentative about trying it out
because it is substantially more complex.  However, it just helped me solve a
recurrent bug that has been plaguing me throughout my development of a very
large mud server.  Every now and then, for the past little while, the thing has
just been crashing randomly on me, giving me no clue as to why.  The crashes
have been in seemingly impossible places, like seg viols dereferencing a struct
pointer within a for loop where I explicitly test for NULL before using '->'.

Well, I had another one of those tonight, while attempting to display an
extremely large block of text.  Fortunately, I was running GDB at the time, and
was able to print the value of the string array that caused the crash.  I
discovered that whole blocks of the array had been overwritten by text that
another completely separate function had output.  From this I was able to
deduce that I had declared my string buffers in that  (and a few other)
functions too small, so they were overflowing into adjacent memory locations,
some of which happened to include the string array that caused the crash.

I have since dramatically increased the size of the buffers, so this problem
should never plague me again.  I would like to thank the designers of GDB for
making this wonderful tool.  :)

John

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019