Board index » cppbuilder » Disabling CodeGuard cauuse application runtime error [list index out of bounds]

Disabling CodeGuard cauuse application runtime error [list index out of bounds]


2005-11-01 06:32:46 PM
cppbuilder6
This is an odd one. I have an application that runs fine if CodeGuard is
enabled for the project, everything ticked. However, if I disable it,
recompile and then run I almost immediately get a runtime error: list index
out of bounds -1.
I cannot think of any reason why leaving CodeGuard enabled would suppress a
bug in my code, if that's what it is. Any idea what's going on? CodeGuard
reports no problem with the application when it is enabled. I can post code
samples if that would be of any use.
Thanks.
--
Matt Ross
-=I haven't lost my mind; it's backed up on tape.=-
 
 

Re:Disabling CodeGuard cauuse application runtime error [list index out of bounds]

"Matt Ross" < XXXX@XXXXX.COM >wrote:
Quote
This is an odd one. I have an application that runs fine if CodeGuard is
enabled for the project, everything ticked. However, if I disable it,
recompile and then run I almost immediately get a runtime error: list index
out of bounds -1.
Possibly you have an object file that didn't get rebuilt. Try killing
all the .obj files and rebuilding, so that all the code is built using
the same compilation options.
Alan Bellingham
--
ACCU Conference 2006 - 19-22 April, Randolph Hotel, Oxford, UK
 

Re:Disabling CodeGuard cauuse application runtime error [list index out of bounds]

"Alan Bellingham" < XXXX@XXXXX.COM >wrote in message
Quote
"Matt Ross" < XXXX@XXXXX.COM >wrote:

>This is an odd one. I have an application that runs fine if CodeGuard is
>enabled for the project, everything ticked. However, if I disable it,
>recompile and then run I almost immediately get a runtime error: list
>index
>out of bounds -1.

Possibly you have an object file that didn't get rebuilt. Try killing
all the .obj files and rebuilding, so that all the code is built using
the same compilation options.

Alan Bellingham
--
ACCU Conference 2006 - 19-22 April, Randolph Hotel, Oxford, UK
Thanks for the suggestion Alan. Unfortunately deleting all .obj files,
disabling CodeGuard and building again does not make a difference. Are there
any other files I could safely delete [pre-compiled headers are already set
to None]? BTW forgot to mention this is C++ Builder 6 Enterprise patched to
update4.
--
Matt Ross
-=I haven't lost my mind; it's backed up on tape.=-
 

{smallsort}

Re:Disabling CodeGuard cauuse application runtime error [list index out of bounds]

"Matt Ross" < XXXX@XXXXX.COM >writes:
Quote
This is an odd one. I have an application that runs fine if CodeGuard is
enabled for the project, everything ticked. However, if I disable it,
recompile and then run I almost immediately get a runtime error: list index
out of bounds -1.

I cannot think of any reason why leaving CodeGuard enabled would suppress a
bug in my code, if that's what it is.
I can.
Your program may have undefined behavior, of the kind that changes
that triggers the error under some circumstances but not under others.
Quote
Any idea what's going on? CodeGuard reports no problem with the
application when it is enabled. I can post code samples if that
would be of any use.
An uninitialized variable could easily be the reason.
 

Re:Disabling CodeGuard cauuse application runtime error [list index out of bounds]

Matt Ross wrote:
Quote
>Possibly you have an object file that didn't get rebuilt. Try killing
>all the .obj files and rebuilding

Unfortunately deleting all .obj files,
disabling CodeGuard and building again does not make a difference.
You can also try to rebuild with command line compiler:
- Disable CG
- Project->Export make file;
- Close project in IDE;
- "make YourPrj.mak" in your project directory.
Alex.
 

Re:Disabling CodeGuard cauuse application runtime error [list index out of bounds]

Quote
An uninitialized variable could easily be the reason.
Most probably in his case.
IIRC, CodeGuard zeroes out the memory when you allocate memory and fills it
with patterns when you free it. So it essentially does your initialization
for you. Removing it simply puts it to an unknown state.