turn off debugging slop area in VC++ IDE ? 
Author Message
 turn off debugging slop area in VC++ IDE ?

Is there a way to turn off the debugging slop area in VC++ 2003 ?

If you debug an exe (release or debug build) from the VC++ IDE
then you apparently get additional space around allocated memory
(slop area ?).

If you start an exe and then attach to it with the VC++ de{*filter*}
then the slop area is apparently gone.  It is just as if you are running
this program for real - just with extra monitoring.  I find that this
mode is much more usefull in finding problems.

Thanks,
Lynn McGuire



Tue, 18 Oct 2005 03:30:09 GMT  
 turn off debugging slop area in VC++ IDE ?

Quote:
>If you debug an exe (release or debug build) from the VC++ IDE
>then you apparently get additional space around allocated memory
>(slop area ?).

>If you start an exe and then attach to it with the VC++ de{*filter*}
>then the slop area is apparently gone.

Lynn,

What makes you think you're seeing "slop" :) when you debug your
release build?

A debug build normally uses the debug heap functions which have
overhead for the debugging capabilities to catch memory leaks in the
run-time heap, but I don't see why you think there's any difference
between debugging the release version from the IDE and by attaching to
the running process. There may be pseudo random differences, but as
far as I know, that's all there should be.

Dave
--
MVP VC++ FAQ: http://www.*-*-*.com/



Tue, 18 Oct 2005 04:02:16 GMT  
 turn off debugging slop area in VC++ IDE ?

Quote:
> What makes you think you're seeing "slop" :) when you debug your
> release build?

Because I can run the release version with debugging turned on
from the VC++ 2003 IDE without seeing the problem (bug).
If I start the exe from the command prompt, I see the bug.
So, I attribute that lack of seeing the bug to de{*filter*} "slop"
which tends to mask "near" memory bugs (off by one, etc...).

Thanks,
Lynn



Tue, 18 Oct 2005 04:21:56 GMT  
 turn off debugging slop area in VC++ IDE ?

Quote:
> > What makes you think you're seeing "slop" :) when you debug your
> > release build?

> Because I can run the release version with debugging turned on
> from the VC++ 2003 IDE without seeing the problem (bug).
> If I start the exe from the command prompt, I see the bug.
> So, I attribute that lack of seeing the bug to de{*filter*} "slop"
> which tends to mask "near" memory bugs (off by one, etc...).

Is this a /clr compiled project?  Because the JIT acts differently if you are
under a de{*filter*} than if you are not.  I can't think of a reason you'd see the
behavior you are describing with a native exe.

That said, if you throw a DebugBreak in your program and run it from the
command line, you should be given the option to attach to your process, and
get the behavior you are expecting.  Alternatively, there might be an option
in VS to have the JIT produce release mode code while under the de{*filter*} (I
know there is one for cordbg, but I haven't looked for an equivalent in the
IDE).

Ken



Tue, 18 Oct 2005 04:30:32 GMT  
 turn off debugging slop area in VC++ IDE ?

Quote:
> Is this a /clr compiled project?  Because the JIT acts differently if you are
> under a de{*filter*} than if you are not.  I can't think of a reason you'd see the
> behavior you are describing with a native exe.

Nope <shudder>.  In fact I am converting from a bytecode interpreter
to C++ right now.  Doing well except for a few weird problems.

Quote:
> That said, if you throw a DebugBreak in your program and run it from the
> command line, you should be given the option to attach to your process, and
> get the behavior you are expecting.  Alternatively, there might be an option

Yup, stupid of me.  I could debug from the crash point.  I am getting
extreme tunnel vision at the moment ("must fix bugs").

Quote:
> in VS to have the JIT produce release mode code while under the de{*filter*} (I
> know there is one for cordbg, but I haven't looked for an equivalent in the
> IDE).

That would be cool.  Just something to turn off the padding for allocated
memory that the de{*filter*} apparently does when running a subprocess
instead of a independent process.

Thanks,
Lynn



Tue, 18 Oct 2005 04:39:39 GMT  
 turn off debugging slop area in VC++ IDE ?

Quote:

> >If you debug an exe (release or debug build) from the VC++ IDE
> >then you apparently get additional space around allocated memory
> >(slop area ?).

> >If you start an exe and then attach to it with the VC++ de{*filter*}
> >then the slop area is apparently gone.

> What makes you think you're seeing "slop" :) when you debug your
> release build?

> A debug build normally uses the debug heap functions which have
> overhead for the debugging capabilities to catch memory leaks in the
> run-time heap, but I don't see why you think there's any difference
> between debugging the release version from the IDE and by attaching to
> the running process. There may be pseudo random differences, but as
> far as I know, that's all there should be.

I have seen reproducible differences.  A release build running
standalone went into an infinite loop, a release build running in the
de{*filter*} did not.  It was interesting to debug, fortunately I noticed
the problem (related to iterator misuse).

