limdoglim / google-breakpad

Automatically exported from code.google.com/p/google-breakpad
0 stars 0 forks source link

Airbag windows client doesn't trap VC8 parameter validation errors #119

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Have a client app using VC8 and the "_s" CRT functions that perform 
parameter 
validation
2. Hit a bug in the app that is caught by the CRT
3. Notice an error dialog that is shown to the user (even in release builds)
4. Notice that acknowledging the dialog results in the app closing without 
airbag being 
given a chance to intercept the error.

What is the expected output? What do you see instead?
The airbag exception handler should call _set_invalid_parameter_handler in VC8 
builds to 
trap this error and report it as a crash.

What version of the product are you using? On what operating system?
Windows XP

Please provide any additional information below.

Original issue reported on code.google.com by dar...@gmail.com on 26 Jan 2007 at 6:41

GoogleCodeExporter commented 9 years ago
Taking, ETA early next week.

Original comment by mmento...@gmail.com on 27 Jan 2007 at 12:48

GoogleCodeExporter commented 9 years ago

Original comment by mmento...@gmail.com on 29 Jan 2007 at 8:47

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by mmento...@gmail.com on 7 Feb 2007 at 7:13

Attachments:

GoogleCodeExporter commented 9 years ago
The problem with the _set_invalid_parameter_handler handler is that all 
paramters of
the function are NULL in release version:
http://msdn2.microsoft.com/en-us/library/a9yf33zb(VS.80).aspx "The parameters 
all
have the value NULL unless a debug version of the CRT library is used."
So the dump generated in that case won't contain any exception information to 
locate
where the crash happened :(

A workaround is to use the code explained at 
http://blog.kalmbachnet.de/?postid=75
That allows to catch all CRT exceptions in airbag, so no need to set the
invalid_parameter_handler, those will be caught like any other exception with 
the
full information.
I don't really like this modifying the memory workaround but I haven't found 
anything
better to get the exception information in all cases...

Original comment by ylenerr...@gmail.com on 7 Feb 2007 at 8:02

GoogleCodeExporter commented 9 years ago
120.2 checked in.

Comment 4: it's unfortunate that the release build of the CRT doesn't include 
the
parameters, but even so, allowing the option to trap the invalid parameter 
event in
Airbag is important.  Keep in mind that the dump that Airbag writes can produce 
stack
backtraces that should pinpoint the failed CRT check.

Original comment by mmento...@gmail.com on 7 Feb 2007 at 8:28