c - Errors when translating a project from Visual Studio 2008 to 2010 -


I worked with Visual Studio 2008 in a C project without problems. I now have the same source files in Visual Studio 2010 Added, compiled without problems but when I debug the program:

Unwanted exception on da34.exe on 0x00417257: 0xC0000005: Access violation reached at position 0x00030000.

Seeing the code, I can see it:

 ; Find next lower page and check cs20: subfax, _PAGESIZE_; PAGESIZE TEST DOWN PTR [EX], EX; Check page Jmp short cs10 _chkstk endp end  

and this indicates the "test page" line

Do you know what could be the reason? My program is very simple.

Thank you

UPDATE:

I have found a "cause" of the error, only after commenting on the contents of the main work , Half unrelated, and so on. One in the program C and an .h file. A type definition is defined in .h file:

  typedef FLOAT_TYPE d_elem [NMAX] [NMAX] [3];  

In the .c file on the main function, when the variable is defined, then there is a row:

  d_elem d_m;  

If I comment on this line, then the error disappears. I find it strange, what's going on here? Of course the whole program compiles and runs with GCC on Linux without this problem

UPDATE2: Solution (stupid) is to increase stack reserve size on project options, linkers etc. VS 2008 runs the program with the same default options

An access violation will be a way of your program There are so many ways to do this in a program using for manifold, so long as you show us some code that re-present it, we will find you Will not be able to help

Edit: This is the very nature of UB that the results of your program become unpredictable. Worked? So what? It can appear in a way UB, so when you make random changes, the accident is taken away? Well, it's unexpected for you to look at me about UB (this is just a little exaggerated.) In fact

Its face: As long as your program invites somehow undefined behavior anywhere, anything can happen, anytime. Rather than making random changes that produce random results, try to find and solve the real problem.
When it crashes, break into the debugger and look at the call stack, variables, which was trying the program when it crashed, how did it get found, this value is stupid and why it is nonsense.
It's a shot in the dark, but it looks like that 3D array, so you can read very deeply, causing the pile to fly. For this, to say that you have shown very little code


Comments