473,796 Members | 2,429 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trapping an exception in the kernel

My app. sees an exception from the kernel at an obscure address, 0x7c59ba9d.
When running under the VC++ 6.0 debugger, I can trap this each time it
occurs. If I want to trap it in my program and just tell the program to just
continue (i.e. not pass the exception up the chain) how do I do this?

Any idea how I can find out what the cause of the exception is? In the call
stack my program doesn't appear. MSCORWKS (which I think is .NET, the
framework used by the app. that calls my DLL) and KERNEL32 do.

Many thanks for any help that you can give.
Jul 21 '05 #1
12 2096
The address 0x7c59ba9d does not appear to be a kernel address.
It's a user mode address.

You have not told us which kind of exception this is:
one ACCESS_VIOLATIO N ?
a CLR Exception ?

on average, the way to "continue" the exceptio is something along these
lines.
The ExceptionFilter may be incorrect for your case,
since you have not provided enough information,
and we even don't knonw if the exception is continuable.

DWORD ExceptionFilter (LPEXCEPTION_PO INTERS ExceptionPointe rs){
CONTEXT * pContext = ExceptionPointe rs->ContextRecor d;
if (0x7c59ba9d == (ULONG_PTR)Cont ext->eip){
return EXCEPTION_CONTI NUE_EXECUTION;
} else {
return EXCEPTION_CONTI NUE_SEARCH.
}
}

Function(){
__try {
// your code here
} __except (ExceptionFilte r(GetExceptionI nformation())) {
// nothing
}
}

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in message
news:eA******** ******@TK2MSFTN GP10.phx.gbl...
My app. sees an exception from the kernel at an obscure address, 0x7c59ba9d. When running under the VC++ 6.0 debugger, I can trap this each time it
occurs. If I want to trap it in my program and just tell the program to just continue (i.e. not pass the exception up the chain) how do I do this?

Any idea how I can find out what the cause of the exception is? In the call stack my program doesn't appear. MSCORWKS (which I think is .NET, the
framework used by the app. that calls my DLL) and KERNEL32 do.

Many thanks for any help that you can give.

Jul 21 '05 #2
Sorry. My sloppy terminology -- In a call to KERNEL32. Here is the call
stack:

KERNEL32! 7c59ba9d()
MSCORWKS! 792206a8()
MSCORWKS! 7922063e()
MSCORWKS! 792205f1()
MSCORWKS! 792205d1()
MSCORWKS! 792a85fc()
MSCORWKS! 792a8ef9()
MSCORWKS! 79248678()
03f21d1e()
056ad957()
055d8422()
0474a865()
0474a5a7()
MSCORWKS! 791ece8a()
MSCORWKS! 791eb8a0()
MSCORWKS! 791f3941()
MSCORWKS! 791f38ff()
MSCORWKS! 792cc5f8()
MSCORWKS! 792cc6be()
KERNEL32! 7c57b382()

From this, it appears to be a CLR exception. Correct?

Thanks for the rest of your answer. What should I bracket with the __try()
block? My code is inside an ActiveX control that is loaded by a VB.NET
application.

Regards,

Andrew
"Ivan Brugiolo [MSFT]" <iv******@onlin e.microsoft.com > wrote in message
news:Oo******** ******@TK2MSFTN GP11.phx.gbl...
The address 0x7c59ba9d does not appear to be a kernel address.
It's a user mode address.

You have not told us which kind of exception this is:
one ACCESS_VIOLATIO N ?
a CLR Exception ?

on average, the way to "continue" the exceptio is something along these
lines.
The ExceptionFilter may be incorrect for your case,
since you have not provided enough information,
and we even don't knonw if the exception is continuable.

DWORD ExceptionFilter (LPEXCEPTION_PO INTERS ExceptionPointe rs){
CONTEXT * pContext = ExceptionPointe rs->ContextRecor d;
if (0x7c59ba9d == (ULONG_PTR)Cont ext->eip){
return EXCEPTION_CONTI NUE_EXECUTION;
} else {
return EXCEPTION_CONTI NUE_SEARCH.
}
}

Function(){
__try {
// your code here
} __except (ExceptionFilte r(GetExceptionI nformation())) {
// nothing
}
}

--
This posting is provided "AS IS" with no warranties, and confers no rights. Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in message
news:eA******** ******@TK2MSFTN GP10.phx.gbl...
My app. sees an exception from the kernel at an obscure address,

0x7c59ba9d.
When running under the VC++ 6.0 debugger, I can trap this each time it
occurs. If I want to trap it in my program and just tell the program to

just
continue (i.e. not pass the exception up the chain) how do I do this?

Any idea how I can find out what the cause of the exception is? In the

call
stack my program doesn't appear. MSCORWKS (which I think is .NET, the
framework used by the app. that calls my DLL) and KERNEL32 do.

Many thanks for any help that you can give.


Jul 21 '05 #3
If you could use a system debugger like cdb/ntsd/windbg from
http://www.microsoft.com/whdc/ddk/de...t.mspx?gssnb=1
and report the output of the '~*kb' command, that would help to see more
things.

