473,320 Members | 1,612 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 2036
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_VIOLATION ?
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_POINTERS ExceptionPointers){
CONTEXT * pContext = ExceptionPointers->ContextRecord;
if (0x7c59ba9d == (ULONG_PTR)Context->eip){
return EXCEPTION_CONTINUE_EXECUTION;
} else {
return EXCEPTION_CONTINUE_SEARCH.
}
}

Function(){
__try {
// your code here
} __except (ExceptionFilter(GetExceptionInformation())) {
// 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****@XXXmagnacartasoftware.com> wrote in message
news:eA**************@TK2MSFTNGP10.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******@online.microsoft.com> wrote in message
news:Oo**************@TK2MSFTNGP11.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_VIOLATION ?
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_POINTERS ExceptionPointers){
CONTEXT * pContext = ExceptionPointers->ContextRecord;
if (0x7c59ba9d == (ULONG_PTR)Context->eip){
return EXCEPTION_CONTINUE_EXECUTION;
} else {
return EXCEPTION_CONTINUE_SEARCH.
}
}

Function(){
__try {
// your code here
} __except (ExceptionFilter(GetExceptionInformation())) {
// 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****@XXXmagnacartasoftware.com> wrote in message
news:eA**************@TK2MSFTNGP10.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!RaiseException.
The CLR raises C++ exception, CLR exceptin and some native exception as
well,
plus some intentional Access Violation in order to implement the
System.NullReferenceException.

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****@XXXmagnacartasoftware.com> wrote in message
news:uz**************@TK2MSFTNGP12.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******@online.microsoft.com> wrote in message
news:Oo**************@TK2MSFTNGP11.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_VIOLATION ?
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_POINTERS ExceptionPointers){
CONTEXT * pContext = ExceptionPointers->ContextRecord;
if (0x7c59ba9d == (ULONG_PTR)Context->eip){
return EXCEPTION_CONTINUE_EXECUTION;
} else {
return EXCEPTION_CONTINUE_SEARCH.
}
}

Function(){
__try {
// your code here
} __except (ExceptionFilter(GetExceptionInformation())) {
// 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****@XXXmagnacartasoftware.com> wrote in message
news:eA**************@TK2MSFTNGP10.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******@online.microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP09.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!RaiseException.
The CLR raises C++ exception, CLR exceptin and some native exception as
well,
plus some intentional Access Violation in order to implement the
System.NullReferenceException.

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****@XXXmagnacartasoftware.com> wrote in message
news:uz**************@TK2MSFTNGP12.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******@online.microsoft.com> wrote in message
news:Oo**************@TK2MSFTNGP11.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_VIOLATION ?
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_POINTERS ExceptionPointers){
CONTEXT * pContext = ExceptionPointers->ContextRecord;
if (0x7c59ba9d == (ULONG_PTR)Context->eip){
return EXCEPTION_CONTINUE_EXECUTION;
} else {
return EXCEPTION_CONTINUE_SEARCH.
}
}

Function(){
__try {
// your code here
} __except (ExceptionFilter(GetExceptionInformation())) {
// 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****@XXXmagnacartasoftware.com> wrote in message
news:eA**************@TK2MSFTNGP10.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****@XXXmagnacartasoftware.com> wrote in message
news:O0**************@TK2MSFTNGP10.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******@online.microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP09.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!RaiseException.
The CLR raises C++ exception, CLR exceptin and some native exception as
well,
plus some intentional Access Violation in order to implement the
System.NullReferenceException.

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****@XXXmagnacartasoftware.com> wrote in message
news:uz**************@TK2MSFTNGP12.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******@online.microsoft.com> wrote in message news:Oo**************@TK2MSFTNGP11.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_VIOLATION ?
> 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_POINTERS ExceptionPointers){
> CONTEXT * pContext = ExceptionPointers->ContextRecord;
> if (0x7c59ba9d == (ULONG_PTR)Context->eip){
> return EXCEPTION_CONTINUE_EXECUTION;
> } else {
> return EXCEPTION_CONTINUE_SEARCH.
> }
> }
>
> Function(){
> __try {
> // your code here
> } __except (ExceptionFilter(GetExceptionInformation())) {
> // 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****@XXXmagnacartasoftware.com> wrote in message
> news:eA**************@TK2MSFTNGP10.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******@online.microsoft.com> wrote in message
news:O%****************@TK2MSFTNGP11.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****@XXXmagnacartasoftware.com> wrote in message
news:O0**************@TK2MSFTNGP10.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******@online.microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP09.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!RaiseException.
The CLR raises C++ exception, CLR exceptin and some native exception as well,
plus some intentional Access Violation in order to implement the
System.NullReferenceException.

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****@XXXmagnacartasoftware.com> wrote in message
news:uz**************@TK2MSFTNGP12.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******@online.microsoft.com> wrote in message > news:Oo**************@TK2MSFTNGP11.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_VIOLATION ?
> > 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_POINTERS ExceptionPointers){
> > CONTEXT * pContext = ExceptionPointers->ContextRecord;
> > if (0x7c59ba9d == (ULONG_PTR)Context->eip){
> > return EXCEPTION_CONTINUE_EXECUTION;
> > } else {
> > return EXCEPTION_CONTINUE_SEARCH.
> > }
> > }
> >
> > Function(){
> > __try {
> > // your code here
> > } __except (ExceptionFilter(GetExceptionInformation())) {
> > // 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****@XXXmagnacartasoftware.com> wrote in message
> > news:eA**************@TK2MSFTNGP10.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****@XXXmagnacartasoftware.com> wrote in message
news:Oj**************@tk2msftngp13.phx.gbl...
So windbg shows symbols?
"Ivan Brugiolo [MSFT]" <iv******@online.microsoft.com> wrote in message
news:O%****************@TK2MSFTNGP11.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****@XXXmagnacartasoftware.com> wrote in message
news:O0**************@TK2MSFTNGP10.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******@online.microsoft.com> wrote in
message news:%2****************@TK2MSFTNGP09.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!RaiseException.
> The CLR raises C++ exception, CLR exceptin and some native exception as > well,
> plus some intentional Access Violation in order to implement the
> System.NullReferenceException.
>
> 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****@XXXmagnacartasoftware.com> wrote in message
> news:uz**************@TK2MSFTNGP12.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******@online.microsoft.com> wrote in

message
> > news:Oo**************@TK2MSFTNGP11.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_VIOLATION ?
> > > 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_POINTERS ExceptionPointers){
> > > CONTEXT * pContext = ExceptionPointers->ContextRecord;
> > > if (0x7c59ba9d == (ULONG_PTR)Context->eip){
> > > return EXCEPTION_CONTINUE_EXECUTION;
> > > } else {
> > > return EXCEPTION_CONTINUE_SEARCH.
> > > }
> > > }
> > >
> > > Function(){
> > > __try {
> > > // your code here
> > > } __except (ExceptionFilter(GetExceptionInformation())) {
> > > // 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****@XXXmagnacartasoftware.com> wrote in message > > > news:eA**************@TK2MSFTNGP10.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******@online.microsoft.com> wrote in message
news:%2****************@tk2msftngp13.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****@XXXmagnacartasoftware.com> wrote in message
news:Oj**************@tk2msftngp13.phx.gbl...
So windbg shows symbols?
"Ivan Brugiolo [MSFT]" <iv******@online.microsoft.com> wrote in message
news:O%****************@TK2MSFTNGP11.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****@XXXmagnacartasoftware.com> wrote in message
news:O0**************@TK2MSFTNGP10.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******@online.microsoft.com> wrote in message > news:%2****************@TK2MSFTNGP09.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!RaiseException.
> > The CLR raises C++ exception, CLR exceptin and some native
exception
as
> > well,
> > plus some intentional Access Violation in order to implement the
> > System.NullReferenceException.
> >
> > 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****@XXXmagnacartasoftware.com> wrote in message
> > news:uz**************@TK2MSFTNGP12.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******@online.microsoft.com> wrote in
message
> > > news:Oo**************@TK2MSFTNGP11.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_VIOLATION ?
> > > > 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_POINTERS ExceptionPointers){
> > > > CONTEXT * pContext = ExceptionPointers->ContextRecord;
> > > > if (0x7c59ba9d == (ULONG_PTR)Context->eip){
> > > > return EXCEPTION_CONTINUE_EXECUTION;
> > > > } else {
> > > > return EXCEPTION_CONTINUE_SEARCH.
> > > > }
> > > > }
> > > >
> > > > Function(){
> > > > __try {
> > > > // your code here
> > > > } __except (ExceptionFilter(GetExceptionInformation())) {
> > > > // 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****@XXXmagnacartasoftware.com> wrote in message > > > > news:eA**************@TK2MSFTNGP10.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****@XXXmagnacartasoftware.com> wrote in message
news:eY**************@tk2msftngp13.phx.gbl...
Thanks. I've d/l the debugger and am testing now.

Regards

"Ivan Brugiolo [MSFT]" <iv******@online.microsoft.com> wrote in message
news:%2****************@tk2msftngp13.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****@XXXmagnacartasoftware.com> wrote in message
news:Oj**************@tk2msftngp13.phx.gbl...
So windbg shows symbols?
"Ivan Brugiolo [MSFT]" <iv******@online.microsoft.com> wrote in message news:O%****************@TK2MSFTNGP11.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****@XXXmagnacartasoftware.com> wrote in message
> news:O0**************@TK2MSFTNGP10.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******@online.microsoft.com> wrote in

message
> > news:%2****************@TK2MSFTNGP09.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!RaiseException.
> > > The CLR raises C++ exception, CLR exceptin and some native exception as
> > > well,
> > > plus some intentional Access Violation in order to implement the
> > > System.NullReferenceException.
> > >
> > > 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****@XXXmagnacartasoftware.com> wrote in
message > > > news:uz**************@TK2MSFTNGP12.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******@online.microsoft.com> wrote in > message
> > > > news:Oo**************@TK2MSFTNGP11.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_VIOLATION ?
> > > > > 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_POINTERS ExceptionPointers){ > > > > > CONTEXT * pContext = ExceptionPointers->ContextRecord;
> > > > > if (0x7c59ba9d == (ULONG_PTR)Context->eip){
> > > > > return EXCEPTION_CONTINUE_EXECUTION;
> > > > > } else {
> > > > > return EXCEPTION_CONTINUE_SEARCH.
> > > > > }
> > > > > }
> > > > >
> > > > > Function(){
> > > > > __try {
> > > > > // your code here
> > > > > } __except (ExceptionFilter(GetExceptionInformation())) { > > > > > // 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****@XXXmagnacartasoftware.com> wrote in

message
> > > > > news:eA**************@TK2MSFTNGP10.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
"Andrew Chalk" wrote:
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?


To enable 1st chance break on specific exceptions, do 'sxe <exception
code>'.

If you are interested in .NET exceptions, you can also do 'sxe clr'.
Jul 21 '05 #11
Thanks. I'll try this.

"Pavel Lebedinsky" <m_pll ./. hotmail ./. com> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
"Andrew Chalk" wrote:
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?


To enable 1st chance break on specific exceptions, do 'sxe <exception
code>'.

If you are interested in .NET exceptions, you can also do 'sxe clr'.

Jul 21 '05 #12
Many thanks to yourself and Ivan. I eventually trapped the error.

Regards
"Pavel Lebedinsky" <m_pll ./. hotmail ./. com> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
"Andrew Chalk" wrote:
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?


To enable 1st chance break on specific exceptions, do 'sxe <exception
code>'.

If you are interested in .NET exceptions, you can also do 'sxe clr'.

Jul 21 '05 #13

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

Similar topics

19
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...
4
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...
6
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"...
12
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...
2
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...
5
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.