This was VC6, so I don't know to what extent it applies to VC.Net.

--
Craig Powers
MVP - Visual C++



Tue, 18 Oct 2005 04:44:03 GMT  
 turn off debugging slop area in VC++ IDE ?

Quote:

>> Is this a /clr compiled project?  Because the JIT acts differently
>> if you are under a de{*filter*} than if you are not.  I can't think of a
>> reason you'd see the behavior you are describing with a native exe.

> Nope <shudder>.  In fact I am converting from a bytecode interpreter
> to C++ right now.  Doing well except for a few weird problems.

>> That said, if you throw a DebugBreak in your program and run it from
>> the command line, you should be given the option to attach to your
>> process, and get the behavior you are expecting.  Alternatively,
>> there might be an option

> Yup, stupid of me.  I could debug from the crash point.  I am getting
> extreme tunnel vision at the moment ("must fix bugs").

>> in VS to have the JIT produce release mode code while under the
>> de{*filter*} (I know there is one for cordbg, but I haven't looked for
>> an equivalent in the IDE).

> That would be cool.  Just something to turn off the padding for
> allocated memory that the de{*filter*} apparently does when running a
> subprocess
> instead of a independent process.

I can't comment any difference in allocation behavior when running with the
de{*filter*} attached - as far as I know there is none.

That said, there are many differences related to timing - de{*filter*} events
are effectively serialization points within the debuged process - whenever a
debug event occurs, all threads are frozen while the de{*filter*} runs.  This
can have significant ramifications in multi-threaded processes, especially
on a multi-processor machine.  If I had to guess, I'd be inclined to think
that the difference you're seeing is more likely due to timing changes than
to memory allocation strategy changes.

-cd



Tue, 18 Oct 2005 05:42:30 GMT  
 turn off debugging slop area in VC++ IDE ?

Quote:
> That said, there are many differences related to timing - de{*filter*} events
> are effectively serialization points within the debuged process - whenever a
> debug event occurs, all threads are frozen while the de{*filter*} runs.  This
> can have significant ramifications in multi-threaded processes, especially
> on a multi-processor machine.  If I had to guess, I'd be inclined to think
> that the difference you're seeing is more likely due to timing changes than
> to memory allocation strategy changes.

I suspect that I am corrupting memory in my exe somewhere
and then crashing downstream.  As far as I know, I am not
multi-threaded nor am I running a multiple/hyper threaded
cpu (s) (yet !).  This is only happening in the release version
of the exe when run outside VC++ 2003.  All of the crashing
problems have a common theme so I just gotta run it down
in a specific area of my exe.

Thanks,
Lynn



Tue, 18 Oct 2005 06:11:50 GMT  
 turn off debugging slop area in VC++ IDE ?

Quote:

> I suspect that I am corrupting memory in my exe somewhere
> and then crashing downstream.  As far as I know, I am not
> multi-threaded nor am I running a multiple/hyper threaded
> cpu (s) (yet !).  This is only happening in the release version
> of the exe when run outside VC++ 2003.  All of the crashing
> problems have a common theme so I just gotta run it down
> in a specific area of my exe.

Threading issues can affect non-SMP and non-hyperthreaded computers (though
they certainly show up more readily on multi processor rigs), but if the
program is single threaded, you're right in assuming that's most likely not
the cause.

Ken



Tue, 18 Oct 2005 06:50:53 GMT  
 turn off debugging slop area in VC++ IDE ?

Quote:
>> What makes you think you're seeing "slop" :) when you debug your
>> release build?

>Because I can run the release version with debugging turned on
>from the VC++ 2003 IDE without seeing the problem (bug).

But that might be due to subtle differences in the randomness of
uninitialised buffers - or even timing.

I'm not aware of any differences, if there are any real ones, perhaps
someone from MS could point us to something that explains it?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq



Tue, 18 Oct 2005 14:38:26 GMT  
 turn off debugging slop area in VC++ IDE ?
I forgot to say...

Have you tried enabling the newer run-time checking options for a
debug build with VS7(.1)? They can often catch real errors that go
undetected in release builds.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq



Tue, 18 Oct 2005 14:40:18 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. Howto: Turn off remote debugging in VC++ 5.0?

2. How to turn off debug heap checking?

3. Turning off just-in-time debugging

4. Can't turn off remote debugging!

5. How to turn TRACE off in Debug mode

6. Turning off debug heap in MSVC

7. Multilanguage Debugging in VC IDE and VB IDE

8. Multilanguage Debugging in VC IDE and VB IDE

9. Ways of turning echo off ... off

10. Power On/Off and Turn off screen?

11. turn off monitor from vc

12. How Do I turn off warning messages in VC++ 5.0

 

 
Powered by phpBB® Forum Software