The stack below is equvalent (as an educate guess) to a call to
kernel32!RaiseE xception.
The CLR raises C++ exception, CLR exceptin and some native exception as
well,
plus some intentional Access Violation in order to implement the
System.NullRefe renceException.

As a general suggestion, you should add this constructs in your VB.NET code,
since the approach suggested below does not look feasible in you case.

Try
' your code here
Catch E as Exception
' your cleanup code here
End Catch
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in message
news:uz******** ******@TK2MSFTN GP12.phx.gbl...
Sorry. My sloppy terminology -- In a call to KERNEL32. Here is the call
stack:

KERNEL32! 7c59ba9d()
MSCORWKS! 792206a8()
MSCORWKS! 7922063e()
MSCORWKS! 792205f1()
MSCORWKS! 792205d1()
MSCORWKS! 792a85fc()
MSCORWKS! 792a8ef9()
MSCORWKS! 79248678()
03f21d1e()
056ad957()
055d8422()
0474a865()
0474a5a7()
MSCORWKS! 791ece8a()
MSCORWKS! 791eb8a0()
MSCORWKS! 791f3941()
MSCORWKS! 791f38ff()
MSCORWKS! 792cc5f8()
MSCORWKS! 792cc6be()
KERNEL32! 7c57b382()

From this, it appears to be a CLR exception. Correct?

Thanks for the rest of your answer. What should I bracket with the __try()
block? My code is inside an ActiveX control that is loaded by a VB.NET
application.

Regards,

Andrew
"Ivan Brugiolo [MSFT]" <iv******@onlin e.microsoft.com > wrote in message
news:Oo******** ******@TK2MSFTN GP11.phx.gbl...
The address 0x7c59ba9d does not appear to be a kernel address.
It's a user mode address.

You have not told us which kind of exception this is:
one ACCESS_VIOLATIO N ?
a CLR Exception ?

on average, the way to "continue" the exceptio is something along these
lines.
The ExceptionFilter may be incorrect for your case,
since you have not provided enough information,
and we even don't knonw if the exception is continuable.

DWORD ExceptionFilter (LPEXCEPTION_PO INTERS ExceptionPointe rs){
CONTEXT * pContext = ExceptionPointe rs->ContextRecor d;
if (0x7c59ba9d == (ULONG_PTR)Cont ext->eip){
return EXCEPTION_CONTI NUE_EXECUTION;
} else {
return EXCEPTION_CONTI NUE_SEARCH.
}
}

Function(){
__try {
// your code here
} __except (ExceptionFilte r(GetExceptionI nformation())) {
// nothing
}
}

--
This posting is provided "AS IS" with no warranties, and confers no

rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in message
news:eA******** ******@TK2MSFTN GP10.phx.gbl...
My app. sees an exception from the kernel at an obscure address,

0x7c59ba9d.
When running under the VC++ 6.0 debugger, I can trap this each time it
occurs. If I want to trap it in my program and just tell the program
to just
continue (i.e. not pass the exception up the chain) how do I do this?

Any idea how I can find out what the cause of the exception is? In the

call
stack my program doesn't appear. MSCORWKS (which I think is .NET, the
framework used by the app. that calls my DLL) and KERNEL32 do.

Many thanks for any help that you can give.



Jul 21 '05 #4
Thanks. What additional information would windbg give me. I already get an
assembler listing and a call stack in VC++?

Regards
"Ivan Brugiolo [MSFT]" <iv******@onlin e.microsoft.com > wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
If you could use a system debugger like cdb/ntsd/windbg from
http://www.microsoft.com/whdc/ddk/de...t.mspx?gssnb=1
and report the output of the '~*kb' command, that would help to see more
things.

The stack below is equvalent (as an educate guess) to a call to
kernel32!RaiseE xception.
The CLR raises C++ exception, CLR exceptin and some native exception as
well,
plus some intentional Access Violation in order to implement the
System.NullRefe renceException.

As a general suggestion, you should add this constructs in your VB.NET code, since the approach suggested below does not look feasible in you case.

Try
' your code here
Catch E as Exception
' your cleanup code here
End Catch
--
This posting is provided "AS IS" with no warranties, and confers no rights. Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in message
news:uz******** ******@TK2MSFTN GP12.phx.gbl...
Sorry. My sloppy terminology -- In a call to KERNEL32. Here is the call
stack:

KERNEL32! 7c59ba9d()
MSCORWKS! 792206a8()
MSCORWKS! 7922063e()
MSCORWKS! 792205f1()
MSCORWKS! 792205d1()
MSCORWKS! 792a85fc()
MSCORWKS! 792a8ef9()
MSCORWKS! 79248678()
03f21d1e()
056ad957()
055d8422()
0474a865()
0474a5a7()
MSCORWKS! 791ece8a()
MSCORWKS! 791eb8a0()
MSCORWKS! 791f3941()
MSCORWKS! 791f38ff()
MSCORWKS! 792cc5f8()
MSCORWKS! 792cc6be()
KERNEL32! 7c57b382()

From this, it appears to be a CLR exception. Correct?

Thanks for the rest of your answer. What should I bracket with the __try()
block? My code is inside an ActiveX control that is loaded by a VB.NET
application.

Regards,

