Bizarre, i may just be going mad...

Official forum for the Chipmunk2D Physics Library.
Post Reply
MatthewHudghton
Posts: 9
Joined: Mon Oct 06, 2008 8:46 pm
Contact:

Bizarre, i may just be going mad...

Post by MatthewHudghton »

Hi, i recently started getting an odd error.
I'm running on windows 7 64bit.

My Code runs in debug mode in VS C++ 2008 EE.

But the generated .exe no longers run on my pc.

So i thoguht, ok probably an unintialised variable somewhere, tried the usual massive number of prinf statements and tracked down which line causing it to crash (adding the first shape to the space, but both the shape, body and the space as far as i can tell are intialised)

What is more strange is that i tested older versions of the program for which i knew the .exe worked (i'd just copied and pasted the folder and dated them, but these no longer work as well, and its not like i've gone and removed the .dll out of the folders they were in :/ - however the oldest versions i have still work, so probably is my code :/

The projects a bit big to post to forums, but happy to provide any detials etc.

I'm very confused, any ideas? - I mean it may just be my code somehow but it just seems very strange.

Thanks for any help!

-Matt
User avatar
Tam Toucan
Posts: 141
Joined: Tue Jun 23, 2009 4:26 pm
Contact:

Re: Bizarre, i may just be going mad...

Post by Tam Toucan »

In my experience this kind of problem is memory corruption. You trash memory somewhere and get away with it until one day the code is bigger, new variables etc and now your corrupt something that causes a crash. As you mention uninitialized vars is the other main cause.

It's weird that you say old code builds no longer work. So these are old .exe's that used to run but no longer do? That surely means something has changed on your PC e.g. graphics drivers and before the code was doing something maybe not 100% by the API and now it causes a crash (I had a that a couple of times with my OpenGL stuff).

Are you using a DLL for chipmunk? Could you be picking up the wrong version for the headers you build against? I'd try compiling it into the code and add some debug statements to see why it's crashing (might help pinpoint the corruption/unitialized var/whatever). I'm assuming that it's release build that crashes so you can't step through with the debugger?

Not much help really. Is you code under source control? Can you go back and see if there is a version that does work. Once had to binary search 100 revs to find where some change I'd made in common code broke another project.
MatthewHudghton
Posts: 9
Joined: Mon Oct 06, 2008 8:46 pm
Contact:

Re: Bizarre, i may just be going mad...

Post by MatthewHudghton »

Ok, turned out to me being silly not initializing something, although i'm sure the other versions used to work, but maybe i just imagined it!
but working now, so i'm happy :)
MatthewHudghton
Posts: 9
Joined: Mon Oct 06, 2008 8:46 pm
Contact:

Re: Bizarre, i may just be going mad...

Post by MatthewHudghton »

yey fulyl fixed,it was me being dumb, was an unititalised variable, forgot to set the body positions right at the very very start before i started using it, so poor chipmunk was having to handle adding an object at something like 3^300 , 3^300 :P
Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests