[RESOLVED] Release mode crash problem
Hi All,
My program just crashes in release mode. I had one .cpp file which contains a gaint array data. I link this array data using extern global variable.
It was compiling fine and was giving crash in release mode. When I debugged, it's this array data giving the crash. But when I click AddExistingItem and once again added this file into the project, crash is not happening. What's the problem ?:confused:
Re: Release mode crash problem
The problem is your program has a serious bug (or bugs). You must find out where it (or they) lies.
Debug your release version and see what and where happens.
Surviving the Release Version
Re: Release mode crash problem
Thank you Victor, I'll update when I find anything interesting.
Re: Release mode crash problem
I have a giant array in one of the source files. I was extern linking this variable throughout. According to the official documentation, this array should be "const", when I changed the array to const, it solved the crash.
Re: [RESOLVED] Release mode crash problem
Define "a giant array".
What is the type of this array?
If you declare it as const you presume that the array data must not be changed. Don't you try to change it? Do you check if you don't access it outside the boundaries? Did you initialize it?
Re: [RESOLVED] Release mode crash problem
Hi Victor,
Thank you for coming in again and your efforts in understanding and helping my problem
myheader.h
extern unsigned char const large_data[];
mydata.cpp
previous:
extern "C" unsigned char large_data[] {............}
changed to:
extern "C" unsigned char const large_data[] {............}
Quote:
Originally Posted by
VictorN
Define "a giant array".
What is the type of this array?
unsigned char
Quote:
If you declare it as const you presume that the array data must not be changed. Don't you try to change it?
I didn't change the array data from anywhere as I should not do that. I've to only make use of the data in the array.
Quote:
Do you check if you don't access it outside the boundaries? Did you initialize it?
outside the boundaries ? I didn't understand this, but if I don't access this array data, it's working well.
I didn't initialize it. It's global variable still, how should I initialize it?