Andrew
"Ivan Brugiolo [MSFT]" <iv******@onlin e.microsoft.com > wrote in message
news:Oo******** ******@TK2MSFTN GP11.phx.gbl...
The address 0x7c59ba9d does not appear to be a kernel address.
It's a user mode address.

You have not told us which kind of exception this is:
one ACCESS_VIOLATIO N ?
a CLR Exception ?

on average, the way to "continue" the exceptio is something along these lines.
The ExceptionFilter may be incorrect for your case,
since you have not provided enough information,
and we even don't knonw if the exception is continuable.

DWORD ExceptionFilter (LPEXCEPTION_PO INTERS ExceptionPointe rs){
CONTEXT * pContext = ExceptionPointe rs->ContextRecor d;
if (0x7c59ba9d == (ULONG_PTR)Cont ext->eip){
return EXCEPTION_CONTI NUE_EXECUTION;
} else {
return EXCEPTION_CONTI NUE_SEARCH.
}
}

Function(){
__try {
// your code here
} __except (ExceptionFilte r(GetExceptionI nformation())) {
// nothing
}
}

--
This posting is provided "AS IS" with no warranties, and confers no

rights.
Use of any included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm
"Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in message
news:eA******** ******@TK2MSFTN GP10.phx.gbl...
> My app. sees an exception from the kernel at an obscure address,
0x7c59ba9d.
> When running under the VC++ 6.0 debugger, I can trap this each time it > occurs. If I want to trap it in my program and just tell the program

to just
> continue (i.e. not pass the exception up the chain) how do I do this? >
> Any idea how I can find out what the cause of the exception is? In the call
> stack my program doesn't appear. MSCORWKS (which I think is .NET, the > framework used by the app. that calls my DLL) and KERNEL32 do.
>
> Many thanks for any help that you can give.
>
>



Jul 21 '05 #5
something like the param passed to the RaiseException function,
so that I can see which exception it is and from which callstack with GOOD
SYMBOLS ?
The stack below is only good for a guess.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in message
news:O0******** ******@TK2MSFTN GP10.phx.gbl...
Thanks. What additional information would windbg give me. I already get an
assembler listing and a call stack in VC++?

Regards
"Ivan Brugiolo [MSFT]" <iv******@onlin e.microsoft.com > wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
If you could use a system debugger like cdb/ntsd/windbg from
http://www.microsoft.com/whdc/ddk/de...t.mspx?gssnb=1
and report the output of the '~*kb' command, that would help to see more
things.

The stack below is equvalent (as an educate guess) to a call to
kernel32!RaiseE xception.
The CLR raises C++ exception, CLR exceptin and some native exception as
well,
plus some intentional Access Violation in order to implement the
System.NullRefe renceException.

As a general suggestion, you should add this constructs in your VB.NET code,
since the approach suggested below does not look feasible in you case.

Try
' your code here
Catch E as Exception
' your cleanup code here
End Catch
--
This posting is provided "AS IS" with no warranties, and confers no

rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in message
news:uz******** ******@TK2MSFTN GP12.phx.gbl...
Sorry. My sloppy terminology -- In a call to KERNEL32. Here is the call stack:

KERNEL32! 7c59ba9d()
MSCORWKS! 792206a8()
MSCORWKS! 7922063e()
MSCORWKS! 792205f1()
MSCORWKS! 792205d1()
MSCORWKS! 792a85fc()
MSCORWKS! 792a8ef9()
MSCORWKS! 79248678()
03f21d1e()
056ad957()
055d8422()
0474a865()
0474a5a7()
MSCORWKS! 791ece8a()
MSCORWKS! 791eb8a0()
MSCORWKS! 791f3941()
MSCORWKS! 791f38ff()
MSCORWKS! 792cc5f8()
MSCORWKS! 792cc6be()
KERNEL32! 7c57b382()

From this, it appears to be a CLR exception. Correct?

Thanks for the rest of your answer. What should I bracket with the __try() block? My code is inside an ActiveX control that is loaded by a VB.NET
application.

Regards,

Andrew
"Ivan Brugiolo [MSFT]" <iv******@onlin e.microsoft.com > wrote in message news:Oo******** ******@TK2MSFTN GP11.phx.gbl...
> The address 0x7c59ba9d does not appear to be a kernel address.
> It's a user mode address.
>
> You have not told us which kind of exception this is:
> one ACCESS_VIOLATIO N ?
> a CLR Exception ?
>
> on average, the way to "continue" the exceptio is something along these > lines.
> The ExceptionFilter may be incorrect for your case,
> since you have not provided enough information,
> and we even don't knonw if the exception is continuable.
>
> DWORD ExceptionFilter (LPEXCEPTION_PO INTERS ExceptionPointe rs){
> CONTEXT * pContext = ExceptionPointe rs->ContextRecor d;
> if (0x7c59ba9d == (ULONG_PTR)Cont ext->eip){
> return EXCEPTION_CONTI NUE_EXECUTION;
> } else {
> return EXCEPTION_CONTI NUE_SEARCH.
> }
> }
>
> Function(){
> __try {
> // your code here
> } __except (ExceptionFilte r(GetExceptionI nformation())) {
> // nothing
> }
> }
>
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> Use of any included script samples are subject to the terms
specified at > http://www.microsoft.com/info/cpyright.htm
>
>
> "Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in message
> news:eA******** ******@TK2MSFTN GP10.phx.gbl...
> > My app. sees an exception from the kernel at an obscure address,
> 0x7c59ba9d.
> > When running under the VC++ 6.0 debugger, I can trap this each
time
it > > occurs. If I want to trap it in my program and just tell the
program
to
> just
> > continue (i.e. not pass the exception up the chain) how do I do

