Re: Program crashes when running it outside dev environment



z said:

I use Visual C 2005 to develop my programs.

Oh, my poor dear chap, I do sympathise.

One in particular is
crashing in very specific and hard to replicate situations, made worse
by the fact it only crashes when run -outside- the dev - as an exe,
not from the Debug option.

Sounds like a Heisenbug to me - a wild pointer, an array bounds
violation, mucking about with memory you don't own, something like
that. They can be really, *really* frustrating to chase down. I know
this because I used to find it so, and the debugger isn't as much help
as it might be in these situations, for the reason you outline.

A few years ago I discovered that, as I started tightening up my
attitude to the language lawyer stuff we discuss so much here in clc, I
was getting fewer and fewer Heisenbugs, and they were becoming easier
and easier to fix.

So my suggestions would be:

1) crank up your warning level to the max
2) turn off any extensions you can live without
3) fix every single diagnostic message, and *never* with a cast
4) think.

Step 4 is hardest, of course, especially with nothing to go on. You,
however, can see your program, which we can't. I suggest you check all
your pointer and array stuff *very* carefully indeed.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
.