PDA

View Full Version : Weird problem with std::stringstream (hardware?)


Backov
05-25-2007, 01:02 PM
I believe my nice new, couple month old uber-machine has just failed on me.

I'm happily coding along, and all of a sudden I get a failure deep inside the VC code, on this line:

std::stringstream ss;

I get a fail (randomly) in this, and later down I get a fail (deep inside Ogres code) when it trys to new 496 bytes! Since when does new fail? The return is a no memory exception.

So, considering I've got hundreds of gigs of free HD space, 2 gigs of ram, and a brand new machine - what's going on here?

Is it possible I've managed to mess up new with out of bounds writes? Does that allocation code live in the same memory space as my program? Or is this for sure a hardware problem?

cliffski
05-25-2007, 01:33 PM
sounds like you screwed something up earlier, and its trampling in semi-random places. Its unlikely to be anything to do with 'new, that just happens to be where it dies as a result of an earlier problem.
Finding such bugs is pretty hard, I tend to comment out entire subsystems of the game and see what bit makes it go away :D

HairyTroll
05-25-2007, 04:53 PM
I believe my nice new, couple month old uber-machine has just failed on me.

I'm happily coding along, and all of a sudden I get a failure deep inside the VC code, on this line:

std::stringstream ss;

I get a fail (randomly) in this, and later down I get a fail (deep inside Ogres code) when it trys to new 496 bytes! Since when does new fail? The return is a no memory exception.

You are using version control, right? Go back a few revisions until you find a version that does not exhibit the error. Then examine the diffs to determine the change that may have introduced the bug.

Backov
05-25-2007, 06:08 PM
That is indeed what it was. My carelessness with an array pointer stomped something good.

I've just been in high level language land too long, I didn't remember that things could get munched that badly.

HairyTroll->

Of course, but it was during the development of a big feature, it wouldn't have told me anything. I've got it now.

Don't let anyone tell you that geometry generation is easy. Holy crap, it takes forever.