this? > >
> > Any idea how I can find out what the cause of the exception is? In the > call
> > stack my program doesn't appear. MSCORWKS (which I think is .NET, the > > framework used by the app. that calls my DLL) and KERNEL32 do.
> >
> > Many thanks for any help that you can give.
> >
> >
>
>



Jul 21 '05 #6
So windbg shows symbols?
"Ivan Brugiolo [MSFT]" <iv******@onlin e.microsoft.com > wrote in message
news:O%******** ********@TK2MSF TNGP11.phx.gbl. ..
something like the param passed to the RaiseException function,
so that I can see which exception it is and from which callstack with GOOD
SYMBOLS ?
The stack below is only good for a guess.

--
This posting is provided "AS IS" with no warranties, and confers no rights. Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in message
news:O0******** ******@TK2MSFTN GP10.phx.gbl...
Thanks. What additional information would windbg give me. I already get an
assembler listing and a call stack in VC++?

Regards
"Ivan Brugiolo [MSFT]" <iv******@onlin e.microsoft.com > wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
If you could use a system debugger like cdb/ntsd/windbg from
http://www.microsoft.com/whdc/ddk/de...t.mspx?gssnb=1
and report the output of the '~*kb' command, that would help to see more things.

The stack below is equvalent (as an educate guess) to a call to
kernel32!RaiseE xception.
The CLR raises C++ exception, CLR exceptin and some native exception as well,
plus some intentional Access Violation in order to implement the
System.NullRefe renceException.

As a general suggestion, you should add this constructs in your VB.NET

code,
since the approach suggested below does not look feasible in you case.

Try
' your code here
Catch E as Exception
' your cleanup code here
End Catch
--
This posting is provided "AS IS" with no warranties, and confers no

rights.
Use of any included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm
"Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in message
news:uz******** ******@TK2MSFTN GP12.phx.gbl...
> Sorry. My sloppy terminology -- In a call to KERNEL32. Here is the call > stack:
>
> KERNEL32! 7c59ba9d()
> MSCORWKS! 792206a8()
> MSCORWKS! 7922063e()
> MSCORWKS! 792205f1()
> MSCORWKS! 792205d1()
> MSCORWKS! 792a85fc()
> MSCORWKS! 792a8ef9()
> MSCORWKS! 79248678()
> 03f21d1e()
> 056ad957()
> 055d8422()
> 0474a865()
> 0474a5a7()
> MSCORWKS! 791ece8a()
> MSCORWKS! 791eb8a0()
> MSCORWKS! 791f3941()
> MSCORWKS! 791f38ff()
> MSCORWKS! 792cc5f8()
> MSCORWKS! 792cc6be()
> KERNEL32! 7c57b382()
>
> From this, it appears to be a CLR exception. Correct?
>
> Thanks for the rest of your answer. What should I bracket with the

__try()
> block? My code is inside an ActiveX control that is loaded by a VB.NET > application.
>
> Regards,
>
> Andrew
>
>
> "Ivan Brugiolo [MSFT]" <iv******@onlin e.microsoft.com > wrote in message > news:Oo******** ******@TK2MSFTN GP11.phx.gbl...
> > The address 0x7c59ba9d does not appear to be a kernel address.
> > It's a user mode address.
> >
> > You have not told us which kind of exception this is:
> > one ACCESS_VIOLATIO N ?
> > a CLR Exception ?
> >
> > on average, the way to "continue" the exceptio is something along

these
> > lines.
> > The ExceptionFilter may be incorrect for your case,
> > since you have not provided enough information,
> > and we even don't knonw if the exception is continuable.
> >
> > DWORD ExceptionFilter (LPEXCEPTION_PO INTERS ExceptionPointe rs){
> > CONTEXT * pContext = ExceptionPointe rs->ContextRecor d;
> > if (0x7c59ba9d == (ULONG_PTR)Cont ext->eip){
> > return EXCEPTION_CONTI NUE_EXECUTION;
> > } else {
> > return EXCEPTION_CONTI NUE_SEARCH.
> > }
> > }
> >
> > Function(){
> > __try {
> > // your code here
> > } __except (ExceptionFilte r(GetExceptionI nformation())) {
> > // nothing
> > }
> > }
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no > rights.
> > Use of any included script samples are subject to the terms specified
at
> > http://www.microsoft.com/info/cpyright.htm
> >
> >
> > "Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in message
> > news:eA******** ******@TK2MSFTN GP10.phx.gbl...
> > > My app. sees an exception from the kernel at an obscure address,
> > 0x7c59ba9d.
> > > When running under the VC++ 6.0 debugger, I can trap this each

time
it
> > > occurs. If I want to trap it in my program and just tell the

