views:

23

answers:

3

Hey

I have my little client application which - when started - creates some user defined objects on the heap via "new"

pHistory = new CHistory;

This was no problem and everything ran fine until yesterday.

I wanted to deploy my application and did decide to use a "Setup Project" from Visual Studio 2010. http://msdn.microsoft.com/en-us/library/dd293568.aspx

But a few minutes ago, when I tried to run the program ( I did not do any changes after the deployment yesterday ), it throws an unhandled exception

Unhandled exception at 0x55b259da (msvcr100d.dll) in CLient.exe: 0xC0000005: Access violation reading location 0xccccccc0.

And I can not imagine, why... I already deleted the Setup Project from the solution, but that did not change anything... If there are some changes in the project settings, made by the Setup project, I don´t know where and what...

Is anyone familiar with this or may help?

Thank You.

EDIT: this happens when i debug the application via visual studio... not on another computer where i deployed it!!!

A: 

Looks like uninitialised memory. Did you change from debug to release builds when you started getting ready to distribute it?

Greg Domjan
I did both... I did a debug release build and a release release build :D...
Incubbus
+1  A: 

reading location 0xccccccc0

The debug build always initializes local variables with the value 0xcccccccc, designed to let your program crash when it tries to use an uninitialized variable. That's working well, always nice to get a diagnostic for a bug in your code that will cause random failure in the shipped product.

This of course has nothing to do with your setup project. Use the debugger to find out where the bug is located. The call stack should be a major hint as to what pointer is invalid.

Hans Passant
the bug happens when the debug indicator reaches the code above: "phistory = new CHistory"; or if I comment this out, whenever it reaches a "new"-instruction
Incubbus
Sounds like the heap got destroyed. Never fun to debug, leverage crtdbg.h. Good luck with it.
Hans Passant
but why did it happen without any changes?...
Incubbus
The side-effects of heap corruption are non-deterministic.
Hans Passant
Well... My workaround was to create a new solution and insert the existing into it... that worked well...
Incubbus
"Any sufficiently advanced technology is indistinguishable from magic" - Arthur C Clarke.
Hans Passant
A: 

My newbie fix to this problem is to create a new solution and insert every file from the old one to this new one.

It works fine, now...

But I am still not sure what caused this problem... I am still believing in the cause due to the setup project... but the other answerers told me it is not the cause :/...

Incubbus