Thread: error free code but program crashed ???

  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    2

    error free code but program crashed ???

    Hi,
    I completed my code,
    I have some nested for loops with dimensions i=2100, j=160, k=12,
    using Code::Blocks named program
    compiled and error free,

    but after make run, a small 'windows' window appears, and it says:
    abc.exe has stopped working.
    A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.


    Then, the black i/o area 'you know' appears, and it says:
    process returned -1073741571 <0*C00000FD> execution time: 89.365 s
    press any key to continue


    Finally, at the bottom part of the program, I found the messages below:
    Checking for existence: C:\Users\...abc.exe
    Executing: C:\Program Files\CodeBlocks/cb_console_runner.exe "C:\Users\...abc.exe" (in C:\Users\...\MyFiles)
    Process terminated with status -1073741571 (-18437 minutes, -19 seconds)


    What is the problem?

  2. #2
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    Then I guess the code is not error free?

  3. #3
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    By the way, my car doesn't work. What is the problem?

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    The problem is you didn't post any code for us to comment on.

    It might come as a bit of a shock, but getting something to compile is as easy as falling off a log.
    Getting something to actually run without crashing takes some skill.

    Without seeing the code, it would take weeks to list only a subset of the possible ways you could have made a mess of it, and still be no nearer the answer.

    You could perhaps start by running the code in the debugger. At least then it will trap at the point the problem is detected, which might give you some information as to where to start looking.

    C00000FD - Google Search
    This says stack overflow, so perhaps start with stupidly large local arrays (like int large[1000000]) or unterminated recursion.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Registered User
    Join Date
    Aug 2011
    Posts
    2
    my code has approximately 340 rows, I can post it here, shall I?

    I realized now that I have an array with approximately 3.700.000 elements...
    Is there any limitation on maximum array size? What is the upper bound?

    and three more questions:
    1.Is there any limitation on maximum computation number of C? of computer (for a certain task), even of windows?
    2.Is there any limitation on maximum computation time of a C program?
    3.Is there any limitation on anything else like this sort?

    There is no unterminated recursion in my code.

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > I realized now that I have an array with approximately 3.700.000 elements...
    > Is there any limitation on maximum array size? What is the upper bound?
    The default for most systems is to allocate between 1MB and 8MB of stack space. This can be changed, but it gets horribly specific to each system.

    The easy fix is to say something like
    Code:
    int main ( ) {
      static int large[3700000];
    }
    > 1.Is there any limitation on maximum computation number of C? of computer (for a certain task), even of windows?
    Your machine limits on the range of integers and floats.
    But there are a number of "bignum" libraries that allow you to calculate with arbitrarily large numbers (within the limits of memory)

    > 2.Is there any limitation on maximum computation time of a C program?
    Depends on your OS and user privileges.

    > 3.Is there any limitation on anything else like this sort?
    There are limits for everything on a finite machine.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  7. #7
    Registered User
    Join Date
    Apr 2006
    Posts
    2,149
    Making large arrays static is one way to solve the stack limitation on large arrays. Another, more stylistically preferred way is to allocate on the heap using malloc.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

  8. #8
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by aykuluk View Post
    What is the problem?
    The immediate problem is that you are not broadcasting strong enough mind rays for anyone to read ...

    Seriously... How the heck to we know what's wrong when you don't post the code for us to examine?

    Hard lesson #1 in C programming.... "Compiles" does not mean "Works".

    I note from other messages you are asking for a 14 megabyte array to be created on the program's stack... that's probably what's killing your program. But there's no way to be sure until you post your code.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program crashed, no compilation errors
    By kaopei in forum C Programming
    Replies: 1
    Last Post: 11-20-2010, 06:44 AM
  2. using fprintf crashed my program
    By kiros88 in forum C Programming
    Replies: 4
    Last Post: 11-08-2010, 01:14 PM
  3. Malloc - Free giving double free or corruption error
    By andrew.bolster in forum C Programming
    Replies: 2
    Last Post: 11-02-2007, 06:22 AM
  4. Auto shutdown of crashed program...
    By phil_drew in forum Windows Programming
    Replies: 1
    Last Post: 04-24-2004, 12:48 AM
  5. My Program Crashed help!!!
    By St0rmTroop3er in forum C++ Programming
    Replies: 6
    Last Post: 09-05-2003, 04:25 PM

Tags for this Thread