program to
> > just
> > > continue (i.e. not pass the exception up the chain) how do I do

this?
> > >
> > > Any idea how I can find out what the cause of the exception is?

In the
> > call
> > > stack my program doesn't appear. MSCORWKS (which I think is
..NET, the
> > > framework used by the app. that calls my DLL) and KERNEL32 do.
> > >
> > > Many thanks for any help that you can give.
> > >
> > >
> >
> >
>
>



Jul 21 '05 #7
If you point it to the public symbol server, it will give a pretty decent
stack trace.
Follow the instruction on the page I pointed you out, and report the output
of `~*kb'.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in message
news:Oj******** ******@tk2msftn gp13.phx.gbl...
So windbg shows symbols?
"Ivan Brugiolo [MSFT]" <iv******@onlin e.microsoft.com > wrote in message
news:O%******** ********@TK2MSF TNGP11.phx.gbl. ..
something like the param passed to the RaiseException function,
so that I can see which exception it is and from which callstack with GOOD
SYMBOLS ?
The stack below is only good for a guess.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in message
news:O0******** ******@TK2MSFTN GP10.phx.gbl...
Thanks. What additional information would windbg give me. I already get an assembler listing and a call stack in VC++?

Regards
"Ivan Brugiolo [MSFT]" <iv******@onlin e.microsoft.com > wrote in
message news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
> If you could use a system debugger like cdb/ntsd/windbg from
> http://www.microsoft.com/whdc/ddk/de...t.mspx?gssnb=1
> and report the output of the '~*kb' command, that would help to see
more > things.
>
> The stack below is equvalent (as an educate guess) to a call to
> kernel32!RaiseE xception.
> The CLR raises C++ exception, CLR exceptin and some native exception as > well,
> plus some intentional Access Violation in order to implement the
> System.NullRefe renceException.
>
> As a general suggestion, you should add this constructs in your VB.NET code,
> since the approach suggested below does not look feasible in you case. >
> Try
> ' your code here
> Catch E as Exception
> ' your cleanup code here
> End Catch
>
>
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> Use of any included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
>
>
> "Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in message
> news:uz******** ******@TK2MSFTN GP12.phx.gbl...
> > Sorry. My sloppy terminology -- In a call to KERNEL32. Here is the call
> > stack:
> >
> > KERNEL32! 7c59ba9d()
> > MSCORWKS! 792206a8()
> > MSCORWKS! 7922063e()
> > MSCORWKS! 792205f1()
> > MSCORWKS! 792205d1()
> > MSCORWKS! 792a85fc()
> > MSCORWKS! 792a8ef9()
> > MSCORWKS! 79248678()
> > 03f21d1e()
> > 056ad957()
> > 055d8422()
> > 0474a865()
> > 0474a5a7()
> > MSCORWKS! 791ece8a()
> > MSCORWKS! 791eb8a0()
> > MSCORWKS! 791f3941()
> > MSCORWKS! 791f38ff()
> > MSCORWKS! 792cc5f8()
> > MSCORWKS! 792cc6be()
> > KERNEL32! 7c57b382()
> >
> > From this, it appears to be a CLR exception. Correct?
> >
> > Thanks for the rest of your answer. What should I bracket with the
__try()
> > block? My code is inside an ActiveX control that is loaded by a VB.NET > > application.
> >
> > Regards,
> >
> > Andrew
> >
> >
> > "Ivan Brugiolo [MSFT]" <iv******@onlin e.microsoft.com > wrote in

message
> > news:Oo******** ******@TK2MSFTN GP11.phx.gbl...
> > > The address 0x7c59ba9d does not appear to be a kernel address.
> > > It's a user mode address.
> > >
> > > You have not told us which kind of exception this is:
> > > one ACCESS_VIOLATIO N ?
> > > a CLR Exception ?
> > >
> > > on average, the way to "continue" the exceptio is something
along these
> > > lines.
> > > The ExceptionFilter may be incorrect for your case,
> > > since you have not provided enough information,
> > > and we even don't knonw if the exception is continuable.
> > >
> > > DWORD ExceptionFilter (LPEXCEPTION_PO INTERS ExceptionPointe rs){
> > > CONTEXT * pContext = ExceptionPointe rs->ContextRecor d;
> > > if (0x7c59ba9d == (ULONG_PTR)Cont ext->eip){
> > > return EXCEPTION_CONTI NUE_EXECUTION;
> > > } else {
> > > return EXCEPTION_CONTI NUE_SEARCH.
> > > }
> > > }
> > >
> > > Function(){
> > > __try {
> > > // your code here
> > > } __except (ExceptionFilte r(GetExceptionI nformation())) {
> > > // nothing
> > > }
> > > }
> > >
> > > --
> > > This posting is provided "AS IS" with no warranties, and confers

no > > rights.
> > > Use of any included script samples are subject to the terms

specified
at
> > > http://www.microsoft.com/info/cpyright.htm
> > >
> > >
> > > "Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in message > > > news:eA******** ******@TK2MSFTN GP10.phx.gbl...
> > > > My app. sees an exception from the kernel at an obscure address, > > > 0x7c59ba9d.
> > > > When running under the VC++ 6.0 debugger, I can trap this each

time
it
> > > > occurs. If I want to trap it in my program and just tell the

program
> to
> > > just
> > > > continue (i.e. not pass the exception up the chain) how do I do this?
> > > >
> > > > Any idea how I can find out what the cause of the exception
is? In the
> > > call
> > > > stack my program doesn't appear. MSCORWKS (which I think is .NET, the
> > > > framework used by the app. that calls my DLL) and KERNEL32 do.
> > > >
> > > > Many thanks for any help that you can give.
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Jul 21 '05 #8
Thanks. I've d/l the debugger and am testing now.

Regards

"Ivan Brugiolo [MSFT]" <iv******@onlin e.microsoft.com > wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
If you point it to the public symbol server, it will give a pretty decent
stack trace.
Follow the instruction on the page I pointed you out, and report the output of `~*kb'.

--
This posting is provided "AS IS" with no warranties, and confers no rights. Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in message
news:Oj******** ******@tk2msftn gp13.phx.gbl...
So windbg shows symbols?
"Ivan Brugiolo [MSFT]" <iv******@onlin e.microsoft.com > wrote in message
news:O%******** ********@TK2MSF TNGP11.phx.gbl. ..
something like the param passed to the RaiseException function,
so that I can see which exception it is and from which callstack with GOOD SYMBOLS ?
The stack below is only good for a guess.

--
This posting is provided "AS IS" with no warranties, and confers no

rights.
Use of any included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm
"Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in message
news:O0******** ******@TK2MSFTN GP10.phx.gbl...
> Thanks. What additional information would windbg give me. I already get
an
> assembler listing and a call stack in VC++?
>
> Regards
> "Ivan Brugiolo [MSFT]" <iv******@onlin e.microsoft.com > wrote in message > news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
> > If you could use a system debugger like cdb/ntsd/windbg from
> > http://www.microsoft.com/whdc/ddk/de...t.mspx?gssnb=1
> > and report the output of the '~*kb' command, that would help to see more
> > things.
> >
> > The stack below is equvalent (as an educate guess) to a call to
> > kernel32!RaiseE xception.
> > The CLR raises C++ exception, CLR exceptin and some native
exception
as
> > well,
> > plus some intentional Access Violation in order to implement the
> > System.NullRefe renceException.
> >
> > As a general suggestion, you should add this constructs in your VB.NET > code,
> > since the approach suggested below does not look feasible in you case. > >
> > Try
> > ' your code here
> > Catch E as Exception
> > ' your cleanup code here
> > End Catch
> >
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers
no > rights.
> > Use of any included script samples are subject to the terms

specified
at
> > http://www.microsoft.com/info/cpyright.htm
> >
> >
> > "Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in message
> > news:uz******** ******@TK2MSFTN GP12.phx.gbl...
> > > Sorry. My sloppy terminology -- In a call to KERNEL32. Here is the call
> > > stack:
> > >
> > > KERNEL32! 7c59ba9d()
> > > MSCORWKS! 792206a8()
> > > MSCORWKS! 7922063e()
> > > MSCORWKS! 792205f1()
> > > MSCORWKS! 792205d1()
> > > MSCORWKS! 792a85fc()
> > > MSCORWKS! 792a8ef9()
> > > MSCORWKS! 79248678()
> > > 03f21d1e()
> > > 056ad957()
> > > 055d8422()
> > > 0474a865()
> > > 0474a5a7()
> > > MSCORWKS! 791ece8a()
> > > MSCORWKS! 791eb8a0()
> > > MSCORWKS! 791f3941()
> > > MSCORWKS! 791f38ff()
> > > MSCORWKS! 792cc5f8()
> > > MSCORWKS! 792cc6be()
> > > KERNEL32! 7c57b382()
> > >
> > > From this, it appears to be a CLR exception. Correct?
> > >
> > > Thanks for the rest of your answer. What should I bracket with the > __try()
> > > block? My code is inside an ActiveX control that is loaded by a

VB.NET
> > > application.
> > >
> > > Regards,
> > >
> > > Andrew
> > >
> > >
> > > "Ivan Brugiolo [MSFT]" <iv******@onlin e.microsoft.com > wrote in
message
> > > news:Oo******** ******@TK2MSFTN GP11.phx.gbl...
> > > > The address 0x7c59ba9d does not appear to be a kernel address.
> > > > It's a user mode address.
> > > >
> > > > You have not told us which kind of exception this is:
> > > > one ACCESS_VIOLATIO N ?
> > > > a CLR Exception ?
> > > >
> > > > on average, the way to "continue" the exceptio is something

along > these
> > > > lines.
> > > > The ExceptionFilter may be incorrect for your case,
> > > > since you have not provided enough information,
> > > > and we even don't knonw if the exception is continuable.
> > > >
> > > > DWORD ExceptionFilter (LPEXCEPTION_PO INTERS ExceptionPointe rs){
> > > > CONTEXT * pContext = ExceptionPointe rs->ContextRecor d;
> > > > if (0x7c59ba9d == (ULONG_PTR)Cont ext->eip){
> > > > return EXCEPTION_CONTI NUE_EXECUTION;
> > > > } else {
> > > > return EXCEPTION_CONTI NUE_SEARCH.
> > > > }
> > > > }
> > > >
> > > > Function(){
> > > > __try {
> > > > // your code here
> > > > } __except (ExceptionFilte r(GetExceptionI nformation())) {
> > > > // nothing
> > > > }
> > > > }
> > > >
> > > > --
> > > > This posting is provided "AS IS" with no warranties, and confers no
> > > rights.
> > > > Use of any included script samples are subject to the terms
specified
> at
> > > > http://www.microsoft.com/info/cpyright.htm
> > > >
> > > >
> > > > "Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in message > > > > news:eA******** ******@TK2MSFTN GP10.phx.gbl...
> > > > > My app. sees an exception from the kernel at an obscure address, > > > > 0x7c59ba9d.
> > > > > When running under the VC++ 6.0 debugger, I can trap this
each time
> it
> > > > > occurs. If I want to trap it in my program and just tell the
program
> > to
> > > > just
> > > > > continue (i.e. not pass the exception up the chain) how do I

do > this?
> > > > >
> > > > > Any idea how I can find out what the cause of the exception

is?
In
> the
> > > > call
> > > > > stack my program doesn't appear. MSCORWKS (which I think is

.NET,
> the
> > > > > framework used by the app. that calls my DLL) and KERNEL32 do. > > > > >
> > > > > Many thanks for any help that you can give.
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Jul 21 '05 #9
I ran my executable from the WinDbg File->Open Executable menu and when the
first chance exception that I am looking for occurred, execution did not
halt. Any idea what I am doing wrong?

Regards,

Andrew
"Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in message
news:eY******** ******@tk2msftn gp13.phx.gbl...
Thanks. I've d/l the debugger and am testing now.

Regards

