Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Jeff Sullivan <jps@zk3.dec.com>
Subject: Re: Nightmare pointer problem
Date: 1999/01/22	[thread overview]
Message-ID: <36A8A994.F21F11@zk3.dec.com> (raw)
In-Reply-To: 36A71F67.56BE@vegauk.co.uk

Brian Charlton wrote:
> 
> We have developed a very large C++ application program on a DEC ALPHA
> runnning OSF1, which appears to be working fine 50% of the time.
> However, now and then it crashes with a segmentation violation.  When we
> compile for debug the program will crash in a different location,
> usually in library functions which we only have the binaries for.
> 
> Some data has become corrupted, perhaps an object is being deleted
> twice?
> 
> I am aware of tools, available for the PC, which fill unused memory with
> zeros to help show up bad pointers sooner.

What version of the compiler and OS are you using?

There are a few of things that you can try.

 The Digital C++ compiler contains a -trapuv switch (similar to
 DEC C), which initializes all uninitialized data to some "known
 bad" value. If the problem is due to an uninitialized pointer
 (and hence unpredictable results), this will make the problem
 much more reproducible. See man cxx(1) for details.

 There is a tool called ATOM third degree that is a heap usage
 and leak profiler, and memory-access error checker for C and
 C++ programs. What you do is ATOMize the application and run it
 as you normally would. It will produce a log file of potential
 memory overwrites, etc. It's worked for me in the past to debug
 just this type of problem. See man third(1) for details.

 You can also enable more diagnostics in the compiler itself,
 either by enabling more messages or compiling in a stricter
 mode. See the -msg_enable and -std flags in the cxx(1) man
 page. These are applicable for DIGITAL C++ V6.0 and later.
 
Hope it helps.

-Jeff

-- 
Jeff Sullivan | Compaq Computer Corp   |      jps@zk3.dec.com
DEC C and C++ | Nashua, NH  ZK3-2/X29  | sullivan@zko.dec.com



      parent reply	other threads:[~1999-01-22  5:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-21  5:00 Nightmare pointer problem Brian Charlton
1999-01-21  5:00 ` Phil Edwards
1999-01-22  5:00 ` Jeff Sullivan [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox