CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2007
    Posts
    155

    [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 ?

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    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
    Victor Nijegorodov

  3. #3
    Join Date
    Mar 2007
    Posts
    155

    Re: Release mode crash problem

    Thank you Victor, I'll update when I find anything interesting.

  4. #4
    Join Date
    Mar 2007
    Posts
    155

    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.

  5. #5
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    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?
    Victor Nijegorodov

  6. #6
    Join Date
    Mar 2007
    Posts
    155

    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 View Post
    Define "a giant array".
    What is the type of this array?
    unsigned char
    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.
    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?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured