News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Help reading codeblocks.RPT

Started by daniloz, June 12, 2012, 10:47:12 AM

Previous topic - Next topic

daniloz

Quote from: ollydbg on June 15, 2012, 09:24:16 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:


char * p = anyIntValue;
*p = 0;

Then, change anyIntValue until your c::b crashed, or you just do a loop like:

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...

ollydbg

Quote from: daniloz on June 15, 2012, 09:37:52 AM
Quote from: ollydbg on June 15, 2012, 09:24:16 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:


char * p = anyIntValue;
*p = 0;

Then, change anyIntValue until your c::b crashed, or you just do a loop like:

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:

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.