Re: Catch stack overflow in an application



That is an interesting condition, but it should be caught by the vendor
prior to shipping to you. If not, get a different vendor.

More likely to not be caught:

void VariableBoom( char *InStr )
{
char Str[ 10 ];
int index = 0;
while( *InStr != '\0' )
Str[ index++ ] = *InStr;
}

Where there is no check to see that index >= 10;

I don't think that you really have a good way to catch this or any other
application exception from a driver.

--
Bruce Eitman (eMVP)
Senior Engineer
beitman AT applieddata DOT net

Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member

"Grass" <stasdesy@xxxxxxxxx> wrote in message
news:1188463980.069727.242240@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Aug 29, 5:40 pm, "Paul G. Tobey [eMVP]" <p space tobey no spam AT
no instrument no spam DOT com> wrote:
What does the driver have to do with this? A good question on Windows CE
should have: what version of Windows CE! What tools you're using! A
good
description of *what* you are trying to do (not how you've decided to do
it).

As far as I can think, only a debugger would be able to 'catch the stack
overflow condition'. It's unclear to me what the heck you're trying to
do,
though. If these applications are using your driver and are, only when
using your driver, generating stack overflows, you might look for data
that
you are returning to them which you think contains pointers to some other
data, but which can't be right. If the applications generate stack
overflows and your driver has nothing to do with the applications, then
contact the application owners and get them to fix the problem or send
the
source.

Paul T.

"Grass" <stasd...@xxxxxxxxx> wrote in message

news:1188398291.072858.232230@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Hi All,

I've written a driver that is loaded by devices.exe and want it to
monitor status of some applications. Applications were not written by
me and hence I don't have the source code.
Now, I'd like to catch the stack overflow condition in the monitored
applications. Any idea as to how I can do this.

Sorry for the lack of info. I try to catch stack overflow condition
from my driver in all application running on CE device. I have no
source code for the apps so please don't suggest fixing the apps.

Usually stack overflow in a n application results in stuck device. The
only way to get out of the condition is reset.
I checked it on a few CE devices all stuck on calling the following
code:
void Boom()
{
int BigArr[1024*1024];
BigArr[0] = 1;
}

The SEH does not help either.

Any ideas ?



.



Relevant Pages

  • Re: Catch stack overflow in an application
    ... You should be able to use Dr. Watson or create and register your own debugger. ... Note you would not do this within a device driver. ... If the applications generate stack ... Usually stack overflow in a n application results in stuck device. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Catch stack overflow in an application
    ... If these applications are using your driver and are, ... If the applications generate stack ... I'd like to catch the stack overflow condition in the monitored ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Catch stack overflow in an application
    ... When the device is "stuck" is your driver still executing code? ... If the applications generate stack ... I'd like to catch the stack overflow condition in the monitored ... source code for the apps so please don't suggest fixing the apps. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Cant print from Word 2008 (Excel prints OK)
    ... which can be found in the Utilities folder within the Applications folder. ... I am using the Gutenprint driver, because with the other driver none of ... Mac OS print preview, so I think my printer is printing me exactly what ... that it "couldn't communicate with the printer ... ...
    (microsoft.public.mac.office.word)
  • Re: WinXP SP2 very, very slow??
    ... The first thing I did was to look at the Admin Tools: Event Viewer ... Applications, Security are all information, but in Systems, every boot ... Seems like problem starts with bad driver, or nonexistent driver, ... support SCSI hard drives and also used for the more common SATA drives. ...
    (microsoft.public.windowsxp.general)