PhilTen
2008-10-22 14:14:17 UTC
I ported to VS2008 an C++ application (a win32 service) previously build with
VS2003 and running successfully for years.
When I ported my source code I changed all legacy CRT calls to secure CRT
(xxxx_s) calls
Now, my application just abort at some point I can't locate.
I mention it is a server application running many threads, it has
no user interface which could provide helpful information on what
it is doing at one point.
All my code is surrounded by exceptions sections but it has no effect,
obvioulsy the problem is not catched by an exception handler.
I made some research and understood that the secure CRT would just abort
the application if it detect problems, in particular for invalid parameters.
I guess this is what is happening.
My problem now is to locate where in the source code the failure occurs.
When I check the address reported by DR. Watson it points a to generic
function and is helpless.
I found information about "_set_invalid_parameter_handler" to try to
workaround
the problem. It seem that if I use my own invalid parameter handler I can
hide the symptom,
but since with release builds it does not provide the file,line and
expression informations,
it's useless to locate the problem.
In a similar case, With my VS2003 project, I could always locate the problem
in the
source code thanks to structured exceptions, with VS2008 I can't.
I guess I must somehow get the execution stack frame of the thread
when the problem occurs and search the map to locate the calling
faulty function ?
Is this the right way to proceed ?
If yes, can I get the execution stack at failure ?
Is there any other way to locate the problem ?
Thank you idvance for help help.
ps: By the way, why Secure CRT does not uses exceptions ?
VS2003 and running successfully for years.
When I ported my source code I changed all legacy CRT calls to secure CRT
(xxxx_s) calls
Now, my application just abort at some point I can't locate.
I mention it is a server application running many threads, it has
no user interface which could provide helpful information on what
it is doing at one point.
All my code is surrounded by exceptions sections but it has no effect,
obvioulsy the problem is not catched by an exception handler.
I made some research and understood that the secure CRT would just abort
the application if it detect problems, in particular for invalid parameters.
I guess this is what is happening.
My problem now is to locate where in the source code the failure occurs.
When I check the address reported by DR. Watson it points a to generic
function and is helpless.
I found information about "_set_invalid_parameter_handler" to try to
workaround
the problem. It seem that if I use my own invalid parameter handler I can
hide the symptom,
but since with release builds it does not provide the file,line and
expression informations,
it's useless to locate the problem.
In a similar case, With my VS2003 project, I could always locate the problem
in the
source code thanks to structured exceptions, with VS2008 I can't.
I guess I must somehow get the execution stack frame of the thread
when the problem occurs and search the map to locate the calling
faulty function ?
Is this the right way to proceed ?
If yes, can I get the execution stack at failure ?
Is there any other way to locate the problem ?
Thank you idvance for help help.
ps: By the way, why Secure CRT does not uses exceptions ?