"Ivan Brugiolo [MSFT]" <iv******@onlin e.microsoft.com > wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
If you point it to the public symbol server, it will give a pretty decent
stack trace.
Follow the instruction on the page I pointed you out, and report the output
of `~*kb'.

--
This posting is provided "AS IS" with no warranties, and confers no

rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in message
news:Oj******** ******@tk2msftn gp13.phx.gbl...
So windbg shows symbols?
"Ivan Brugiolo [MSFT]" <iv******@onlin e.microsoft.com > wrote in message news:O%******** ********@TK2MSF TNGP11.phx.gbl. ..
> something like the param passed to the RaiseException function,
> so that I can see which exception it is and from which callstack with
GOOD
> SYMBOLS ?
> The stack below is only good for a guess.
>
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> Use of any included script samples are subject to the terms
specified at > http://www.microsoft.com/info/cpyright.htm
>
>
> "Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in message
> news:O0******** ******@TK2MSFTN GP10.phx.gbl...
> > Thanks. What additional information would windbg give me. I
already get
an
> > assembler listing and a call stack in VC++?
> >
> > Regards
> > "Ivan Brugiolo [MSFT]" <iv******@onlin e.microsoft.com > wrote in

message
> > news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
> > > If you could use a system debugger like cdb/ntsd/windbg from
> > > http://www.microsoft.com/whdc/ddk/de...t.mspx?gssnb=1
> > > and report the output of the '~*kb' command, that would help to see more
> > > things.
> > >
> > > The stack below is equvalent (as an educate guess) to a call to
> > > kernel32!RaiseE xception.
> > > The CLR raises C++ exception, CLR exceptin and some native exception as
> > > well,
> > > plus some intentional Access Violation in order to implement the
> > > System.NullRefe renceException.
> > >
> > > As a general suggestion, you should add this constructs in your

VB.NET
> > code,
> > > since the approach suggested below does not look feasible in you

case.
> > >
> > > Try
> > > ' your code here
> > > Catch E as Exception
> > > ' your cleanup code here
> > > End Catch
> > >
> > >
> > > --
> > > This posting is provided "AS IS" with no warranties, and confers no > > rights.
> > > Use of any included script samples are subject to the terms

specified
at
> > > http://www.microsoft.com/info/cpyright.htm
> > >
> > >
> > > "Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in
message > > > news:uz******** ******@TK2MSFTN GP12.phx.gbl...
> > > > Sorry. My sloppy terminology -- In a call to KERNEL32. Here is

the > call
> > > > stack:
> > > >
> > > > KERNEL32! 7c59ba9d()
> > > > MSCORWKS! 792206a8()
> > > > MSCORWKS! 7922063e()
> > > > MSCORWKS! 792205f1()
> > > > MSCORWKS! 792205d1()
> > > > MSCORWKS! 792a85fc()
> > > > MSCORWKS! 792a8ef9()
> > > > MSCORWKS! 79248678()
> > > > 03f21d1e()
> > > > 056ad957()
> > > > 055d8422()
> > > > 0474a865()
> > > > 0474a5a7()
> > > > MSCORWKS! 791ece8a()
> > > > MSCORWKS! 791eb8a0()
> > > > MSCORWKS! 791f3941()
> > > > MSCORWKS! 791f38ff()
> > > > MSCORWKS! 792cc5f8()
> > > > MSCORWKS! 792cc6be()
> > > > KERNEL32! 7c57b382()
> > > >
> > > > From this, it appears to be a CLR exception. Correct?
> > > >
> > > > Thanks for the rest of your answer. What should I bracket with the > > __try()
> > > > block? My code is inside an ActiveX control that is loaded by a VB.NET
> > > > application.
> > > >
> > > > Regards,
> > > >
> > > > Andrew
> > > >
> > > >
> > > > "Ivan Brugiolo [MSFT]" <iv******@onlin e.microsoft.com > wrote in > message
> > > > news:Oo******** ******@TK2MSFTN GP11.phx.gbl...
> > > > > The address 0x7c59ba9d does not appear to be a kernel address. > > > > > It's a user mode address.
> > > > >
> > > > > You have not told us which kind of exception this is:
> > > > > one ACCESS_VIOLATIO N ?
> > > > > a CLR Exception ?
> > > > >
> > > > > on average, the way to "continue" the exceptio is something

along
> > these
> > > > > lines.
> > > > > The ExceptionFilter may be incorrect for your case,
> > > > > since you have not provided enough information,
> > > > > and we even don't knonw if the exception is continuable.
> > > > >
> > > > > DWORD ExceptionFilter (LPEXCEPTION_PO INTERS ExceptionPointe rs){ > > > > > CONTEXT * pContext = ExceptionPointe rs->ContextRecor d;
> > > > > if (0x7c59ba9d == (ULONG_PTR)Cont ext->eip){
> > > > > return EXCEPTION_CONTI NUE_EXECUTION;
> > > > > } else {
> > > > > return EXCEPTION_CONTI NUE_SEARCH.
> > > > > }
> > > > > }
> > > > >
> > > > > Function(){
> > > > > __try {
> > > > > // your code here
> > > > > } __except (ExceptionFilte r(GetExceptionI nformation())) { > > > > > // nothing
> > > > > }
> > > > > }
> > > > >
> > > > > --
> > > > > This posting is provided "AS IS" with no warranties, and confers no
> > > > rights.
> > > > > Use of any included script samples are subject to the terms
> specified
> > at
> > > > > http://www.microsoft.com/info/cpyright.htm
> > > > >
> > > > >
> > > > > "Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote in

message
> > > > > news:eA******** ******@TK2MSFTN GP10.phx.gbl...
> > > > > > My app. sees an exception from the kernel at an obscure

address,
> > > > > 0x7c59ba9d.
> > > > > > When running under the VC++ 6.0 debugger, I can trap this each > time
> > it
> > > > > > occurs. If I want to trap it in my program and just tell the > program
> > > to
> > > > > just
> > > > > > continue (i.e. not pass the exception up the chain) how do I do
> > this?
> > > > > >
> > > > > > Any idea how I can find out what the cause of the
exception
is?
In
> > the
> > > > > call
> > > > > > stack my program doesn't appear. MSCORWKS (which I think

is .NET,
> > the
> > > > > > framework used by the app. that calls my DLL) and KERNEL32

do. > > > > > >
> > > > > > Many thanks for any help that you can give.
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Jul 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
2202
by: KKramsch | last post by:
One of the features from other languages that I miss most in C is trappable exceptions. More specifically, I think it's great to be able to demarcate a whole block of code where several exceptions can happen at various points, so that any one of these exceptions can be trapped and handled by the exception-handling code collected in one place after the block. This also means that the exception generating code can be much cleaner, since...
4
985
by: Anirudha Vengurlekar | last post by:
Hello Community, We can have nested TRY , CATCH , FINALLY blocks in the application. So in what situation (in a class or in a function) I would use this nested Try catch blocks? If someone would help me then it would be great. ( I know why we use the Try catch etc., but I am looking in what scenario someone can use nested Try catch for better exception handling )
6
1484
by: SMG | last post by:
Hi , Sory for incomplete message in last post here is the actual problem.. I am using following code in web.confiig for trapping all the error through out my site.. <customErrors mode="On" defaultRedirect="WebForm1.aspx"> <error statusCode="404" redirect="ServerError.aspx"></error> <error statusCode="500" redirect="WebForm3.aspx"></error>
12
358
by: Andrew Chalk | last post by:
My app. sees an exception from the kernel at an obscure address, 0x7c59ba9d. When running under the VC++ 6.0 debugger, I can trap this each time it occurs. If I want to trap it in my program and just tell the program to just continue (i.e. not pass the exception up the chain) how do I do this? Any idea how I can find out what the cause of the exception is? In the call stack my program doesn't appear. MSCORWKS (which I think is .NET, the...
2
2597
by: pedrito | last post by:
I've got an app that downloads from several concurrent threads. Occasionally, I get an expcetion trying to read the HttpWebResponse stream... Sorry, the code isn't short, but I figured best to provide the whole method. This is run within its own thread. "Job" is a class that receives the information about the downloaded pages. The exception happens on the read where it says "EXCEPTION HERE"
5
1483
by: Yash | last post by:
Hi, I have create a user control which has a dropdown. The user control internaly handles the Selected_Index_Changed event of the dropdown. If there is an error/exception in handling it, I would like the containing page to know of it. How can I make this possible? The containing page does not know of the dropdown. Thanks, Yash
0
9680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9528
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5442
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5575
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.