hi,
I m working on video conferencing application. I m facing one problem.
The decoder of my application crashes with ACCESS VIOLATION.

I m doing basic authentication of the video data packets like sequence
number but the problem is sometimes decoder get crash with access
violation. I m suspecting the cause is due to bad data passed to
decoder. I want to catch the crash and want to show some nice message
box. I tried to use try/catch(...) but couldnt catch it.

My video application is basically an ATL COM EXE.

Please help me out.

Regards
Usman

Re: catching ACCESS VIOLATION by Abdo

Abdo
Thu Apr 13 10:17:58 CDT 2006

<usmanusb@gmail.com> wrote in message
news:1144933321.676755.224570@e56g2000cwe.googlegroups.com...
> hi,
> I m working on video conferencing application. I m facing one problem.
> The decoder of my application crashes with ACCESS VIOLATION.
>
> I m doing basic authentication of the video data packets like sequence
> number but the problem is sometimes decoder get crash with access
> violation. I m suspecting the cause is due to bad data passed to
> decoder. I want to catch the crash and want to show some nice message
> box. I tried to use try/catch(...) but couldnt catch it.
>
> My video application is basically an ATL COM EXE.
>
> Please help me out.
>
> Regards
> Usman
>

That's strange, are you sure the exception happens in the same thread as
your application?

--
Abdo Haji-Ali
Programmer
In|Framez



Re: catching ACCESS VIOLATION by Marcus

Marcus
Thu Apr 13 09:18:07 CDT 2006

Compile with /EHa and write something like this:

#inlcucde <excpt.h>

__try
{
...
}
__except( GetExceptionCode() == ERROR_ACCESS_VIOLATION ?
EXCEPTION_EXECUTE_HANDLER :
EXCEPTION_CONTINUE_SEARCH)
{
...
}

Marcus

<usmanusb@gmail.com> wrote in message
news:1144933321.676755.224570@e56g2000cwe.googlegroups.com...
> hi,
> I m working on video conferencing application. I m facing one problem.
> The decoder of my application crashes with ACCESS VIOLATION.
>
> I m doing basic authentication of the video data packets like sequence
> number but the problem is sometimes decoder get crash with access
> violation. I m suspecting the cause is due to bad data passed to
> decoder. I want to catch the crash and want to show some nice message
> box. I tried to use try/catch(...) but couldnt catch it.
>
> My video application is basically an ATL COM EXE.
>
> Please help me out.
>
> Regards
> Usman
>



Re: catching ACCESS VIOLATION by Alexander

Alexander
Thu Apr 13 09:58:20 CDT 2006

Instead of showing nice dialog box, do a complete code review of your
decoder, to find why it crashes and are there any other places that don't
validate data. Never trust external data (even registry and your config
files), always validate all input.

<usmanusb@gmail.com> wrote in message
news:1144933321.676755.224570@e56g2000cwe.googlegroups.com...
> hi,
> I m working on video conferencing application. I m facing one problem.
> The decoder of my application crashes with ACCESS VIOLATION.
>
> I m doing basic authentication of the video data packets like sequence
> number but the problem is sometimes decoder get crash with access
> violation. I m suspecting the cause is due to bad data passed to
> decoder. I want to catch the crash and want to show some nice message
> box. I tried to use try/catch(...) but couldnt catch it.
>
> My video application is basically an ATL COM EXE.
>
> Please help me out.
>
> Regards
> Usman
>



Re: catching ACCESS VIOLATION by Alex

Alex
Sat Apr 15 04:15:17 CDT 2006

usmanusb@gmail.com wrote:
> hi,
> I m working on video conferencing application. I m facing
> one problem. The decoder of my application crashes with
> ACCESS VIOLATION.
>
> I m doing basic authentication of the video data packets
> like sequence number but the problem is sometimes decoder
> get crash with access violation. I m suspecting the cause
> is due to bad data passed to decoder. I want to catch the
> crash and want to show some nice message box. I tried to
> use try/catch(...) but couldnt catch it.

catch(...) won't handle asynchronous Win32 exceptions in
VC2005 by default. Read this article for comprehensive
explanation:



Re: catching ACCESS VIOLATION by Alex

Alex
Sat Apr 15 04:18:02 CDT 2006

usmanusb@gmail.com wrote:
> hi,
> I m working on video conferencing application. I m facing
> one problem. The decoder of my application crashes with
> ACCESS VIOLATION.
>
> I m doing basic authentication of the video data packets
> like sequence number but the problem is sometimes decoder
> get crash with access violation. I m suspecting the cause
> is due to bad data passed to decoder. I want to catch the
> crash and want to show some nice message box. I tried to
> use try/catch(...) but couldnt catch it.

catch(...) won't handle asynchronous Win32 exceptions in
VC2005 by default. Read this article for comprehensive
explanation:

"A Visual C++ Exception FAQ"
http://members.cox.net/doug_web/eh.htm

You have two options:

1. Install SE handler and translate SE exception to C++
exception. Look in MSDN for _set_se_translator to get more
info.

2. Fix original code, so it doesn't cause access violation.



Re: catching ACCESS VIOLATION by usmanusb

usmanusb
Sun Apr 16 10:07:17 CDT 2006

Thanks alot for replying.

My video application is in atl com exe. and i m using directshow. i m
using avi decompressor filter which is basically decompressing the vdo
wave codec . the problem is once I start/run the video, its sending the
data from my ATL COM to decoder to decode. Which means after the
execution of play() it start the video and send the data from the
network and from my COM to vdo wave decoder. now if there can be any
crash i m not able to catch it. I m not sure why. even when i put the
catch blocks in the COM shutdown methods.
the code is something like this... My main purpose is to catch the
crash and handle it and execute the relevant routines.

__try
{
iMediaControl->play()
}

__except( GetExceptionCode() == ERROR_ACCESS_VIOLATION ?
EXCEPTION_EXECUTE_HANDLER :
EXCEPTION_CONTINUE_SEARCH)
{
...

}

please reply me.Thanks


Regards
Usman


Re: catching ACCESS VIOLATION by Alex

Alex
Sun Apr 16 13:02:34 CDT 2006

usmanusb@gmail.com wrote:
> My video application is in atl com exe. and i m using
> directshow. i m using avi decompressor filter which is
> basically decompressing the vdo wave codec . the problem
> is once I start/run the video, its sending the data from
> my ATL COM to decoder to decode. Which means after the
> execution of play() it start the video and send the data
> from the network and from my COM to vdo wave decoder. now
> if there can be any crash i m not able to catch it. I m
> not sure why. even when i put the catch blocks in the COM
> shutdown methods.
> the code is something like this... My main purpose is to
> catch the crash and handle it and execute the relevant
> routines.
>
> __try
> {
> iMediaControl->play()
> }
>
> __except( GetExceptionCode() == ERROR_ACCESS_VIOLATION ?
> EXCEPTION_EXECUTE_HANDLER :
> EXCEPTION_CONTINUE_SEARCH)
> {
> ...
>
> }

If you can run your process under debugger, then set it to
stop on exceptions (if it already not set). Then at a time
of exception you will be able to see call stack.