Author Topic: Help reading codeblocks.RPT  (Read 32257 times)

daniloz

  • Guest
Re: Help reading codeblocks.RPT
« Reply #30 on: June 15, 2012, 09:37:52 am »
Ok, it looks like this code does not crash c::b on you win7 system. (Win7 is robust than WinXP)
What I can suggest is you can write to some other address:

Code
char * p = anyIntValue;
*p = 0;
Then, change anyIntValue until your c::b crashed, or you just do a loop like:
Code
for (int i=0;i<0xfffffffffff;i++)
{
char * p = i;
*p = 0;
}

Actually, your original code is fine and even if I do the for, when debugging, I get a "segmentation fault" on the first iteration, i.e. with char *p = 0. The strange thing is that after this "segmentation fault" I can just run again and I come back to the "Start Here" window.
And, again, when not using the debugger, but just running it, I see no exception/crash at all...

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6077
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Help reading codeblocks.RPT
« Reply #31 on: June 15, 2012, 09:40:55 am »
Ok, it looks like this code does not crash c::b on you win7 system. (Win7 is robust than WinXP)
What I can suggest is you can write to some other address:

Code
char * p = anyIntValue;
*p = 0;
Then, change anyIntValue until your c::b crashed, or you just do a loop like:
Code
for (int i=0;i<0xfffffffffff;i++)
{
char * p = i;
*p = 0;
}

Actually, your original code is fine and even if I do the for, when debugging, I get a "segmentation fault" on the first iteration, i.e. with char *p = 0. The strange thing is that after this "segmentation fault" I can just run again and I come back to the "Start Here" window.
And, again, when not using the debugger, but just running it, I see no exception/crash at all...
Interesting, you need more dirty crash code snippet like:
Code
delete p; //p can be any address
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.